mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
InGamePacketHandler: return unhandled for command requests without a leading /
some clients send things without the /, f.e. websocket stuff, and we aren't ready to handle that properly yet. The result is that the command gets dumped directly into the chat instead of being unhandled.
This commit is contained in:
parent
720254f64f
commit
5b02ca8a64
@ -92,6 +92,7 @@ use function json_last_error_msg;
|
||||
use function microtime;
|
||||
use function preg_match;
|
||||
use function preg_split;
|
||||
use function strpos;
|
||||
use function trim;
|
||||
|
||||
/**
|
||||
@ -589,7 +590,11 @@ class InGamePacketHandler extends PacketHandler{
|
||||
}
|
||||
|
||||
public function handleCommandRequest(CommandRequestPacket $packet) : bool{
|
||||
return $this->player->chat($packet->command);
|
||||
if(strpos($packet->command, '/') === 0){
|
||||
$this->player->chat($packet->command);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleCommandBlockUpdate(CommandBlockUpdatePacket $packet) : bool{
|
||||
|
Loading…
x
Reference in New Issue
Block a user