From 05f5b4d223defa146a83098d97789e6a6dcdf533 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Tue, 6 Feb 2024 00:45:57 -0300 Subject: [PATCH] even more games with version --- protocols/gamespy3.js | 1 + protocols/mafia2mp.js | 1 + protocols/teamspeak3.js | 1 + 3 files changed, 3 insertions(+) diff --git a/protocols/gamespy3.js b/protocols/gamespy3.js index 3abc723..ef567dc 100644 --- a/protocols/gamespy3.js +++ b/protocols/gamespy3.js @@ -112,6 +112,7 @@ export default class gamespy3 extends Core { if (state.raw.password === '1') state.password = true if ('maxplayers' in state.raw) state.maxplayers = parseInt(state.raw.maxplayers) if ('hostport' in state.raw) state.gamePort = parseInt(state.raw.hostport) + if ('gamever' in state.raw) state.version = state.raw.gamever if ('' in state.raw.playerTeamInfo) { for (const playerInfo of state.raw.playerTeamInfo['']) { diff --git a/protocols/mafia2mp.js b/protocols/mafia2mp.js index 0d14e6d..5e4b94c 100644 --- a/protocols/mafia2mp.js +++ b/protocols/mafia2mp.js @@ -21,6 +21,7 @@ export default class mafia2mp extends Core { state.numplayers = parseInt(this.readString(reader)) state.maxplayers = parseInt(this.readString(reader)) state.raw.gamemode = this.readString(reader) + state.version = state.raw.gamemode state.password = !!reader.uint(1) state.gamePort = this.options.port - 1 diff --git a/protocols/teamspeak3.js b/protocols/teamspeak3.js index 459295c..c22c4c5 100644 --- a/protocols/teamspeak3.js +++ b/protocols/teamspeak3.js @@ -17,6 +17,7 @@ export default class teamspeak3 extends Core { if ('virtualserver_name' in state.raw) state.name = state.raw.virtualserver_name if ('virtualserver_maxclients' in state.raw) state.maxplayers = state.raw.virtualserver_maxclients if ('virtualserver_clientsonline' in state.raw) state.numplayers = state.raw.virtualserver_clientsonline + if ('virtualserver_version' in state.raw) state.version = state.raw.virtualserver_version } {