… | |
… | |
592 | Coro::Storable. May, of course, block. Note that the executed sub may |
592 | Coro::Storable. May, of course, block. Note that the executed sub may |
593 | never block itself or use any form of event handling. |
593 | never block itself or use any form of event handling. |
594 | |
594 | |
595 | =cut |
595 | =cut |
596 | |
596 | |
|
|
597 | sub post_fork { |
|
|
598 | reset_signals; |
|
|
599 | } |
|
|
600 | |
597 | sub fork_call(&@) { |
601 | sub fork_call(&@) { |
598 | my ($cb, @args) = @_; |
602 | my ($cb, @args) = @_; |
599 | |
603 | |
600 | # we seemingly have to make a local copy of the whole thing, |
604 | # we seemingly have to make a local copy of the whole thing, |
601 | # otherwise perl prematurely frees the stuff :/ |
605 | # otherwise perl prematurely frees the stuff :/ |
602 | # TODO: investigate and fix (likely this will be rather laborious) |
606 | # TODO: investigate and fix (likely this will be rather laborious) |
603 | |
607 | |
604 | my @res = Coro::Util::fork_eval { |
608 | my @res = Coro::Util::fork_eval { |
605 | reset_signals; |
609 | cf::post_fork; |
606 | &$cb |
610 | &$cb |
607 | }, @args; |
611 | }, @args; |
608 | |
612 | |
609 | wantarray ? @res : $res[-1] |
613 | wantarray ? @res : $res[-1] |
610 | } |
614 | } |
… | |
… | |
1648 | $pl->{deny_save} = 1; |
1652 | $pl->{deny_save} = 1; |
1649 | $pl->password ("*"); # this should lock out the player until we have nuked the dir |
1653 | $pl->password ("*"); # this should lock out the player until we have nuked the dir |
1650 | |
1654 | |
1651 | $pl->invoke (cf::EVENT_PLAYER_LOGOUT, 1) if $pl->active; |
1655 | $pl->invoke (cf::EVENT_PLAYER_LOGOUT, 1) if $pl->active; |
1652 | $pl->deactivate; |
1656 | $pl->deactivate; |
|
|
1657 | |
1653 | my $killer = cf::arch::get "killer_quit"; $pl->killer ($killer); $killer->destroy; |
1658 | my $killer = cf::arch::get "killer_quit"; $pl->killer ($killer); $killer->destroy; |
|
|
1659 | ext::highscore::check ($pl->ob); |
|
|
1660 | |
1654 | $pl->invoke (cf::EVENT_PLAYER_QUIT); |
1661 | $pl->invoke (cf::EVENT_PLAYER_QUIT); |
1655 | $pl->ns->destroy if $pl->ns; |
1662 | $pl->ns->destroy if $pl->ns; |
1656 | |
1663 | |
1657 | my $path = playerdir $pl; |
1664 | my $path = playerdir $pl; |
1658 | my $temp = "$path~$cf::RUNTIME~deleting~"; |
1665 | my $temp = "$path~$cf::RUNTIME~deleting~"; |