--- deliantra/server/lib/cf.pm 2008/05/29 03:27:37 1.434 +++ deliantra/server/lib/cf.pm 2008/07/14 16:42:49 1.439 @@ -42,7 +42,7 @@ use Coro::Semaphore; use Coro::AnyEvent; use Coro::AIO; -use Coro::BDB; +use Coro::BDB 1.6; use Coro::Storable; use Coro::Util (); @@ -59,8 +59,6 @@ AnyEvent::detect; -IO::AIO::max_poll_reqs 1;#d# - # configure various modules to our taste # $Storable::canonical = 1; # reduce rsync transfers @@ -2090,7 +2088,7 @@ $self->_load_objects ($f) or return; - $self->set_object_flag (cf::FLAG_OBJ_ORIGINAL, 1) + $self->post_load_original if delete $self->{load_original}; if (my $uniq = $self->uniq_path) { @@ -2618,6 +2616,9 @@ the new (success) or old (failed) map position. In either case, $done will be called at the end of this process. +Note that $check will be called with a potentially non-loaded map, so if +it needs a loaded map it has to call C<< ->load >>. + =cut our $GOTOGEN; @@ -3129,7 +3130,7 @@ for ( ["cf::object" => qw(contr pay_amount pay_player map force_find force_add x y insert remove inv nrof name archname title slaying race - decrease split destroy)], + decrease split destroy change_exp)], ["cf::object::player" => qw(player)], ["cf::player" => qw(peaceful)], ["cf::map" => qw(trigger)], @@ -3400,6 +3401,8 @@ sub init { my $guard = freeze_mainloop; + evthread_start IO::AIO::poll_fileno; + reload_resources; } @@ -3795,8 +3798,9 @@ unless ($DB_ENV) { $DB_ENV = BDB::db_env_create; - $DB_ENV->set_flags (BDB::AUTO_COMMIT | BDB::REGION_INIT | BDB::TXN_NOSYNC - | BDB::LOG_AUTOREMOVE, 1); + $DB_ENV->set_flags (BDB::AUTO_COMMIT | BDB::REGION_INIT); + $DB_ENV->set_flags (&BDB::LOG_AUTOREMOVE ) if BDB::VERSION v0, v4.7; + $DB_ENV->log_set_config (&BDB::LOG_AUTO_REMOVE) if BDB::VERSION v4.7; $DB_ENV->set_timeout (30, BDB::SET_TXN_TIMEOUT); $DB_ENV->set_timeout (30, BDB::SET_LOCK_TIMEOUT); @@ -3832,7 +3836,7 @@ IO::AIO::min_parallel 8; IO::AIO::max_poll_time $TICK * 0.1; - #undef $AnyEvent::AIO::WATCHER; + undef $AnyEvent::AIO::WATCHER; } my $_log_backtrace; @@ -3880,7 +3884,5 @@ END { cf::emergency_save } -evthread_start IO::AIO::poll_fileno; - 1