Merge branch 'php/7.0'

This commit is contained in:
Dylan K. Taylor 2017-09-01 20:22:25 +01:00
commit 8b13b520e0

View File

@ -133,6 +133,8 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
public function handleEncapsulated($identifier, EncapsulatedPacket $packet, $flags){ public function handleEncapsulated($identifier, EncapsulatedPacket $packet, $flags){
if(isset($this->players[$identifier])){ if(isset($this->players[$identifier])){
//get this now for blocking in case the player was closed before the exception was raised
$address = $this->players[$identifier]->getAddress();
try{ try{
if($packet->buffer !== ""){ if($packet->buffer !== ""){
$pk = $this->getPacket($packet->buffer); $pk = $this->getPacket($packet->buffer);
@ -143,7 +145,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
$logger->debug("Packet " . (isset($pk) ? get_class($pk) : "unknown") . " 0x" . bin2hex($packet->buffer)); $logger->debug("Packet " . (isset($pk) ? get_class($pk) : "unknown") . " 0x" . bin2hex($packet->buffer));
$logger->logException($e); $logger->logException($e);
$this->interface->blockAddress($this->players[$identifier]->getAddress(), 5); $this->interface->blockAddress($address, 5);
} }
} }
} }