ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/bin/cfshell
(Generate patch)

Comparing deliantra/Deliantra/bin/cfshell (file contents):
Revision 1.3 by root, Fri Jul 21 13:32:03 2006 UTC vs.
Revision 1.4 by root, Thu Aug 3 10:51:27 2006 UTC

60 60
61my $w = AnyEvent->io (fh => $rl->IN, poll => 'r', cb => sub { $rl->callback_read_char }); 61my $w = AnyEvent->io (fh => $rl->IN, poll => 'r', cb => sub { $rl->callback_read_char });
62 62
63$rl->callback_handler_install ("$ARGV[0]> ", sub { 63$rl->callback_handler_install ("$ARGV[0]> ", sub {
64 $rl->add_history ($_[0]); 64 $rl->add_history ($_[0]);
65 $cf->send_ext_req (perl_eval => $_[0], sub { 65 $cf->send_ext_req (perl_eval => code => $_[0], sub {
66 my ($data) = @_; 66 my ($msg) = @_;
67 67
68 $rl->crlf; 68 $rl->crlf;
69 69
70 my ($status, $result) = split / /, $data, 2; 70 my ($status, $result) = split / /, $data, 2;
71 print "status: $status\n"; 71 if (exists $msg->{error}) {
72 if ($status eq "ok") { 72 print "$msg->{error}\n";
73 print Dump Storable::thaw $result;
74 } else { 73 } else {
75 $result =~ s/\n$//; 74 print Dump Storable::thaw $msg->{result};
76 print "$result\n";
77 } 75 }
78 76
79 $rl->forced_update_display; 77 $rl->forced_update_display;
80 }); 78 });
81}); 79});

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines