public function addSpectator(Gamer $gamer, int &$fault = MatchJoinFault::SUCCESS) : bool { if (!$this->hasSpectatePermission($gamer->getPlayer())) { $fault = MatchJoinFault::NO_PERM; return false; } if ($gamer->getModule() !== $this->game) { $fault = MatchJoinFault::NOT_IN_GAME; return false; } $this->spectators[$gamer->getId()] = $gamer; $gamer->getPlayer()->teleport($this->getMatchConfig()->getNextSpectatorJoinPosition()); return true; }
public function addSpectator(Gamer $gamer, int &$fault = MatchJoinFault::SUCCESS) : bool { if (!$this->hasSpectatePermission($gamer->getPlayer())) { $fault = MatchJoinFault::NO_PERM; return false; } $this->spectators[$gamer->getId()] = $gamer; // TODO return true; }