Fix player name extraction for Unreal Tournament (1999) and possibly other gamespy1 games. (3.0.2)

This commit is contained in:
Michael Morrison 2021-04-27 00:27:14 -05:00
parent fec5a1fac6
commit 1b11a132b9
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,7 @@
### 3.0.2
* Fix player name extraction for Unreal Tournament (1999) and possibly
other gamespy1 games.
### 3.0.1
* Clarified that nodejs 12 is now required for gamedig 3
* Fixed misc player fields not going into `raw` subobject in `assettocorsa`, `fivem`, and `gamespy2`

View File

@ -24,7 +24,7 @@
],
"main": "lib/index.js",
"author": "GameDig Contributors",
"version": "3.0.1",
"version": "3.0.2",
"repository": {
"type": "git",
"url": "https://github.com/gamedig/node-gamedig.git"

View File

@ -37,10 +37,12 @@ class Gamespy1 extends Core {
if (!(id in playersById)) playersById[id] = {};
if (key === 'playername') {
key = 'name';
} else if (key === 'player') {
key = 'name';
} else if (key === 'team' && !isNaN(parseInt(value))) {
key = 'teamId';
value = parseInt(value);
} else if (key === 'score' || key === 'ping' || key === 'deaths' || key === 'kills') {
} else if (key === 'score' || key === 'ping' || key === 'deaths' || key === 'kills' || key === 'frags') {
value = parseInt(value);
}
playersById[id][key] = value;