From a9d0c38b7012755dfe9ab041bb4fd09c07a45804 Mon Sep 17 00:00:00 2001 From: Michael Morrison Date: Mon, 19 May 2014 09:19:40 -0500 Subject: [PATCH] Fix random bot appearing in csgo --- games.txt | 2 +- protocols/valve.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/games.txt b/games.txt index a3df7e5..65e0f64 100644 --- a/games.txt +++ b/games.txt @@ -83,7 +83,7 @@ contactjack|Contact J.A.C.K.|gamespy1|port_query=27888 cs16|Counter-Strike 1.6|valve cscz|Counter-Strike: Condition Zero|valve css|Counter-Strike: Source|valve -csgo|Counter-Strike: Global Offensive|valve +csgo|Counter-Strike: Global Offensive|valve||isCsGo crossracing|Cross Racing Championship|ase|port=12321,port_query_offset=123 diff --git a/protocols/valve.js b/protocols/valve.js index 140a334..0d91738 100644 --- a/protocols/valve.js +++ b/protocols/valve.js @@ -20,6 +20,10 @@ module.exports = require('./core').extend({ // at all, use the old dedicated challenge query if needed this.legacyChallenge = false; + // cs:go provides an annoying additional bot that looks exactly like a player, + // but is always named "Max Players" + this.isCsGo = false; + // 2006 engines don't pass packet switching size in split packet header // while all others do, this need is detected automatically this._skipSizeInSplitHeader = false; @@ -149,6 +153,8 @@ module.exports = require('./core').extend({ // connecting players don't count as players. if(!name) continue; + + if(self.isCsGo && name === 'Max Players') continue; (time == -1 ? state.bots : state.players).push({ name:name, score:score, time:time