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.335 by root, Mon Aug 20 22:21:48 2007 UTC vs.
Revision 1.336 by root, Tue Aug 21 00:31:18 2007 UTC

1505=cut 1505=cut
1506 1506
1507sub ext_reply($$@) { 1507sub ext_reply($$@) {
1508 my ($self, $id, @msg) = @_; 1508 my ($self, $id, @msg) = @_;
1509 1509
1510 if ($self->ns->extcmd == 2) { 1510 $self->ns->ext_reply ($id, @msg)
1511 $self->send ("ext " . $self->ns->{json_coder}->encode (["reply-$id", @msg]));
1512 } elsif ($self->ns->extcmd == 1) {
1513 #TODO: version 1, remove
1514 unshift @msg, msgtype => "reply", msgid => $id;
1515 $self->send ("ext " . $self->ns->{json_coder}->encode ({@msg}));
1516 }
1517} 1511}
1518 1512
1519=item $player->ext_msg ($type, @msg) 1513=item $player->ext_msg ($type, @msg)
1520 1514
1521Sends an ext event to the client. 1515Sends an ext event to the client.
2567 push @msg, msgtype => "event_$type"; 2561 push @msg, msgtype => "event_$type";
2568 $self->send_packet ("ext " . $self->{json_coder}->encode ({@msg})); 2562 $self->send_packet ("ext " . $self->{json_coder}->encode ({@msg}));
2569 } 2563 }
2570} 2564}
2571 2565
2566=item $client->ext_reply ($msgid, @msg)
2567
2568Sends an ext reply to the client.
2569
2570=cut
2571
2572sub cf::client::ext_reply($$@) {
2573 my ($self, $id, @msg) = @_;
2574
2575 if ($self->extcmd == 2) {
2576 $self->send_packet ("ext " . $self->{json_coder}->encode (["reply-$id", @msg]));
2577 } elsif ($self->ns->extcmd == 1) {
2578 #TODO: version 1, remove
2579 unshift @msg, msgtype => "reply", msgid => $id;
2580 $self->send_packet ("ext " . $self->{json_coder}->encode ({@msg}));
2581 }
2582}
2583
2572=item $success = $client->query ($flags, "text", \&cb) 2584=item $success = $client->query ($flags, "text", \&cb)
2573 2585
2574Queues a query to the client, calling the given callback with 2586Queues a query to the client, calling the given callback with
2575the reply text on a reply. flags can be C<cf::CS_QUERY_YESNO>, 2587the reply text on a reply. flags can be C<cf::CS_QUERY_YESNO>,
2576C<cf::CS_QUERY_SINGLECHAR> or C<cf::CS_QUERY_HIDEINPUT> or C<0>. 2588C<cf::CS_QUERY_SINGLECHAR> or C<cf::CS_QUERY_HIDEINPUT> or C<0>.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines