Improved network

This commit is contained in:
Shoghi Cervantes 2015-04-18 22:38:57 +02:00
parent 1b84340e3f
commit 5860bdcc4d
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89

View File

@ -141,14 +141,16 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
public function handleEncapsulated($identifier, EncapsulatedPacket $packet, $flags){
if(isset($this->players[$identifier])){
try{
$pk = &$this->getPacket($packet->buffer);
$pk->decode();
$this->players[$identifier]->handleDataPacket($pk);
if($packet->buffer !== ""){
$pk = $this->getPacket($packet->buffer);
$pk->decode();
$this->players[$identifier]->handleDataPacket($pk);
}
}catch(\Exception $e){
if(\pocketmine\DEBUG > 1){
$logger = $this->server->getLogger();
if($logger instanceof MainLogger){
$logger->debug("Packet " . get_class($pk) . " 0x" . bin2hex($packet->buffer));
//$logger->debug("Packet " . get_class($pk) . " 0x" . bin2hex($packet->buffer));
$logger->logException($e);
}
}