--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/05/30 14:59:26 1.12 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/06/05 05:06:23 1.19 @@ -270,7 +270,7 @@ # I love transactions for (1..100) { my $txn = $CFClient::DB_ENV->txn_begin; - my $status = $self->{facemap}->db_get (id => $id, BerkeleyDB::DB_RMW); + my $status = $self->{facemap}->db_get (id => $id); if ($status == 0 || $status == BerkeleyDB::DB_NOTFOUND) { $id = ($id || 16) + 1; if ($self->{facemap}->put (id => $id) == 0 @@ -280,7 +280,7 @@ goto gotid; } } - $txn->abort; + $txn->txn_abort; } CFClient::fatal "maximum number of transaction retries reached - database problems?"; @@ -431,7 +431,7 @@ $self->{statusbox}->add ($text, group => $text, fg => $color[$color], - timeout => 10, + timeout => $color >= 2 ? 60 : 10, tooltip_font => $::FONT_FIXED, ); } @@ -447,20 +447,20 @@ # TODO # create a widget dynamically, using spell face (CF::Protocol downloads them) + $::SETUP_SPELLS->add_spell ($spell); + $self->{map_widget}->add_command ("invoke $spell->{name}", CFClient::UI::Label::escape $spell->{message}); $self->{map_widget}->add_command ("cast $spell->{name}", CFClient::UI::Label::escape $spell->{message}); } sub spell_delete { my ($self, $spell) = @_; + $::SETUP_SPELLS->remove_spell ($spell); } sub addme_success { my ($self) = @_; - $self->send ("command output-sync $::CFG->{output_sync}"); - $self->send ("command output-count $::CFG->{output_count}"); - my $parser = new Pod::POM; my $pod = $parser->parse_file (CFClient::find_rcfile "pod/skill_help.pod"); @@ -511,14 +511,14 @@ $self->send ("requestinfo image_sums $face $face"); $self->{statusbox}->add (CFClient::UI::Label::escape "prefetching $todo", - group => "prefetch", timeout => 2, fg => [1, 1, 0, 0.5]); + group => "prefetch", timeout => 3, fg => [1, 1, 0, 0.5]); } elsif (!exists $self->{num_faces}) { $self->send ("requestinfo image_info"); $self->{num_faces} = 0; $self->{statusbox}->add (CFClient::UI::Label::escape "starting to prefetch", - group => "prefetch", timeout => 2, fg => [1, 1, 0, 0.5]); + group => "prefetch", timeout => 3, fg => [1, 1, 0, 0.5]); } } @@ -660,6 +660,10 @@ sub player_update { my ($self, $player) = @_; $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $player->{weight} / 1000); + + # do it here because it is ignored earlier, and there is no "login" event + $self->send_command ("output-sync $::CFG->{output_sync}"); + $self->send_command ("output-count $::CFG->{output_count}"); } 1;