--- deliantra/server/lib/cf.pm 2007/10/01 00:44:44 1.376 +++ deliantra/server/lib/cf.pm 2007/10/08 13:58:07 1.380 @@ -12,7 +12,7 @@ use Safe; use Safe::Hole; -use Coro 3.64 (); +use Coro 4.1 (); use Coro::State; use Coro::Handle; use Coro::Event; @@ -29,7 +29,7 @@ use Digest::MD5; use Fcntl; use YAML::Syck (); -use IO::AIO 2.32 (); +use IO::AIO 2.51 (); use Time::HiRes; use Compress::LZF; use Digest::MD5 (); @@ -375,7 +375,7 @@ } if (@SLOT_QUEUE) { - # we do not use wait_For_tick() as it returns immediately when tick is inactive + # we do not use wait_for_tick() as it returns immediately when tick is inactive push @cf::WAIT_FOR_TICK, $signal; $signal->wait; } else { @@ -429,6 +429,8 @@ # this is the main coro, too bad, we have to block # till the operation succeeds, freezing the server :/ + LOG llevError | logBacktrace, Carp::longmess "sync job";#d# + # TODO: use suspend/resume instead # (but this is cancel-safe) my $freeze_guard = freeze_mainloop; @@ -1046,7 +1048,7 @@ if (@$objs) { if (my $fh = aio_open "$filename.pst~", O_WRONLY | O_CREAT, 0600) { chmod SAVE_MODE, $fh; - my $data = Storable::nfreeze { version => 1, objs => $objs }; + my $data = Coro::Storable::nfreeze { version => 1, objs => $objs }; aio_write $fh, 0, (length $data), $data, 0; aio_fsync $fh if $cf::USE_FSYNC; close $fh; @@ -1087,7 +1089,9 @@ (aio_load "$filename.pst", $av) >= 0 or return; - $av = eval { (Storable::thaw $av)->{objs} }; + my $st = eval { Coro::Storable::thaw $av } + || eval { my $guard = Coro::Storable::guard; Storable::thaw $av }; #d# compatibility, remove + $av = $st->{objs}; } utf8::decode (my $decname = $filename); @@ -2275,10 +2279,7 @@ sub deref { my ($ref) = @_; - # temporary compatibility#TODO#remove - $ref =~ s{^<}{player/<}; - - if ($ref =~ m{^player\/(<1\.\d+>)/(.*)$}) { + if ($ref =~ m{^player\/(<1\.[0-9a-f]+>)/(.*)$}) { my ($uuid, $name) = ($1, $2); my $pl = $cf::PLAYER_LOADING{$name} || cf::player::find $name or return;