… | |
… | |
1124 | } |
1124 | } |
1125 | |
1125 | |
1126 | \@paths |
1126 | \@paths |
1127 | } |
1127 | } |
1128 | |
1128 | |
1129 | =item $player->ext_reply ($msgid, $msgtype, %msg) |
1129 | =item $player->ext_reply ($msgid, %msg) |
1130 | |
1130 | |
1131 | Sends an ext reply to the player. |
1131 | Sends an ext reply to the player. |
1132 | |
1132 | |
1133 | =cut |
1133 | =cut |
1134 | |
1134 | |
1135 | sub ext_reply($$$%) { |
1135 | sub ext_reply($$%) { |
1136 | my ($self, $id, %msg) = @_; |
1136 | my ($self, $id, %msg) = @_; |
1137 | |
1137 | |
1138 | $msg{msgid} = $id; |
1138 | $msg{msgid} = $id; |
1139 | |
1139 | |
1140 | $self->send ("ext " . cf::to_json \%msg); |
1140 | $self->send ("ext " . cf::to_json \%msg); |
|
|
1141 | } |
|
|
1142 | |
|
|
1143 | =item $player->ext_event ($type, %msg) |
|
|
1144 | |
|
|
1145 | Sends an ext event to the client. |
|
|
1146 | |
|
|
1147 | =cut |
|
|
1148 | |
|
|
1149 | sub ext_event($$%) { |
|
|
1150 | my ($self, $type, %msg) = @_; |
|
|
1151 | |
|
|
1152 | $self->ns->ext_event ($type, %msg); |
1141 | } |
1153 | } |
1142 | |
1154 | |
1143 | package cf; |
1155 | package cf; |
1144 | |
1156 | |
1145 | =back |
1157 | =back |
… | |
… | |
1998 | |
2010 | |
1999 | utf8::encode $text; |
2011 | utf8::encode $text; |
2000 | $self->send_packet (sprintf "drawinfo %d %s", $flags || cf::NDI_BLACK, $text); |
2012 | $self->send_packet (sprintf "drawinfo %d %s", $flags || cf::NDI_BLACK, $text); |
2001 | } |
2013 | } |
2002 | |
2014 | |
|
|
2015 | =item $client->ext_event ($type, %msg) |
|
|
2016 | |
|
|
2017 | Sends an exti event to the client. |
|
|
2018 | |
|
|
2019 | =cut |
|
|
2020 | |
|
|
2021 | sub cf::client::ext_event($$%) { |
|
|
2022 | my ($self, $type, %msg) = @_; |
|
|
2023 | |
|
|
2024 | $msg{msgtype} = "event_$type"; |
|
|
2025 | $self->send_packet ("ext " . cf::to_json \%msg); |
|
|
2026 | } |
2003 | |
2027 | |
2004 | =item $success = $client->query ($flags, "text", \&cb) |
2028 | =item $success = $client->query ($flags, "text", \&cb) |
2005 | |
2029 | |
2006 | Queues a query to the client, calling the given callback with |
2030 | Queues a query to the client, calling the given callback with |
2007 | the reply text on a reply. flags can be C<cf::CS_QUERY_YESNO>, |
2031 | the reply text on a reply. flags can be C<cf::CS_QUERY_YESNO>, |