Replace disallowed operators in src/network/

This commit is contained in:
Dylan K. Taylor
2022-01-20 19:11:32 +00:00
parent 2bcb629d78
commit be1996752a
15 changed files with 35 additions and 35 deletions

View File

@ -180,7 +180,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{
public function onPacketReceive(int $sessionId, string $packet) : void{
if(isset($this->sessions[$sessionId])){
if($packet === "" or $packet[0] !== self::MCPE_RAKNET_PACKET_ID){
if($packet === "" || $packet[0] !== self::MCPE_RAKNET_PACKET_ID){
$this->sessions[$sessionId]->getLogger()->debug("Non-FE packet received: " . base64_encode($packet));
return;
}

View File

@ -129,7 +129,7 @@ class RakLibServer extends Thread{
public function startAndWait(int $options = PTHREADS_INHERIT_NONE) : void{
$this->start($options);
$this->synchronized(function() : void{
while(!$this->ready and $this->crashInfo === null){
while(!$this->ready && $this->crashInfo === null){
$this->wait();
}
$crashInfo = $this->crashInfo;