RakLibInterface: Use NetworkSession API for getting IP instead of Player

soon the network interfaces won't be dealing with Players at all.
This commit is contained in:
Dylan K. Taylor 2018-07-21 18:41:11 +01:00
parent ca1a0c8643
commit b93318b2cf

View File

@ -144,7 +144,7 @@ class RakLibInterface implements ServerInstance, AdvancedNetworkInterface{
public function handleEncapsulated(string $identifier, EncapsulatedPacket $packet, int $flags) : void{
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();
$address = $this->players[$identifier]->getNetworkSession()->getIp();
try{
if($packet->buffer !== "" and $packet->buffer{0} === self::MCPE_RAKNET_PACKET_ID){ //Batch
$this->players[$identifier]->getNetworkSession()->handleEncoded(substr($packet->buffer, 1));