Moved batch packet handling into BatchPacket->handle(), fixed data packet receive timings to include MCPE packet decode time

This commit is contained in:
Dylan K. Taylor
2017-03-20 10:20:54 +00:00
parent 9c350dbe47
commit 6ba4a8fe5c
5 changed files with 42 additions and 64 deletions

View File

@ -132,11 +132,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
try{
if($packet->buffer !== ""){
$pk = $this->getPacket($packet->buffer);
if($pk !== null){
$pk->decode();
assert($pk->feof(), "Still " . strlen(substr($pk->buffer, $pk->offset)) . " bytes unread!");
$this->players[$identifier]->handleDataPacket($pk);
}
$this->players[$identifier]->handleDataPacket($pk);
}
}catch(\Throwable $e){
if(\pocketmine\DEBUG > 1 and isset($pk)){