--- deliantra/server/ext/login.ext 2007/05/26 15:44:03 1.48 +++ deliantra/server/ext/login.ext 2007/06/11 21:38:13 1.53 @@ -1,4 +1,4 @@ -#! perl # MANDATORY +#! perl # mandatory # login handling @@ -6,6 +6,8 @@ use Coro::AIO; use List::Util qw(min max); +our %EXT_SETUP; + # paranoia function to overwrite a string-in-place sub nuke_str { substr $_[0], 0, (length $_[0]), "x" x length $_[0] @@ -592,19 +594,16 @@ cf::wait_for_tick_begin; $pl->save; - unless ($pl->active) { + unless ($pl->active || $pl->ns) { # check refcounts, this is tricky and needs to be adjusted to fit server internals my $ob = $pl->ob; - Scalar::Util::weaken $pl; - Scalar::Util::weaken $ob; - my $a_ = $pl->refcnt;#d# - my $b_ = $ob->refcnt;#d# + my $pl_ref = $pl->refcnt_cnt; my $ob_ref = $ob->refcnt_cnt; - ## pl_ref == one from object + one from cf::PLAYER - ## ob_ref == one from simply being an object - if ($pl_ref == 2 && $ob_ref == 1) { + ## pl_ref == $pl + ob->contr + %cf::PLAYER + ## ob_ref == $ob + pl->observe + simply being an object + if ($pl_ref == 3 && $ob_ref == 3) { warn "player-scheduler destroy ", $ob->name;#d# # remove from sight and get fresh "copies" @@ -614,7 +613,10 @@ $ob->destroy; $pl->destroy; } else { - warn "player-scheduler refcnt ", $ob->name, " pp$pl_ref,pc$a_ op$ob_ref,oc$b_\n";#d# + my $a_ = $pl->refcnt;#d# + my $b_ = $ob->refcnt;#d# + + warn "player-scheduler refcnt ", $ob->name, " pl $pl_ref ob $ob_ref (C pl $a_ ob $b_)\n";#d# } } }