--- deliantra/server/ext/dm-support.ext 2007/11/24 05:58:40 1.17 +++ deliantra/server/ext/dm-support.ext 2012/11/06 23:33:15 1.35 @@ -21,21 +21,31 @@ Useful commands (note the '&'): +reload_pod & reload_perl & +reload_sound & reload_config & reload_regions & reload_facedata & +reload_exp_table & +reload_materials & reload_treasures & +reload_resources & reload_archetypes & ext::help::reload & ext::books::reload & ext::map_tags::reload & ext::map_world::reload & -print JSON::XS->new->pretty->encode({cf::mallinfo}) +ext::player_env::reload & +ext::map_scheduler::reload & +# ext::map_scheduler::loadall & # debugging only! +until (Coro::AnyEvent::readable \$fh, 1) { Coro::Debug::command "ps" } & +({mallinfo}) +({objinfo}) EOF print $fh "\n> "; - my $iow; $iow = EV::io $fh, EV::READ, sub { + my $iow; $iow = AE::io $fh, 0, sub { if (defined (my $cmd = <$fh>)) { $cmd =~ s/\s+$//; @@ -50,8 +60,8 @@ package cf; select $fh; - # compile first, the execute, as Coro does not support switching in eval string - my $cb = eval "sub { $cmd }"; + # compile first, then execute, as Coro does not support switching in eval string + my $cb = eval "sub { $cmd \n}"; my $t1 = Time::HiRes::time; my @res = $@ ? () : eval { $cb->() }; @@ -60,7 +70,6 @@ print "\n", "command: '$cmd'\n", "execution time: ", $t2 - $t1, "\n"; - warn "evaluation error: $@" if $@; print "evaluation error: $@\n" if $@; print "result:\n", cf::dumpval @res > 1 ? \@res : $res[0] if @res; print "\n> "; @@ -90,8 +99,7 @@ # now a shell listening on a tcp-port - let the firewall decide access rights if ($cf::CFG{perl_shell}) { if (my $listen = new IO::Socket::INET LocalAddr => $cf::CFG{perl_shell}, Listen => 1, ReuseAddr => 1, Blocking => 0) { - $LISTENER = EV::io $listen, EV::READ, sub { tcp_serve $listen->accept }; + $LISTENER = AE::io $listen, 0, sub { tcp_serve $listen->accept }; } } -