mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-18 01:30:39 +01:00
feat: backport 4.3.0 changes into master (#432)
* chore: backport all 4.3.0 changes * docs: remove changelog line that does not apply
This commit is contained in:
parent
d37c5b7f2b
commit
89515cb677
6 changed files with 48 additions and 3 deletions
|
@ -37,6 +37,11 @@ see next point) and `tshock` (which is `terraria`).
|
||||||
a placeholder in the `players` fields.
|
a placeholder in the `players` fields.
|
||||||
* Stabilized field `numplayers`.
|
* Stabilized field `numplayers`.
|
||||||
|
|
||||||
|
### 4.3.0
|
||||||
|
* Fix `Post Scriptum` not being on the valve protocol.
|
||||||
|
* Added support for the Minecraft [Better Compatibility Checker](https://www.curseforge.com/minecraft/mc-mods/better-compatibility-checker) Mod.
|
||||||
|
* Halo Online (ElDewrito) - Added support (by @Sphyrna-029)
|
||||||
|
|
||||||
### 4.2.0
|
### 4.2.0
|
||||||
* Renamed `Counter Strike: 2D` to `CS2D` in [games.txt](games.txt) (why? see [this](https://cs2d.com/faq.php?show=misc_name#misc_name)).
|
* Renamed `Counter Strike: 2D` to `CS2D` in [games.txt](games.txt) (why? see [this](https://cs2d.com/faq.php?show=misc_name#misc_name)).
|
||||||
* Updated `CS2D` protocol (by @ernestpasnik)
|
* Updated `CS2D` protocol (by @ernestpasnik)
|
||||||
|
|
|
@ -108,6 +108,7 @@
|
||||||
| `drakan` | Drakan: Order of the Flame (1999) | |
|
| `drakan` | Drakan: Order of the Flame (1999) | |
|
||||||
| `dystopia` | Dystopia (2005) | [Valve Protocol](#valve) |
|
| `dystopia` | Dystopia (2005) | [Valve Protocol](#valve) |
|
||||||
| `eco` | Eco (2018) | |
|
| `eco` | Eco (2018) | |
|
||||||
|
| `eldewrito` | Halo Online - ElDewrito (2007) | |
|
||||||
| `empyrion` | Empyrion - Galactic Survival (2015) | [Valve Protocol](#valve) |
|
| `empyrion` | Empyrion - Galactic Survival (2015) | [Valve Protocol](#valve) |
|
||||||
| `empiresmod` | Empires Mod (2008) | [Valve Protocol](#valve) |
|
| `empiresmod` | Empires Mod (2008) | [Valve Protocol](#valve) |
|
||||||
| `etqw` | Enemy Territory: Quake Wars (2007) | |
|
| `etqw` | Enemy Territory: Quake Wars (2007) | |
|
||||||
|
|
|
@ -802,6 +802,13 @@ export const games = {
|
||||||
protocol: 'eco'
|
protocol: 'eco'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
eldewrito: {
|
||||||
|
name: 'Halo Online (ElDewrito)',
|
||||||
|
options: {
|
||||||
|
port: 11775,
|
||||||
|
protocol: 'eldewrito'
|
||||||
|
}
|
||||||
|
},
|
||||||
em: {
|
em: {
|
||||||
name: 'Empires Mod (2008)',
|
name: 'Empires Mod (2008)',
|
||||||
options: {
|
options: {
|
||||||
|
@ -1531,7 +1538,7 @@ export const games = {
|
||||||
name: 'Post Scriptum',
|
name: 'Post Scriptum',
|
||||||
options: {
|
options: {
|
||||||
port: 10037,
|
port: 10037,
|
||||||
protocol: 'squad'
|
protocol: 'valve'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
postal2: {
|
postal2: {
|
||||||
|
|
21
protocols/eldewrito.js
Normal file
21
protocols/eldewrito.js
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import Core from './core.js'
|
||||||
|
|
||||||
|
export default class eldewrito extends Core {
|
||||||
|
async run (state) {
|
||||||
|
const json = await this.request({
|
||||||
|
url: 'http://' + this.options.address + ':' + this.options.port,
|
||||||
|
responseType: 'json'
|
||||||
|
})
|
||||||
|
|
||||||
|
for (const one of json.players) {
|
||||||
|
state.players.push({ name: one.name, team: one.team })
|
||||||
|
}
|
||||||
|
|
||||||
|
state.name = json.name
|
||||||
|
state.map = json.map
|
||||||
|
state.maxplayers = json.maxPlayers
|
||||||
|
state.connect = this.options.address + ':' + json.port
|
||||||
|
|
||||||
|
state.raw = json
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ import cs2d from './cs2d.js'
|
||||||
import discord from './discord.js'
|
import discord from './discord.js'
|
||||||
import doom3 from './doom3.js'
|
import doom3 from './doom3.js'
|
||||||
import eco from './eco.js'
|
import eco from './eco.js'
|
||||||
|
import eldewrito from './eldewrito.js'
|
||||||
import epic from './epic.js'
|
import epic from './epic.js'
|
||||||
import ffow from './ffow.js'
|
import ffow from './ffow.js'
|
||||||
import fivem from './fivem.js'
|
import fivem from './fivem.js'
|
||||||
|
@ -53,5 +54,5 @@ export {
|
||||||
gamespy2, gamespy3, geneshift, goldsrc, hexen2, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft,
|
gamespy2, gamespy3, geneshift, goldsrc, hexen2, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft,
|
||||||
minecraftbedrock, minecraftvanilla, mumble, mumbleping, nadeo, openttd, quake1, quake2, quake3, rfactor, samp,
|
minecraftbedrock, minecraftvanilla, mumble, mumbleping, nadeo, openttd, quake1, quake2, quake3, rfactor, samp,
|
||||||
savage2, starmade, starsiege, teamspeak2, teamspeak3, terraria, tribes1, tribes1master, unreal2, ut3, valve,
|
savage2, starmade, starsiege, teamspeak2, teamspeak3, terraria, tribes1, tribes1master, unreal2, ut3, valve,
|
||||||
vcmp, ventrilo, warsow
|
vcmp, ventrilo, warsow, eldewrito
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ export default class minecraftvanilla extends Core {
|
||||||
const str = reader.rest().toString('utf8')
|
const str = reader.rest().toString('utf8')
|
||||||
this.logger.debug(str)
|
this.logger.debug(str)
|
||||||
|
|
||||||
const json = JSON.parse(str)
|
const json = JSON.parse(str.substring(0, strLen))
|
||||||
delete json.favicon
|
delete json.favicon
|
||||||
|
|
||||||
state.raw = json
|
state.raw = json
|
||||||
|
@ -57,6 +57,16 @@ export default class minecraftvanilla extends Core {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Better Compatibility Checker mod support
|
||||||
|
let bccJson = {}
|
||||||
|
|
||||||
|
if (str.length > strLen) {
|
||||||
|
const bccStr = str.substring(strLen + 1)
|
||||||
|
bccJson = JSON.parse(bccStr)
|
||||||
|
}
|
||||||
|
|
||||||
|
state.raw.bcc = bccJson
|
||||||
}
|
}
|
||||||
|
|
||||||
varIntBuffer (num) {
|
varIntBuffer (num) {
|
||||||
|
|
Loading…
Reference in a new issue