maniaplanet / manialive

PHP controller for the ManiaPlanet Dedicated Server
GNU Lesser General Public License v3.0
9 stars 4 forks source link

[patch] wrong method for trackmania chooseChallenge, should be chooseNextChallenge #11

Closed magnetik closed 10 years ago

magnetik commented 10 years ago

From petri.ja...@gmail.com on January 04, 2011 19:25:28

instead there is chooseNextChallenge and chooseNextChallengeList

patch: line 3017 to 3046 in DedicatedApi\Connection.php

/**
 * Set as next challenge the one with the specified filename, if it is present in the selection.
 * @param string $filename
 * @param bool $multicall
 * @throws InvalidArgumentException
 * @return bool
 */
function chooseNextChallenge($filename, $multicall = false)
{
    if(!is_string($filename))
    throw new InvalidArgumentException('filename = '.print_r($filename,true));

    return $this->execute(ucfirst(__FUNCTION__), array($filename), $multicall);
}

/**
 * Set as next challenges the list of challenges with the specified filenames, if they are present in the selection.
 * The list of challenges to remove is an array of strings.
 * @param array $filenames
 * @param bool $multicall
 * @throws InvalidArgumentException
 * @return int
 */
function chooseNextChallengeList(array $filenames, $multicall = false)
{
    if(!is_array($filenames))
    throw new InvalidArgumentException('filenames = '.print_r($filenames,true));

    return $this->execute(ucfirst(__FUNCTION__), array($filenames), $multicall);
}

Original issue: http://code.google.com/p/manialive/issues/detail?id=11

magnetik commented 10 years ago

From melot.philippe on January 05, 2011 01:18:03

Corrected in r101 now the methods chooseChallenge & chooseChallengList are deprecated

Status: Verified
Owner: melot.philippe