--- deliantra/Deliantra-Client/DC.pm 2006/05/29 21:10:47 1.75 +++ deliantra/Deliantra-Client/DC.pm 2006/05/30 08:12:50 1.80 @@ -72,20 +72,31 @@ mkdir "$Crossfire::VARDIR/cfplus", 0777; -our $DB_ENV = new BerkeleyDB::Env - -Home => "$Crossfire::VARDIR/cfplus", - -Cachesize => 1_000_000, - -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt", +our $DB_ENV; + +{ + use strict; + + my $recover = $BerkeleyDB::db_version >= 4.4 + ? eval "DB_REGISTER | DB_RECOVER" + : 0; + + $DB_ENV = new BerkeleyDB::Env + -Home => "$Crossfire::VARDIR/cfplus", + -Cachesize => 1_000_000, + -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt", # -ErrPrefix => "DATABASE", - -Verbose => 1, - -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN, - or die "unable to create/open database home $Crossfire::VARDIR/cfplus: $BerkeleyDB::Error"; + -Verbose => 1, + -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | $recover, + -SetFlags => DB_AUTO_COMMIT | DB_LOG_AUTOREMOVE, + or die "unable to create/open database home $Crossfire::VARDIR/cfplus: $BerkeleyDB::Error"; +} sub db_table($) { my ($table) = @_; $table =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge; - + new CFClient::Database -Env => $DB_ENV, -Filename => $table, @@ -93,7 +104,7 @@ # -Subname => $table, -Property => DB_CHKSUM, -Flags => DB_CREATE | DB_UPGRADE, - or die "unable to create/open database table $_[0]: $BerkeleyDB::Error"; + or die "unable to create/open database table $_[0]: $BerkeleyDB::Error" } sub pod_to_pango($) { @@ -242,7 +253,8 @@ $targ = $::CONN->{open_container}; } - $::CONN->send ("move $targ $self->{tag} 0"); + $::CONN->send ("move $targ $self->{tag} 0") + if $targ || !($self->{flags} & F_LOCKED); } elsif ($ev->{button} == 1) { $::CONN->send ("examine $self->{tag}"); } elsif ($ev->{button} == 2) { @@ -381,7 +393,9 @@ my ($cmd) = @_; my $w = new CFClient::UI::FancyFrame - title => "Bind Action"; + title => "Bind Action", + x => "center", + y => "center"; $w->add (my $vb = new CFClient::UI::VBox); $vb->add (new CFClient::UI::Label @@ -421,7 +435,6 @@ }); $entry->focus_in; - $w->center; $w->show; }