Add TMWTTeams and remove Champion gamemode

This commit is contained in:
Beu 2023-01-25 18:22:21 +01:00
parent 63c6ef955a
commit 070e150406

View File

@ -37,7 +37,7 @@ use ManiaControl\Callbacks\TimerListener; // for pause
class MatchManagerCore implements CallbackListener, CommandListener, TimerListener, CommunicationListener, Plugin { class MatchManagerCore implements CallbackListener, CommandListener, TimerListener, CommunicationListener, Plugin {
const PLUGIN_ID = 152; const PLUGIN_ID = 152;
const PLUGIN_VERSION = 3.9; const PLUGIN_VERSION = 3.10;
const PLUGIN_NAME = 'MatchManager Core'; const PLUGIN_NAME = 'MatchManager Core';
const PLUGIN_AUTHOR = 'Beu'; const PLUGIN_AUTHOR = 'Beu';
@ -73,49 +73,41 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
const SETTING_MODE_MAPLIST_FILE = 'Maplist to use'; const SETTING_MODE_MAPLIST_FILE = 'Maplist to use';
// Gamemodes Settings // Gamemodes Settings
const SETTING_MATCH_S_BESTLAPBONUSPOINTS = 'S_BestLapBonusPoints';
const SETTING_MATCH_S_CHATTIME = 'S_ChatTime'; const SETTING_MATCH_S_CHATTIME = 'S_ChatTime';
const SETTING_MATCH_S_CUMULATEPOINTS = 'S_CumulatePoints'; const SETTING_MATCH_S_CUMULATEPOINTS = 'S_CumulatePoints';
const SETTING_MATCH_S_DISABLEGIVEUP = 'S_DisableGiveUp'; const SETTING_MATCH_S_DISABLEGIVEUP = 'S_DisableGiveUp';
const SETTING_MATCH_S_EARLYENDMATCHCALLBACK = 'S_EarlyEndMatchCallback'; const SETTING_MATCH_S_EARLYENDMATCHCALLBACK = 'S_EarlyEndMatchCallback';
const SETTING_MATCH_S_ELIMINATEDPLAYERSNBRANKS = 'S_EliminatedPlayersNbRanks'; const SETTING_MATCH_S_ELIMINATEDPLAYERSNBRANKS = 'S_EliminatedPlayersNbRanks';
const SETTING_MATCH_S_ENDROUNDPOSTSCOREUPDATEDURATION = 'S_EndRoundPostScoreUpdateDuration'; const SETTING_MATCH_S_ENABLEDOSSARDCOLOR = 'S_EnableDossardColor';
const SETTING_MATCH_S_ENDROUNDPRESCOREUPDATEDURATION = 'S_EndRoundPreScoreUpdateDuration';
const SETTING_MATCH_S_FINISHTIMEOUT = 'S_FinishTimeout'; const SETTING_MATCH_S_FINISHTIMEOUT = 'S_FinishTimeout';
const SETTING_MATCH_S_FORCELAPSNB = 'S_ForceLapsNb'; const SETTING_MATCH_S_FORCELAPSNB = 'S_ForceLapsNb';
const SETTING_MATCH_S_FORCEWINNERSNB = 'S_ForceWinnersNb'; const SETTING_MATCH_S_FORCEROADSPECTATORSNB = 'S_ForceRoadSpectatorsNb';
const SETTING_MATCH_S_INFINITELAPS = 'S_InfiniteLaps'; const SETTING_MATCH_S_INFINITELAPS = 'S_InfiniteLaps';
const SETTING_MATCH_S_MAPPOINTSLIMIT = 'S_MapPointsLimit';
const SETTING_MATCH_S_MAPSPERMATCH = 'S_MapsPerMatch'; const SETTING_MATCH_S_MAPSPERMATCH = 'S_MapsPerMatch';
const SETTING_MATCH_S_MATCHPOSITION = 'S_MatchPosition'; const SETTING_MATCH_S_MATCHPOSITION = 'S_MatchPosition';
const SETTING_MATCH_S_MATCHINFO = 'S_MatchInfo';
const SETTING_MATCH_S_MATCHPOINTSLIMIT = 'S_MatchPointsLimit';
const SETTING_MATCH_S_MAXPOINTSPERROUND = 'S_MaxPointsPerRound'; const SETTING_MATCH_S_MAXPOINTSPERROUND = 'S_MaxPointsPerRound';
const SETTING_MATCH_S_NBOFWINNERS = 'S_NbOfWinners'; const SETTING_MATCH_S_NBOFWINNERS = 'S_NbOfWinners';
const SETTING_MATCH_S_PAUSEBEFOREROUNDNB = 'S_PauseBeforeRoundNb';
const SETTING_MATCH_S_PAUSEDURATION = 'S_PauseDuration';
const SETTING_MATCH_S_POINTSGAP = 'S_PointsGap'; const SETTING_MATCH_S_POINTSGAP = 'S_PointsGap';
const SETTING_MATCH_S_POINTSLIMIT = 'S_PointsLimit'; const SETTING_MATCH_S_POINTSLIMIT = 'S_PointsLimit';
const SETTING_MATCH_S_POINTSREPARTITION = 'S_PointsRepartition'; const SETTING_MATCH_S_POINTSREPARTITION = 'S_PointsRepartition';
const SETTING_MATCH_S_RESPAWNBEHAVIOUR = 'S_RespawnBehaviour'; const SETTING_MATCH_S_RESPAWNBEHAVIOUR = 'S_RespawnBehaviour';
const SETTING_MATCH_S_ROUNDSLIMIT = 'S_RoundsLimit';
const SETTING_MATCH_S_ROUNDSPERMAP = 'S_RoundsPerMap'; const SETTING_MATCH_S_ROUNDSPERMAP = 'S_RoundsPerMap';
const SETTING_MATCH_S_ROUNDSWITHAPHASECHANGE = 'S_RoundsWithAPhaseChange';
const SETTING_MATCH_S_ROUNDSWITHOUTELIMINATION = 'S_RoundsWithoutElimination'; const SETTING_MATCH_S_ROUNDSWITHOUTELIMINATION = 'S_RoundsWithoutElimination';
const SETTING_MATCH_S_SPONSORSURL = 'S_SponsorsUrl';
const SETTING_MATCH_S_TEAMSURL = 'S_TeamsUrl';
const SETTING_MATCH_S_TIMELIMIT = 'S_TimeLimit'; const SETTING_MATCH_S_TIMELIMIT = 'S_TimeLimit';
const SETTING_MATCH_S_TIMEOUTPLAYERSNUMBER = 'S_TimeOutPlayersNumber';
const SETTING_MATCH_S_USEALTERNATERULES = 'S_UseAlternateRules'; const SETTING_MATCH_S_USEALTERNATERULES = 'S_UseAlternateRules';
const SETTING_MATCH_S_USECUSTOMPOINTSREPARTITION = 'S_UseCustomPointsRepartition'; const SETTING_MATCH_S_USECUSTOMPOINTSREPARTITION = 'S_UseCustomPointsRepartition';
const SETTING_MATCH_S_USETIEBREAK = 'S_UseTieBreak'; const SETTING_MATCH_S_USETIEBREAK = 'S_UseTieBreak';
const SETTING_MATCH_S_WARMUPDURATION = 'S_WarmUpDuration'; const SETTING_MATCH_S_WARMUPDURATION = 'S_WarmUpDuration';
const SETTING_MATCH_S_WARMUPNB = 'S_WarmUpNb'; const SETTING_MATCH_S_WARMUPNB = 'S_WarmUpNb';
const SETTING_MATCH_S_WARMUPTIMEOUT = 'S_WarmUpTimeout'; const SETTING_MATCH_S_WARMUPTIMEOUT = 'S_WarmUpTimeout';
const SETTING_MATCH_S_WINNERSRATIO = 'S_WinnersRatio';
// RELATIONS BETWEEN GAMEMODE AND GAMEMODES SETTINGS // RELATIONS BETWEEN GAMEMODE AND GAMEMODES SETTINGS
const GAMEMODES_LIST_SETTINGS = [ const GAMEMODES_LIST_SETTINGS = [
self::SETTING_MATCH_S_BESTLAPBONUSPOINTS => [
'gamemode' => ['Champion'],
'type' => 'integer',
'default' => 2,
'description' => 'Point bonus for who made the best lap time' ],
self::SETTING_MATCH_S_CHATTIME => [ self::SETTING_MATCH_S_CHATTIME => [
'gamemode' => ['Global'], 'gamemode' => ['Global'],
'type' => 'integer', 'type' => 'integer',
@ -127,12 +119,12 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
'default' => false, 'default' => false,
'description' => 'Cumulate players points to the team score (false = 1 point to the winner team)' ], 'description' => 'Cumulate players points to the team score (false = 1 point to the winner team)' ],
self::SETTING_MATCH_S_DISABLEGIVEUP => [ self::SETTING_MATCH_S_DISABLEGIVEUP => [
'gamemode' => ['Champion', 'Laps'], 'gamemode' => ['Laps'],
'type' => 'boolean', 'type' => 'boolean',
'default' => false, 'default' => false,
'description' => 'Disable GiveUp' ], 'description' => 'Disable GiveUp' ],
self::SETTING_MATCH_S_EARLYENDMATCHCALLBACK => [ self::SETTING_MATCH_S_EARLYENDMATCHCALLBACK => [
'gamemode' => ['Champion', 'Knockout'], 'gamemode' => ['Knockout', 'TMWTTeams'],
'type' => 'boolean', 'type' => 'boolean',
'default' => true, 'default' => true,
'description' => 'Send End Match Callback early (expert user only)' ], 'description' => 'Send End Match Callback early (expert user only)' ],
@ -141,18 +133,13 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
'type' => 'string', 'type' => 'string',
'default' => '4', 'default' => '4',
'description' => 'Rank at which one more player is eliminated per round (use coma to add more values. Ex COTD: 8,16,16)' ], 'description' => 'Rank at which one more player is eliminated per round (use coma to add more values. Ex COTD: 8,16,16)' ],
self::SETTING_MATCH_S_ENDROUNDPOSTSCOREUPDATEDURATION => [ self::SETTING_MATCH_S_ENABLEDOSSARDCOLOR => [
'gamemode' => ['Champion'], 'gamemode' => ['TMWTTeams'],
'type' => 'integer', 'type' => 'boolean',
'default' => 5, 'default' => true,
'description' => 'Time after score computed on scoreboard' ], 'description' => 'Apply color team on the dossard' ],
self::SETTING_MATCH_S_ENDROUNDPRESCOREUPDATEDURATION => [
'gamemode' => ['Champion'],
'type' => 'integer',
'default' => 5,
'description' => 'Time before score computed on scoreboard' ],
self::SETTING_MATCH_S_FINISHTIMEOUT => [ self::SETTING_MATCH_S_FINISHTIMEOUT => [
'gamemode' => ['Champion', 'Cup', 'Knockout', 'Laps', 'Teams', 'Rounds'], 'gamemode' => ['Cup', 'Knockout', 'Laps', 'Teams', 'TMWTTeams', 'Rounds'],
'type' => 'integer', 'type' => 'integer',
'default' => 10, 'default' => 10,
'description' => 'Time after the first finished (-1 = based on Author time)' ], 'description' => 'Time after the first finished (-1 = based on Author time)' ],
@ -161,21 +148,36 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
'type' => 'integer', 'type' => 'integer',
'default' => -1, 'default' => -1,
'description' => 'Force number of laps for laps maps (-1 = author, 0 for unlimited in TA)' ], 'description' => 'Force number of laps for laps maps (-1 = author, 0 for unlimited in TA)' ],
self::SETTING_MATCH_S_FORCEWINNERSNB => [ self::SETTING_MATCH_S_FORCEROADSPECTATORSNB => [
'gamemode' => ['Champion'], 'gamemode' => ['TMWTTeams'],
'type' => 'integer', 'type' => 'integer',
'default' => 0, 'default' => -1,
'description' => 'Force the number of players who will win points (0 = for use S_WinnersRatio)' ], 'description' => 'Force the number of spectators displayed on the border of the road' ],
self::SETTING_MATCH_S_INFINITELAPS => [ self::SETTING_MATCH_S_INFINITELAPS => [
'gamemode' => ['Global'], 'gamemode' => ['Global'],
'type' => 'boolean', 'type' => 'boolean',
'default' => false, 'default' => false,
'description' => 'Never end a race in laps (override S_ForceLapsNb)' ], 'description' => 'Never end a race in laps (override S_ForceLapsNb)' ],
self::SETTING_MATCH_S_MAPPOINTSLIMIT => [
'gamemode' => ['TMWTTeams'],
'type' => 'integer',
'default' => 10,
'description' => 'Track points limit' ],
self::SETTING_MATCH_S_MAPSPERMATCH => [ self::SETTING_MATCH_S_MAPSPERMATCH => [
'gamemode' => ['Teams', 'Rounds'], 'gamemode' => ['Teams', 'Rounds'],
'type' => 'integer', 'type' => 'integer',
'default' => 3, 'default' => 3,
'description' => 'Number of maps maximum in the match' ], 'description' => 'Number of maps maximum in the match' ],
self::SETTING_MATCH_S_MATCHINFO => [
'gamemode' => ['TMWTTeams'],
'type' => 'string',
'default' => "",
'description' => 'Match info displayed in the UI' ],
self::SETTING_MATCH_S_MATCHPOINTSLIMIT => [
'gamemode' => ['TMWTTeams'],
'type' => 'integer',
'default' => 4,
'description' => 'Match points limit' ],
self::SETTING_MATCH_S_MATCHPOSITION => [ self::SETTING_MATCH_S_MATCHPOSITION => [
'gamemode' => ['Knockout'], 'gamemode' => ['Knockout'],
'type' => 'integer', 'type' => 'integer',
@ -191,28 +193,18 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
'type' => 'integer', 'type' => 'integer',
'default' => 1, 'default' => 1,
'description' => 'Number of winners' ], 'description' => 'Number of winners' ],
self::SETTING_MATCH_S_PAUSEBEFOREROUNDNB => [
'gamemode' => ['Champion'],
'type' => 'integer',
'default' => 0,
'description' => 'Run a pause before the round number (depend of S_PauseDuration) (0 = disabled)' ],
self::SETTING_MATCH_S_PAUSEDURATION => [
'gamemode' => ['Champion'],
'type' => 'integer',
'default' => 360,
'description' => 'Pause time in seconds (depend of S_PauseBeforeRoundNb) (0 = disabled)' ],
self::SETTING_MATCH_S_POINTSGAP => [ self::SETTING_MATCH_S_POINTSGAP => [
'gamemode' => ['Teams'], 'gamemode' => ['Teams'],
'type' => 'integer', 'type' => 'integer',
'default' => 0, 'default' => 0,
'description' => 'Points Gap to win (depend of S_PointsLimit & S_UseTieBreak)' ], 'description' => 'Points Gap to win (depend of S_PointsLimit & S_UseTieBreak)' ],
self::SETTING_MATCH_S_POINTSLIMIT => [ self::SETTING_MATCH_S_POINTSLIMIT => [
'gamemode' => ['Champion', 'Cup', 'Teams', 'Rounds'], 'gamemode' => ['Cup', 'Teams', 'Rounds'],
'type' => 'integer', 'type' => 'integer',
'default' => 100, 'default' => 100,
'description' => 'Limit number of points (0 = unlimited for Ch & R)' ], 'description' => 'Limit number of points (0 = unlimited for Ch & R)' ],
self::SETTING_MATCH_S_POINTSREPARTITION => [ self::SETTING_MATCH_S_POINTSREPARTITION => [
'gamemode' => ['Champion', 'Cup', 'Knockout', 'Teams', 'Rounds'], 'gamemode' => ['Cup', 'Knockout', 'Teams', 'TMWTTeams', 'Rounds'],
'type' => 'string', 'type' => 'string',
'default' => '10,6,4,3,2,1', 'default' => '10,6,4,3,2,1',
'description' => 'Point repartition from first to last' ], 'description' => 'Point repartition from first to last' ],
@ -221,36 +213,31 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
'type' => 'integer', 'type' => 'integer',
'default' => [0,1,2,3,4,5], 'default' => [0,1,2,3,4,5],
'description' => 'Respawn behavior (0 = GM setting, 1 = normal, 2 = do nothing, 3 = DNF before 1st CP, 4 = always DNF, 5 = never DNF)' ], 'description' => 'Respawn behavior (0 = GM setting, 1 = normal, 2 = do nothing, 3 = DNF before 1st CP, 4 = always DNF, 5 = never DNF)' ],
self::SETTING_MATCH_S_ROUNDSLIMIT => [
'gamemode' => ['Champion'],
'type' => 'integer',
'default' => 6,
'description' => 'Number of rounds to play before finding a winner of the step' ],
self::SETTING_MATCH_S_ROUNDSPERMAP => [ self::SETTING_MATCH_S_ROUNDSPERMAP => [
'gamemode' => ['Champion', 'Cup', 'Knockout', 'Teams', 'Rounds'], 'gamemode' => ['Cup', 'Knockout', 'Teams', 'Rounds'],
'type' => 'integer', 'type' => 'integer',
'default' => 5, 'default' => 5,
'description' => 'Number of rounds par map (0 = unlimited)' ], 'description' => 'Number of rounds par map (0 = unlimited)' ],
self::SETTING_MATCH_S_ROUNDSWITHAPHASECHANGE => [
'gamemode' => ['Champion'],
'type' => 'string',
'default' => '3,5',
'description' => 'Rounds with a Phase change (Openning, Semi-Final, Final)' ],
self::SETTING_MATCH_S_ROUNDSWITHOUTELIMINATION => [ self::SETTING_MATCH_S_ROUNDSWITHOUTELIMINATION => [
'gamemode' => ['Knockout'], 'gamemode' => ['Knockout'],
'type' => 'integer', 'type' => 'integer',
'default' => 1, 'default' => 1,
'description' => 'Rounds without elimination (like a Warmup, but just for the first map)' ], 'description' => 'Rounds without elimination (like a Warmup, but just for the first map)' ],
self::SETTING_MATCH_S_SPONSORSURL => [
'gamemode' => ['TMWTTeams'],
'type' => 'string',
'default' => "",
'description' => 'URLs separated by a space' ],
self::SETTING_MATCH_S_TEAMSURL => [
'gamemode' => ['TMWTTeams'],
'type' => 'string',
'default' => "",
'description' => 'URL where to get the teams info' ],
self::SETTING_MATCH_S_TIMELIMIT => [ self::SETTING_MATCH_S_TIMELIMIT => [
'gamemode' => ['Champion', 'Laps', 'TimeAttack', 'RoyalTimeAttack'], 'gamemode' => ['Laps', 'TimeAttack', 'RoyalTimeAttack'],
'type' => 'integer', 'type' => 'integer',
'default' => 600, 'default' => 600,
'description' => 'Time limit (0 = unlimited)' ], 'description' => 'Time limit (0 = unlimited)' ],
self::SETTING_MATCH_S_TIMEOUTPLAYERSNUMBER => [
'gamemode' => ['Champion'],
'type' => 'integer',
'default' => 0,
'description' => 'Number of players who must finish before starting S_FinishTimeout (0 = S_ForceWinnersNb)' ],
self::SETTING_MATCH_S_USEALTERNATERULES => [ self::SETTING_MATCH_S_USEALTERNATERULES => [
'gamemode' => ['Teams'], 'gamemode' => ['Teams'],
'type' => 'boolean', 'type' => 'boolean',
@ -262,30 +249,25 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
'default' => false, 'default' => false,
'description' => 'Use S_PointsRepartition (instead of rules defined by S_UseAlternateRules)' ], 'description' => 'Use S_PointsRepartition (instead of rules defined by S_UseAlternateRules)' ],
self::SETTING_MATCH_S_USETIEBREAK => [ self::SETTING_MATCH_S_USETIEBREAK => [
'gamemode' => ['Champion', 'Teams', 'Rounds'], 'gamemode' => ['Teams', 'Rounds'],
'type' => 'boolean', 'type' => 'boolean',
'default' => false, 'default' => false,
'description' => 'Use Tie Break (Only available when S_MapsPerMatch > 1)' ], 'description' => 'Use Tie Break (Only available when S_MapsPerMatch > 1)' ],
self::SETTING_MATCH_S_WARMUPDURATION => [ self::SETTING_MATCH_S_WARMUPDURATION => [
'gamemode' => ['Champion', 'Cup', 'Knockout', 'Laps', 'Teams', 'TimeAttack', 'Rounds'], 'gamemode' => ['Cup', 'Knockout', 'Laps', 'Teams', 'TimeAttack', 'TMWTTeams', 'Rounds'],
'type' => 'integer', 'type' => 'integer',
'default' => -1, 'default' => -1,
'description' => 'Duration of 1 Warm Up in sec (-1 = one round, 0 = based on Author time)' ], 'description' => 'Duration of 1 Warm Up in sec (-1 = one round, 0 = based on Author time)' ],
self::SETTING_MATCH_S_WARMUPNB => [ self::SETTING_MATCH_S_WARMUPNB => [
'gamemode' => ['Champion', 'Cup', 'Knockout', 'Laps', 'Teams', 'TimeAttack', 'Rounds'], 'gamemode' => ['Cup', 'Knockout', 'Laps', 'Teams', 'TimeAttack', 'TMWTTeams', 'Rounds'],
'type' => 'integer', 'type' => 'integer',
'default' => 1, 'default' => 1,
'description' => 'Number of Warm Up' ], 'description' => 'Number of Warm Up' ],
self::SETTING_MATCH_S_WARMUPTIMEOUT => [ self::SETTING_MATCH_S_WARMUPTIMEOUT => [
'gamemode' => ['Champion', 'Cup', 'Knockout', 'Laps', 'Teams', 'TimeAttack', 'Rounds'], 'gamemode' => ['Cup', 'Knockout', 'Laps', 'Teams', 'TimeAttack', 'TMWTTeams', 'Rounds'],
'type' => 'integer', 'type' => 'integer',
'default' => -1, 'default' => -1,
'description' => 'Time after the first finished the WarmUP (-1 = based on Author time, only when S_WarmUpDuration = -1)' ], 'description' => 'Time after the first finished the WarmUP (-1 = based on Author time, only when S_WarmUpDuration = -1)' ]
self::SETTING_MATCH_S_WINNERSRATIO => [
'gamemode' => ['Champion'],
'type' => 'float',
'default' => 0.5,
'description' => 'Ratio of players who will win points' ]
]; ];
const SETTINGS_MODE_LIST = [ const SETTINGS_MODE_LIST = [
@ -416,7 +398,7 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_MATCH_PAUSE_POSY, 43, "Position of the Pause Countdown (on Y axis)", 15); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_MATCH_PAUSE_POSY, 43, "Position of the Pause Countdown (on Y axis)", 15);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_MATCH_SETTINGS_MODE, array('All from the plugin', 'Maps from file & Settings from plugin', 'All from file'), "Loading mode for maps and match settings, depending on your needs", 20); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_MATCH_SETTINGS_MODE, array('All from the plugin', 'Maps from file & Settings from plugin', 'All from file'), "Loading mode for maps and match settings, depending on your needs", 20);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_MATCH_POST_MATCH_MAPLIST, "", "Load Mapfile after the match (empty to just load TA on the same maps) (can be unstable)", 20); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_MATCH_POST_MATCH_MAPLIST, "", "Load Mapfile after the match (empty to just load TA on the same maps) (can be unstable)", 20);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_MATCH_GAMEMODE_BASE, array("Champion", "Cup", "Knockout", "Laps", "Teams", "TimeAttack", "Rounds", "RoyalTimeAttack"), "Gamemode to launch for the match", 25); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_MATCH_GAMEMODE_BASE, array("Cup", "Knockout", "Laps", "Teams", "TimeAttack", "TMWTTeams", "Rounds", "RoyalTimeAttack"), "Gamemode to launch for the match", 25);
// Init dynamics settings // Init dynamics settings
$this->updateSettings(); $this->updateSettings();
@ -732,10 +714,8 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
$this->postmatch = true; $this->postmatch = true;
$this->matchid = ""; $this->matchid = "";
$this->nbwinners = 0;
$this->settings_nbroundsbymap = 5; $this->settings_nbroundsbymap = 5;
$this->settings_nbwinner = 2; $this->settings_nbwinners = 2;
$this->settings_nbmapsbymatch = 0; $this->settings_nbmapsbymatch = 0;
$this->settings_pointlimit = 100; $this->settings_pointlimit = 100;
@ -861,9 +841,7 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
} else { } else {
$this->settings_nbroundsbymap = 1; $this->settings_nbroundsbymap = 1;
} }
if ($this->currentgmbase == "Champion") { if (isset($this->currentgmsettings[self::SETTING_MATCH_S_MAPSPERMATCH])) {
$this->settings_nbmapsbymatch = (int) $this->currentgmsettings[self::SETTING_MATCH_S_ROUNDSLIMIT];
} elseif (isset($this->currentgmsettings[self::SETTING_MATCH_S_MAPSPERMATCH])) {
$this->settings_nbmapsbymatch = (int) $this->currentgmsettings[self::SETTING_MATCH_S_MAPSPERMATCH]; $this->settings_nbmapsbymatch = (int) $this->currentgmsettings[self::SETTING_MATCH_S_MAPSPERMATCH];
} }
} }
@ -1553,6 +1531,7 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
//$rank = 1; //$rank = 1;
foreach ($results as $result) { foreach ($results as $result) {
/** @var \ManiaControl\Callbacks\Structures\TrackMania\Models\PlayerScore $result */
$rank = $result->getRank(); $rank = $result->getRank();
$player = $result->getPlayer(); $player = $result->getPlayer();
$matchpoints = $result->getMatchPoints(); $matchpoints = $result->getMatchPoints();