Added more states for trackmania

This commit is contained in:
Nicolas Graf 2018-02-26 23:52:42 +01:00
parent 848600e45e
commit 9c8c6e4f89
1 changed files with 13 additions and 7 deletions

View File

@ -21,11 +21,12 @@ class Nadeo extends require('./core') {
const cmds = [
['Connect'],
['Authenticate', this.options.login,this.options.password],
['GetStatus'],
['GetPlayerList',500,0],
['GetServerOptions'],
['GetCurrentChallengeInfo'],
['GetCurrentGameInfo']
['GetStatus'], // 1
['GetPlayerList',500,0], // 2
['GetServerOptions'], // 3
['GetCurrentMapInfo'], // 4
['GetCurrentGameInfo'], // 5
['GetNextMapInfo'] // 6
];
const results = [];
@ -59,8 +60,13 @@ class Nadeo extends require('./core') {
state.name = this.stripColors(results[3].Name);
state.password = (results[3].Password !== 'No password');
state.maxplayers = results[3].CurrentMaxPlayers;
state.map = this.stripColors(results[4].Name);
state.raw.gametype = gamemode;
state.maxspectators = results[3].CurrentMaxSpectators;
state.currmap_name = this.stripColors(results[4].Name);
state.currmap_uid = results[4].UId;
state.gametype = gamemode;
state.mapcount = results[5].NbChallenge;
state.nextmap_name = this.stripColors(results[6].Name);
state.nextmap_uid = results[6].UId;
for (const player of results[2]) {
state.players.push({name:this.stripColors(player.Name)});