mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Unknown packets are always discarded even if they have been processed
This commit is contained in:
parent
e428b4cfc4
commit
be7e5cd67a
@ -28,7 +28,7 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
class PocketMinecraftServer{
|
||||
public $tCnt;
|
||||
public $version, $invisible, $api, $tickMeasure, $preparedSQL, $seed, $gamemode, $name, $maxClients, $clients, $eidCnt, $custom, $description, $motd, $timePerSecond, $spawn, $entities, $mapDir, $mapName, $map, $levelData, $tileEntities;
|
||||
private $serverip, $database, $interface, $evCnt, $handCnt, $events, $eventsID, $handlers, $serverType, $lastTick;
|
||||
private $port, $serverip, $database, $interface, $evCnt, $handCnt, $events, $eventsID, $handlers, $serverType, $lastTick;
|
||||
|
||||
private function load(){
|
||||
$this->version = new VersionString();
|
||||
|
@ -82,18 +82,20 @@ class MinecraftInterface{
|
||||
}
|
||||
$pid = ord($buf{0});
|
||||
$struct = $this->getStruct($pid);
|
||||
if($struct === false and ServerAPI::request()->api->dhandle("server.unknownpacket", array(
|
||||
"pid" => $pid,
|
||||
"data" => array(),
|
||||
"raw" => $buf,
|
||||
"ip" => $source,
|
||||
"port" => $port
|
||||
)) !== true){
|
||||
console("[ERROR] Unknown Packet ID 0x".Utils::strToHex(chr($pid)), true, true, 0);
|
||||
$p = "[".(microtime(true) - $this->start)."] [".((($origin === "client" and $this->client === true) or ($origin === "server" and $this->client === false)) ? "CLIENT->SERVER":"SERVER->CLIENT")." ".$ip.":".$port."]: Error, bad packet id 0x".Utils::strToHex(chr($pid))." [length ".strlen($buf)."]".PHP_EOL;
|
||||
$p .= Utils::hexdump($buf);
|
||||
$p .= PHP_EOL;
|
||||
logg($p, "packets", true, 2);
|
||||
if($struct === false){
|
||||
if(ServerAPI::request()->api->dhandle("server.unknownpacket", array(
|
||||
"pid" => $pid,
|
||||
"data" => array(),
|
||||
"raw" => $buf,
|
||||
"ip" => $source,
|
||||
"port" => $port
|
||||
)) !== true){
|
||||
console("[ERROR] Unknown Packet ID 0x".Utils::strToHex(chr($pid)), true, true, 0);
|
||||
$p = "[".(microtime(true) - $this->start)."] [".((($origin === "client" and $this->client === true) or ($origin === "server" and $this->client === false)) ? "CLIENT->SERVER":"SERVER->CLIENT")." ".$ip.":".$port."]: Error, bad packet id 0x".Utils::strToHex(chr($pid))." [length ".strlen($buf)."]".PHP_EOL;
|
||||
$p .= Utils::hexdump($buf);
|
||||
$p .= PHP_EOL;
|
||||
logg($p, "packets", true, 2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user