Пример #1
0
 public function close(Player $player, $reason = "unknown reason")
 {
     if (isset($this->sessions[$player])) {
         $identifier = $this->sessions[$player];
         $this->sessions->detach($player);
         unset($this->sessionsPlayers[$identifier]);
         $player->close(TextFormat::YELLOW . $player->getName() . " has left the game", "Connection closed");
     } else {
         return;
     }
     $this->thread->pushMainToThreadPacket(chr(ServerManager::PACKET_CLOSE_SESSION) . Binary::writeInt($identifier));
 }
Пример #2
0
 public function close(Player $player, $reason = "unknown reason")
 {
     if (isset($this->sessions[$player])) {
         $identifier = $this->sessions[$player];
         $this->sessions->detach($player);
         unset($this->identifiers[$identifier]);
         $this->thread->pushMainToThreadPacket(chr(ServerManager::PACKET_CLOSE_SESSION) . Binary::writeInt($identifier));
     } else {
         return;
     }
 }