From cb73ccd2600e233ac79d038efc428e095dbf6d00 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Sat, 31 Aug 2024 02:08:59 +0300 Subject: [PATCH] feat: quake2 protocol's version field, look for 'version' in the raw object Observed while looking on #619 --- CHANGELOG.md | 1 + protocols/quake2.js | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7b3dce..2f585bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## To Be Released... ## 5.X.Y * Fix: `Deus Ex` using the wrong protocol (#621) +* Feat: For the Quake2 protocol `version`'s field, also look for `version` in the raw object ## 5.1.2 * Added Vintage Story support via the master server (#606) diff --git a/protocols/quake2.js b/protocols/quake2.js index 3de861d..549b07a 100644 --- a/protocols/quake2.js +++ b/protocols/quake2.js @@ -83,6 +83,7 @@ export default class quake2 extends Core { if ('sv_hostname' in state.raw) state.name = state.raw.sv_hostname if ('hostname' in state.raw) state.name = state.raw.hostname if ('clients' in state.raw) state.numplayers = state.raw.clients + if ('version' in state.raw) state.version = state.raw.version if ('iv' in state.raw) state.version = state.raw.iv else state.numplayers = state.players.length + state.bots.length }