ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/dm-support.ext
(Generate patch)

Comparing deliantra/server/ext/dm-support.ext (file contents):
Revision 1.15 by root, Thu Oct 18 02:56:13 2007 UTC vs.
Revision 1.16 by root, Wed Nov 14 08:09:46 2007 UTC

33ext::map_world::reload & 33ext::map_world::reload &
34print JSON::XS->new->pretty->encode({cf::mallinfo}) 34print JSON::XS->new->pretty->encode({cf::mallinfo})
35EOF 35EOF
36 print $fh "\n> "; 36 print $fh "\n> ";
37 37
38 Event->io (fd => $fh, poll => 'r', data => 0, cb => sub { 38 my $iow; $iow = EV::io $fh, EV::READ, sub {
39 if (defined (my $cmd = <$fh>)) { 39 if (defined (my $cmd = <$fh>)) {
40 $cmd =~ s/\s+$//; 40 $cmd =~ s/\s+$//;
41 41
42 if ($cmd =~ /^\s*exit\b/i) { 42 if ($cmd =~ /^\s*exit\b/i) {
43 print $fh "will not exit() server.\n"; 43 print $fh "will not exit() server.\n";
78 } 78 }
79 } 79 }
80 80
81 print $fh "\n> "; 81 print $fh "\n> ";
82 } else { 82 } else {
83 $_[0]->w->cancel; 83 undef $iow;
84 } 84 }
85 }); 85 };
86} 86}
87
88our $LISTENER;
87 89
88# now a shell listening on a tcp-port - let the firewall decide access rights 90# now a shell listening on a tcp-port - let the firewall decide access rights
89if ($cf::CFG{perl_shell}) { 91if ($cf::CFG{perl_shell}) {
90 if (my $listen = new IO::Socket::INET LocalAddr => $cf::CFG{perl_shell}, Listen => 1, ReuseAddr => 1) { 92 if (my $listen = new IO::Socket::INET LocalAddr => $cf::CFG{perl_shell}, Listen => 1, ReuseAddr => 1) {
91 Event->io (fd => $listen, poll => 'r', data => cf::WF_AUTOCANCEL, cb => sub { tcp_serve $listen->accept }); 93 $LISTENER = EV::io $listen, EV::READ, sub { tcp_serve $listen->accept };
92 } 94 }
93} 95}
94 96
95 97

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines