… | |
… | |
1149 | my ($type, $reply, @payload) = |
1149 | my ($type, $reply, @payload) = |
1150 | "ARRAY" eq ref $msg |
1150 | "ARRAY" eq ref $msg |
1151 | ? @$msg |
1151 | ? @$msg |
1152 | : ($msg->{msgtype}, $msg->{msgid}, %$msg); # TODO: version 1, remove |
1152 | : ($msg->{msgtype}, $msg->{msgid}, %$msg); # TODO: version 1, remove |
1153 | |
1153 | |
|
|
1154 | my @reply; |
|
|
1155 | |
1154 | if (my $cb = $EXTCMD{$type}) { |
1156 | if (my $cb = $EXTCMD{$type}) { |
1155 | my @reply = $cb->($pl, @payload); |
1157 | @reply = $cb->($pl, @payload); |
1156 | |
|
|
1157 | $pl->ext_reply ($reply, @reply) |
|
|
1158 | if $reply; |
|
|
1159 | } |
1158 | } |
|
|
1159 | |
|
|
1160 | $pl->ext_reply ($reply, @reply) |
|
|
1161 | if $reply; |
|
|
1162 | |
1160 | } else { |
1163 | } else { |
1161 | warn "player " . ($pl->ob->name) . " sent unparseable ext message: <$buf>\n"; |
1164 | warn "player " . ($pl->ob->name) . " sent unparseable ext message: <$buf>\n"; |
1162 | } |
1165 | } |
1163 | |
1166 | |
1164 | cf::override; |
1167 | cf::override; |
… | |
… | |
2646 | my ($type, $reply, @payload) = |
2649 | my ($type, $reply, @payload) = |
2647 | "ARRAY" eq ref $msg |
2650 | "ARRAY" eq ref $msg |
2648 | ? @$msg |
2651 | ? @$msg |
2649 | : ($msg->{msgtype}, $msg->{msgid}, %$msg); # TODO: version 1, remove |
2652 | : ($msg->{msgtype}, $msg->{msgid}, %$msg); # TODO: version 1, remove |
2650 | |
2653 | |
|
|
2654 | my @reply; |
|
|
2655 | |
2651 | if (my $cb = $EXTICMD{$type}) { |
2656 | if (my $cb = $EXTICMD{$type}) { |
2652 | my @reply = $cb->($ns, @payload); |
2657 | @reply = $cb->($ns, @payload); |
2653 | |
|
|
2654 | $ns->ext_reply ($reply, @reply) |
|
|
2655 | if $reply; |
|
|
2656 | } |
2658 | } |
|
|
2659 | |
|
|
2660 | $ns->ext_reply ($reply, @reply) |
|
|
2661 | if $reply; |
|
|
2662 | |
2657 | } else { |
2663 | } else { |
2658 | warn "client " . ($ns->pl ? $ns->pl->ob->name : $ns->host) . " sent unparseable exti message: <$buf>\n"; |
2664 | warn "client " . ($ns->pl ? $ns->pl->ob->name : $ns->host) . " sent unparseable exti message: <$buf>\n"; |
2659 | } |
2665 | } |
2660 | |
2666 | |
2661 | cf::override; |
2667 | cf::override; |