--- deliantra/server/ext/login.ext 2007/01/08 23:36:16 1.21 +++ deliantra/server/ext/login.ext 2007/01/09 21:32:42 1.24 @@ -296,6 +296,7 @@ # update respawn position $pl->savebed ($bed->map->path, $bed->x, $bed->y); + cf::async { $pl->save }; $pl->killer ("left"); $ob->check_score; @@ -342,7 +343,6 @@ our $SCHEDULE_INTERVAL = 10; # time the player scheduler sleeps between runs our $SAVE_TIMEOUT = 20; # save players every n seconds -our $SAVE_INTERVAL = 1.1; # save at max. one player every $SAVE_INTERVAL our $SCHEDULER = cf::async_ext { while () { @@ -360,6 +360,7 @@ eval { if ($pl->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) { + $cf::WAIT_FOR_TICK_ONE->wait; $pl->save; unless ($pl->active) { @@ -367,8 +368,8 @@ my $ob = $pl->ob; Scalar::Util::weaken $pl; Scalar::Util::weaken $ob; - my $a_ = $pl->refcnt; - my $b_ = $ob->refcnt; + my $a_ = $pl->refcnt;#d# + my $b_ = $ob->refcnt;#d# my $pl_ref = $pl->refcnt_cnt; my $ob_ref = $ob->refcnt_cnt; @@ -387,7 +388,6 @@ warn "player-scheduler refcnt ", $ob->name, " $pl_ref,$a_ $ob_ref,$b_\n";#d# } } - Coro::Timer::sleep $SAVE_INTERVAL; } }; warn $@ if $@;