Set a new maximum number of players.
Only available to Admin.
Requires a map restart to be taken into account.
@param int $maxPlayers
@param bool $multicall
@return bool
@throws InvalidArgumentException
972023
function setMaxPlayers($maxPlayers, $multicall = false)
    {
        if (!is_int($maxPlayers)) {
            throw new InvalidArgumentException('maxPlayers = ' . print_r($maxPlayers, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($maxPlayers), $multicall);
    }
597349
public void setMax(int max) {
    if (max <= 0 || max < mProgress) {
      throw new IllegalArgumentException(
          String.format("Max (%d) must be > 0 and >= %d", max, mProgress));
    }
    mMax = max;
    invalidate();
  }
255057
function sendModeScriptCommands($commands, $multicall = false)
    {
        if (!is_array($commands) || !$commands) {
            throw new InvalidArgumentException('commands = ' . print_r($commands, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($commands), $multicall);
    }
250231
public function setUserCallback (callable $callback)
	{
		//$this->usercallback = $callback;

		if (count ($this->usercallback) > 0)
			throw new InvalidParameter ("A usercallback was already set. Use addUserCallback to add multiple callbacks");

		$this->addUserCallback ('default', $callback);

		return $this;
	}
201920
function setModeScriptSettings($settings, $multicall = false)
    {
        if (!is_array($settings) || !$settings) {
            throw new InvalidArgumentException('settings = ' . print_r($settings, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($settings), $multicall);
    }
180650
private function setTeams(array $teams)
    {
        if (empty($teams)) {
            throw new \InvalidArgumentException(
                'You must provide at least one team'
            );
        }

        foreach ($teams as $team) {
            if (!$team instanceof Team) {
                throw new \InvalidArgumentException(
                    'All teams must be an instance of NyanCat\\Team'
                );
            }

            $this->teams[$team->getName()] = $team;
        }
    }
741986
public function setMaxRuntime($maxRuntime)
    {
        if (! is_numeric($maxRuntime)) {
            throw new InvalidArgumentException(
                'Expected numeric $$maxRuntime argument'
            );
        }

        $this->maxRuntime = (int) $maxRuntime;
        return $this;
    }
806804
public function setMax($max)
    {
        if ($max <= 0) {
            throw new InvalidArgumentException(sprintf('Supplied max value: %d must be greater than 0', $max));
        }
        $this->max = $max;
        return $this;
    }
910780
public function setMaxResults($maxResults)
    {
        $this->maxResults = $maxResults;
        $this->state      = self::STATE_DIRTY;

        return $this;
    }
1367105
function setServerPassword($password, $multicall = false)
    {
        if (!is_string($password)) {
            throw new InvalidArgumentException('password = ' . print_r($password, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($password), $multicall);
    }
996673
public function setMax($max)
    {
        if (is_numeric($max) || Format::isVariableRef($max)) {
            $this->max = $max;
        } else {
            $msg = "'Max must be a numeric value or a variableRef, '" . gettype($max) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
870146
function kick($player, $message = '', $multicall = false)
    {
        $login = $this->getLogin($player);
        if ($login === false) {
            throw new InvalidArgumentException('player = ' . print_r($player, true));
        }
        if (!is_string($message)) {
            throw new InvalidArgumentException('message = ' . print_r($message, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($login, $message), $multicall);
    }
414514
public function setMaxCount(int $maxCount): StreamMetadataBuilder
    {
        if ($maxCount < 0) {
            throw new InvalidArgumentException('Max count must be positive');
        }

        $this->maxCount = $maxCount;

        return $this;
    }
1075597
public function setMaxSizeMessage($maxSizeMessage)
    {
        if (!is_string($maxSizeMessage)) {
            throw new \InvalidArgumentException('The attribute maxSizeMessage on the class Attribute has to be string (' . gettype($maxSizeMessage) . ('object' === gettype($maxSizeMessage) ? ' ' . get_class($maxSizeMessage) : '') . ' given).');
        }

        $this->maxSizeMessage = $maxSizeMessage;

        return $this;
    }
675957
private function setMaxSteps(int $maxSteps): void
    {
        $this->maxSteps = \max(0, $maxSteps);
        $this->stepWidth = $this->maxSteps ? Str::len($this->maxSteps) : 2;
    }
391520
function getDemoTokenInfosForPlayer($player, $multicall = false)
    {
        $login = $this->getLogin($player);
        if ($login === false) {
            throw new InvalidArgumentException('player = ' . print_r($player, true));
        }

        if ($multicall) {
            return $this->execute(ucfirst(__FUNCTION__), array($login), $this->structHandler('TokenInfos'));
        }
        return Structures\TokenInfos::fromArray($this->execute(ucfirst(__FUNCTION__), array($login)));
    }
745177
public function playerCalls(PlayerContract $player)
    {
        $this->checkPlayerTryingToAct($player);

        $highestChipBet = $this->highestBet();

        // current highest bet - currentPlayersChipStack
        $amountLeftToBet = Chips::fromAmount($highestChipBet->amount() - $this->playerBetStack($player)->amount());

        $chipStackLeft = Chips::fromAmount($player->chipStack()->amount() - $amountLeftToBet->amount());

        if ($chipStackLeft->amount() <= 0) {
            $amountLeftToBet = Chips::fromAmount($player->chipStack()->amount());
            $chipStackLeft = Chips::zero();
        }

        $action = $chipStackLeft->amount() === 0 ? Action::ALLIN : Action::CALL;
        $this->actions->push(new Action($player, $action, ['chips' => $amountLeftToBet]));

        $this->placeChipBet($player, $amountLeftToBet);

        $action = $chipStackLeft->amount() === 0 ? LeftToAct::ALLIN : LeftToAct::ACTIONED;
        $this->leftToAct = $this->leftToAct()->playerHasActioned($player, $action);
    }