Restarts the map.
Only available to Admin.
@param bool $dontClearCupScores Only available in legacy cup mode
@param bool $multicall
@return bool
554008
function restartMap($dontClearCupScores = false, $multicall = false)
    {
        if (!is_bool($dontClearCupScores)) {
            throw new InvalidArgumentException('dontClearCupScores = ' . print_r($dontClearCupScores, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($dontClearCupScores), $multicall);
    }
446119
function unBan($player, $multicall = false)
    {
        $login = $this->getLogin($player);
        if ($login === false) {
            throw new InvalidArgumentException('player = ' . print_r($player, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($login), $multicall);
    }
264814
protected function checkPreconditions(MultiBulk $iterator)
    {
        if ($iterator->getPosition() !== 0) {
            throw new \InvalidArgumentException(
                'Cannot initialize a tuple iterator using an already initiated iterator.'
            );
        }

        if (($size = count($iterator)) % 2 !== 0) {
            throw new \UnexpectedValueException('Invalid response size for a tuple iterator.');
        }
    }
732179
function setCallVoteTimeOut($timeout, $multicall = false)
    {
        if (!is_int($timeout)) {
            throw new InvalidArgumentException('timeout = ' . print_r($timeout, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($timeout), $multicall);
    }
498158
public function startHashElement($name)
    {
        $this->checkStartHashElement($name);

        $this->isEmpty = false;

        $object = new Json\JsonObject($this->json);

        if ($this->json instanceof Json\ArrayObject) {
            $this->json[] = $object;
            $this->json = $object;
        } else {
            $this->json->$name = $object;
            $this->json = $object;
        }
    }
1351855
function getLadderServerLimits($multicall = false)
    {
        if ($multicall) {
            return $this->execute(ucfirst(__FUNCTION__), array(), $this->structHandler('LadderLimits'));
        }
        return Structures\LadderLimits::fromArray($this->execute(ucfirst(__FUNCTION__)));
    }
1109119
function getForcedSkins($multicall = false)
    {
        if ($multicall) {
            return $this->execute(ucfirst(__FUNCTION__), array(), $this->structHandler('ForcedSkin', true));
        }
        return Structures\ForcedSkin::fromArrayOfArray($this->execute(ucfirst(__FUNCTION__)));
    }
499791
function allowMapDownload($allow = true, $multicall = false)
    {
        if (!is_bool($allow)) {
            throw new InvalidArgumentException('allow = ' . print_r($allow, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($allow), $multicall);
    }
965243
protected function write_multichoice(array $multichoices, $oldquestiontextformat, $questionid) {
        global $CFG;

        // The grouped array is supposed to have just one element - let us use foreach anyway
        // just to be sure we do not loose anything.
        foreach ($multichoices as $multichoice) {
            // Append an artificial 'id' attribute (is not included in moodle.xml).
            $multichoice['id'] = $this->converter->get_nextid();

            // Replay the upgrade step 2009021801.
            $multichoice['correctfeedbackformat']               = 0;
            $multichoice['partiallycorrectfeedbackformat']      = 0;
            $multichoice['incorrectfeedbackformat']             = 0;

            if ($CFG->texteditors !== 'textarea' and $oldquestiontextformat == FORMAT_MOODLE) {
                $multichoice['correctfeedback']                 = text_to_html($multichoice['correctfeedback'], false, false, true);
                $multichoice['correctfeedbackformat']           = FORMAT_HTML;
                $multichoice['partiallycorrectfeedback']        = text_to_html($multichoice['partiallycorrectfeedback'], false, false, true);
                $multichoice['partiallycorrectfeedbackformat']  = FORMAT_HTML;
                $multichoice['incorrectfeedback']               = text_to_html($multichoice['incorrectfeedback'], false, false, true);
                $multichoice['incorrectfeedbackformat']         = FORMAT_HTML;
            } else {
                $multichoice['correctfeedbackformat']           = $oldquestiontextformat;
                $multichoice['partiallycorrectfeedbackformat']  = $oldquestiontextformat;
                $multichoice['incorrectfeedbackformat']         = $oldquestiontextformat;
            }

            $multichoice['correctfeedback'] = $this->migrate_files(
                    $multichoice['correctfeedback'], 'question', 'correctfeedback', $questionid);
            $multichoice['partiallycorrectfeedback'] = $this->migrate_files(
                    $multichoice['partiallycorrectfeedback'], 'question', 'partiallycorrectfeedback', $questionid);
            $multichoice['incorrectfeedback'] = $this->migrate_files(
                    $multichoice['incorrectfeedback'], 'question', 'incorrectfeedback', $questionid);

            $this->write_xml('multichoice', $multichoice, array('/multichoice/id'));
        }
    }
654167
function _multiCallback(serverError, serverResponse, callback, interleave, requestedIds){
  var clientResponse = {};
  
  // Handle response errors
  _.each(serverResponse, function(data, id){
    var thisError = serverError;
    if(serverError && data.status.code !== 200){
      thisError = new Error(data.status.msgs.join('. '));
      thisError.code = data.status.code;
    }
    clientResponse[id] = {
      error:  thisError,
      data: data.data
    };
  });
  
  // Handle request level errors
  if(serverError && !serverResponse){
    _.each(requestedIds, function(id){
      if(_.isUndefined(clientResponse[id])){
        clientResponse[id] = {
          error: serverError,
          data: null
        };
      } 
    });
  }
  
  // Interleave validation errors
  if(interleave){
    _.extend(clientResponse, interleave);
  }
  
  callback(clientResponse);
}
1099482
function unsetServerTag($key, $multicall = false)
    {
        if (!is_string($key)) {
            throw new InvalidArgumentException('key = ' . print_r($key, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($key), $multicall);
    }
1343712
function forcePlayerTeam($player, $team, $multicall = false)
    {
        $login = $this->getLogin($player);
        if ($login === false) {
            throw new InvalidArgumentException('player = ' . print_r($player, true));
        }
        if ($team !== 0 && $team !== 1) {
            throw new InvalidArgumentException('team = ' . print_r($team, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($login, $team), $multicall);
    }
1143149
public function restartSlaves()
    {
        if ($this->inRestart) {
            return;
        }

        $this->inRestart = true;

        $this->closeSlaves();
        $this->createSlaves();

        $this->inRestart = false;
    }
109474
private function checkTaskQueue(bool $reStart): bool
    {
        if (! isset($i)) {
            static $i = 0;
        }

        if ($reStart) {
            $i = 0;
        }

        $i++;

        if ($i > TableCrontab::$taskQueue) {
            throw new \InvalidArgumentException('The crontab task-queue::' . $i . ' exceeds the threshold::' . TableCrontab::$taskQueue);
        }

        return true;
    }
383739
function _try_multicall($msgs, $timeout, $method)
		{
			// Construct multicall message
			$calls = array();
			foreach($msgs as $msg)
			{
				$call['methodName'] = new xmlrpcval($msg->method(),'string');
				$numParams = $msg->getNumParams();
				$params = array();
				for($i = 0; $i < $numParams; $i++)
				{
					$params[$i] = $msg->getParam($i);
				}
				$call['params'] = new xmlrpcval($params, 'array');
				$calls[] = new xmlrpcval($call, 'struct');
			}
			$multicall = new xmlrpcmsg('system.multicall');
			$multicall->addParam(new xmlrpcval($calls, 'array'));

			// Attempt RPC call
			$result =& $this->send($multicall, $timeout, $method);

			if($result->faultCode() != 0)
			{
				// call to system.multicall failed
				return $result;
			}

			// Unpack responses.
			$rets = $result->value();

			if ($this->return_type == 'xml')
			{
					return $rets;
			}
			else if ($this->return_type == 'phpvals')
			{
				///@todo test this code branch...
				$rets = $result->value();
				if(!is_array($rets))
				{
					return false;		// bad return type from system.multicall
				}
				$numRets = count($rets);
				if($numRets != count($msgs))
				{
					return false;		// wrong number of return values.
				}

				$response = array();
				for($i = 0; $i < $numRets; $i++)
				{
					$val = $rets[$i];
					if (!is_array($val)) {
						return false;
					}
					switch(count($val))
					{
						case 1:
							if(!isset($val[0]))
							{
								return false;		// Bad value
							}
							// Normal return value
							$response[$i] = new xmlrpcresp($val[0], 0, '', 'phpvals');
							break;
						case 2:
							///	@todo remove usage of @: it is apparently quite slow
							$code = @$val['faultCode'];
							if(!is_int($code))
							{
								return false;
							}
							$str = @$val['faultString'];
							if(!is_string($str))
							{
								return false;
							}
							$response[$i] = new xmlrpcresp(0, $code, $str);
							break;
						default:
							return false;
					}
				}
				return $response;
			}
			else // return type == 'xmlrpcvals'
			{
				$rets = $result->value();
				if($rets->kindOf() != 'array')
				{
					return false;		// bad return type from system.multicall
				}
				$numRets = $rets->arraysize();
				if($numRets != count($msgs))
				{
					return false;		// wrong number of return values.
				}

				$response = array();
				for($i = 0; $i < $numRets; $i++)
				{
					$val = $rets->arraymem($i);
					switch($val->kindOf())
					{
						case 'array':
							if($val->arraysize() != 1)
							{
								return false;		// Bad value
							}
							// Normal return value
							$response[$i] = new xmlrpcresp($val->arraymem(0));
							break;
						case 'struct':
							$code = $val->structmem('faultCode');
							if($code->kindOf() != 'scalar' || $code->scalartyp() != 'int')
							{
								return false;
							}
							$str = $val->structmem('faultString');
							if($str->kindOf() != 'scalar' || $str->scalartyp() != 'string')
							{
								return false;
							}
							$response[$i] = new xmlrpcresp(0, $code->scalarval(), $str->scalarval());
							break;
						default:
							return false;
					}
				}
				return $response;
			}
		}
366470
function sendToServerAfterMatchEnd($link, $multicall = false)
    {
        if (!is_string($link)) {
            throw new InvalidArgumentException('link = ' . print_r($link, true));
        }

        $link = str_replace("maniaplanet://", "", $link);

        return $this->execute(ucfirst(__FUNCTION__), array($link), $multicall);
    }
996185
function getManialinkPageAnswers($multicall = false)
    {
        if ($multicall) {
            return $this->execute(ucfirst(__FUNCTION__), array(), $this->structHandler('PlayerAnswer', true));
        }
        return Structures\PlayerAnswer::fromArrayOfArray($this->execute(ucfirst(__FUNCTION__)));
    }