--- deliantra/Deliantra-Client/DC/DB.pm 2007/12/26 21:03:21 1.29 +++ deliantra/Deliantra-Client/DC/DB.pm 2007/12/27 18:35:56 1.30 @@ -32,6 +32,8 @@ print STDERR "INFO: moved old database from $Deliantra::OLDDIR/$DBDIR to $DB_HOME\n"; } +BDB::max_poll_time 0.03; + our $DB_ENV; our $DB_STATE; our %DB_TABLE; @@ -169,20 +171,6 @@ sub get_tile_id_sync($) { my ($name) = @_; - # fetch the full face table first - unless ($tilemap) { - do_table facemap => sub { - $tilemap = $_[0]; - delete $tilemap->{id}; - my %maptile = reverse %$tilemap;#d# - if ((scalar keys %$tilemap) != (scalar keys %maptile)) {#d# - $tilemap = { };#d# - DC::error "FATAL: facemap is not a 1:1 mapping, please report this and delete your $DB_HOME directory!\n";#d# - }#d# - }; - BDB::flush; - } - $tilemap->{$name} ||= do { my $id; do_get_tile_id $name, sub { @@ -226,6 +214,21 @@ DC::DB::Server::req (logprint => @_); } +############################################################################# + +# fetch the full face table first +unless ($tilemap) { + do_table facemap => sub { + $tilemap = $_[0]; + delete $tilemap->{id}; + my %maptile = reverse %$tilemap;#d# + if ((scalar keys %$tilemap) != (scalar keys %maptile)) {#d# + $tilemap = { };#d# + DC::error "FATAL: facemap is not a 1:1 mapping, please report this and delete your $DB_HOME directory!\n";#d# + }#d# + }; +} + package DC::DB::Server; use strict; @@ -365,7 +368,7 @@ my $pid = fork; if (defined $pid && !$pid) { - local $SIG{QUIT}; + local $SIG{QUIT} = "IGNORE"; local $SIG{__DIE__}; local $SIG{__WARN__}; eval {