Add Savage 2: A Tortured Soul (2008) (2.0.24)

This commit is contained in:
Michael Morrison 2021-01-08 20:02:23 -06:00
parent 81a3ec1019
commit e99b3c1812
5 changed files with 38 additions and 3 deletions

View file

@ -1,3 +1,6 @@
### 2.0.24
* Add Savage 2: A Tortured Soul (2008)
### 2.0.23 ### 2.0.23
* Fix Conan Exiles and other games which don't respond to the valve player query * Fix Conan Exiles and other games which don't respond to the valve player query
* Add givenPortOnly query option for users that require extreme optimization * Add givenPortOnly query option for users that require extreme optimization

View file

@ -224,7 +224,7 @@ Games List
| `minecraft`<br>`minecraftping` | Minecraft (2009) | `minecraft`<br>`minecraftping` | Minecraft (2009)
| `minecraftpe`<br>`minecraftbe` | Minecraft: Bedrock Edition (2011) | `minecraftpe`<br>`minecraftbe` | Minecraft: Bedrock Edition (2011)
| `mnc` | Monday Night Combat (2011) | `mnc` | Monday Night Combat (2011)
| `mordhau` | Mordhau (2019) | `mordhau` | Mordhau (2019)
| `mumble` | Mumble - GTmurmur Plugin (2005) | [Notes](#mumble) | `mumble` | Mumble - GTmurmur Plugin (2005) | [Notes](#mumble)
| `mumbleping` | Mumble - Lightweight (2005) | [Notes](#mumble) | `mumbleping` | Mumble - Lightweight (2005) | [Notes](#mumble)
| `nascarthunder2004` | NASCAR Thunder 2004 (2003) | `nascarthunder2004` | NASCAR Thunder 2004 (2003)
@ -274,6 +274,7 @@ Games List
| `rust` | Rust | `rust` | Rust
| `stalker` | S.T.A.L.K.E.R. | `stalker` | S.T.A.L.K.E.R.
| `samp` | San Andreas Multiplayer | `samp` | San Andreas Multiplayer
| `savage2` | Savage 2: A Tortured Soul (2008)
| `ss` | Serious Sam | `ss` | Serious Sam
| `ss2` | Serious Sam 2 | `ss2` | Serious Sam 2
| `shatteredhorizon` | Shattered Horizon | `shatteredhorizon` | Shattered Horizon
@ -385,7 +386,6 @@ Games List
* Red Faction * Red Faction
* S.T.A.L.K.E.R. Clear Sky * S.T.A.L.K.E.R. Clear Sky
* Savage: The Battle For Newerth * Savage: The Battle For Newerth
* Savage 2: A Tortured Soul
* SiN 1 Multiplayer * SiN 1 Multiplayer
* South Park * South Park
* Star Wars Jedi Knight: Dark Forces II * Star Wars Jedi Knight: Dark Forces II

View file

@ -216,6 +216,7 @@ rs2|Rising Storm 2: Vietnam|valve|port=27015
rune|Rune|gamespy1|port=7777,port_query_offset=1 rune|Rune|gamespy1|port=7777,port_query_offset=1
rust|Rust|valve|port=28015 rust|Rust|valve|port=28015
samp|San Andreas Multiplayer|samp|port=7777 samp|San Andreas Multiplayer|samp|port=7777
savage2|Savage 2: A Tortured Soul (2008)|savage2|port_query=11235
spaceengineers|Space Engineers|valve|port=27015 spaceengineers|Space Engineers|valve|port=27015
ss|Serious Sam|gamespy1|port=25600,port_query_offset=1 ss|Serious Sam|gamespy1|port=25600,port_query_offset=1
ss2|Serious Sam 2|gamespy2|port=25600 ss2|Serious Sam 2|gamespy2|port=25600

View file

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

31
protocols/savage2.js Normal file
View file

@ -0,0 +1,31 @@
const Core = require('./core');
class Savage2 extends Core {
constructor() {
super();
}
async run(state) {
const buffer = await this.udpSend('\x01',b => b);
const reader = this.reader(buffer);
reader.skip(12);
state.name = this.stripColorCodes(reader.string());
state.players = reader.uint(1);
state.maxplayers = reader.uint(1);
state.raw.time = reader.string();
state.map = reader.string();
state.raw.nextmap = reader.string();
state.raw.location = reader.string();
state.raw.minplayers = reader.uint(1);
state.raw.gametype = reader.string();
state.raw.version = reader.string();
state.raw.minlevel = reader.uint(1);
}
stripColorCodes(str) {
return str.replace(/\^./g,'');
}
}
module.exports = Savage2;