Updated to latest RakLib bleeding edge

this version brings quite a few inter-thread communication improvements.
This commit is contained in:
Dylan K. Taylor
2020-03-29 16:52:36 +01:00
parent eb7c31d3ff
commit f779881b6a
2 changed files with 7 additions and 8 deletions

View File

@@ -139,15 +139,15 @@ class RakLibInterface implements ServerInstance, AdvancedNetworkInterface{
$this->sessions[$sessionId] = $session;
}
public function handleEncapsulated(int $sessionId, EncapsulatedPacket $packet, int $flags) : void{
public function handleEncapsulated(int $sessionId, string $packet) : void{
if(isset($this->sessions[$sessionId])){
if($packet->buffer === "" or $packet->buffer{0} !== self::MCPE_RAKNET_PACKET_ID){
if($packet === "" or $packet[0] !== self::MCPE_RAKNET_PACKET_ID){
return;
}
//get this now for blocking in case the player was closed before the exception was raised
$session = $this->sessions[$sessionId];
$address = $session->getIp();
$buf = substr($packet->buffer, 1);
$buf = substr($packet, 1);
try{
$session->handleEncoded($buf);
}catch(BadPacketException $e){