ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.474 by root, Thu Jul 16 21:42:56 2009 UTC vs.
Revision 1.477 by root, Wed Sep 2 22:52:36 2009 UTC

222 222
223=back 223=back
224 224
225=cut 225=cut
226 226
227BEGIN { 227$Coro::State::WARNHOOK = sub {
228 *CORE::GLOBAL::warn = sub {
229 my $msg = join "", @_; 228 my $msg = join "", @_;
230 229
231 $msg .= "\n" 230 $msg .= "\n"
232 unless $msg =~ /\n$/; 231 unless $msg =~ /\n$/;
233 232
234 $msg =~ s/([\x00-\x08\x0b-\x1f])/sprintf "\\x%02x", ord $1/ge; 233 $msg =~ s/([\x00-\x08\x0b-\x1f])/sprintf "\\x%02x", ord $1/ge;
235 234
236 LOG llevError, $msg; 235 LOG llevError, $msg;
237 }; 236};
238}
239 237
240$Coro::State::DIEHOOK = sub { 238$Coro::State::DIEHOOK = sub {
241 return unless $^S eq 0; # "eq", not "==" 239 return unless $^S eq 0; # "eq", not "=="
240
241 warn Carp::longmess $_[0];
242 242
243 if ($Coro::current == $Coro::main) {#d# 243 if ($Coro::current == $Coro::main) {#d#
244 warn "DIEHOOK called in main context, Coro bug?\n";#d# 244 warn "DIEHOOK called in main context, Coro bug?\n";#d#
245 return;#d# 245 return;#d#
246 }#d# 246 }#d#
247 247
248 # kill coroutine otherwise 248 # kill coroutine otherwise
249 warn Carp::longmess $_[0];
250 Coro::terminate 249 Coro::terminate
251}; 250};
252
253$SIG{__DIE__} = sub { }; #d#?
254 251
255@safe::cf::global::ISA = @cf::global::ISA = 'cf::attachable'; 252@safe::cf::global::ISA = @cf::global::ISA = 'cf::attachable';
256@safe::cf::object::ISA = @cf::object::ISA = 'cf::attachable'; 253@safe::cf::object::ISA = @cf::object::ISA = 'cf::attachable';
257@safe::cf::player::ISA = @cf::player::ISA = 'cf::attachable'; 254@safe::cf::player::ISA = @cf::player::ISA = 'cf::attachable';
258@safe::cf::client::ISA = @cf::client::ISA = 'cf::attachable'; 255@safe::cf::client::ISA = @cf::client::ISA = 'cf::attachable';
2534 2531
2535 $map->load; 2532 $map->load;
2536 $map->load_neighbours; 2533 $map->load_neighbours;
2537 2534
2538 return unless $self->contr->active; 2535 return unless $self->contr->active;
2539 $self->flag (cf::FLAG_DEBUG, 0);#d# temp
2540 $self->activate_recursive;
2541 2536
2542 local $self->{_prev_pos} = $link_pos; # ugly hack for rent.ext 2537 local $self->{_prev_pos} = $link_pos; # ugly hack for rent.ext
2543 $self->enter_map ($map, $x, $y); 2538 $self->enter_map ($map, $x, $y);
2539
2540 # only activate afterwards, to support waiting in hooks
2541 $self->activate_recursive;
2544} 2542}
2545 2543
2546=item $player_object->goto ($path, $x, $y[, $check->($map)[, $done->()]]) 2544=item $player_object->goto ($path, $x, $y[, $check->($map)[, $done->()]])
2547 2545
2548Moves the player to the given map-path and coordinates by first freezing 2546Moves the player to the given map-path and coordinates by first freezing
3460 load_extensions; 3458 load_extensions;
3461 3459
3462 utime time, time, $RUNTIMEFILE; 3460 utime time, time, $RUNTIMEFILE;
3463 3461
3464 # no (long-running) fork's whatsoever before this point(!) 3462 # no (long-running) fork's whatsoever before this point(!)
3463 use POSIX ();
3465 POSIX::close delete $ENV{LOCKUTIL_LOCK_FD} if exists $ENV{LOCKUTIL_LOCK_FD}; 3464 POSIX::close delete $ENV{LOCKUTIL_LOCK_FD} if exists $ENV{LOCKUTIL_LOCK_FD};
3466 3465
3467 (pop @POST_INIT)->(0) while @POST_INIT; 3466 (pop @POST_INIT)->(0) while @POST_INIT;
3468 }; 3467 };
3469 3468

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines