mirror of
https://github.com/Tribufu/node-gamedig
synced 2026-08-10 07:31:06 +00:00
feat(games): add ATS, The Cenozoic Era, VEIN and Mindustry support (#768)
* feat(games): add American Truck Simulator (ats) support Mirrors the Euro Truck Simulator 2 configuration (valve protocol, port 27015 with query port offset +1). * Update .gitignore * feat(games): add The Cenozoic Era, VEIN and Mindustry support - The Cenozoic Era and VEIN use the Valve A2S protocol with a query port offset of +1 (verified live against running servers). - Mindustry is queried via a new protocol module implementing the arc-net discovery ping: a two-byte UDP request (0xFE 0x01) returns the serialized Host struct (name, map, players, wave, version, vertype, gamemode, player limit, description, modeName). * fix(games): rename thecenozoicera to tce Satisfies the MoreThanTwoWordsMakeAcronym naming rule enforced by the id-tests CI check: game names with more than two words require an acronym-style id. * Update .gitignore * meta: restore .gitignore endline --------- Co-authored-by: CosminPerRam <cosmin.p@live.com>
This commit is contained in:
parent
aff6afd252
commit
ec4860cffc
4 changed files with 85 additions and 1 deletions
|
|
@ -28,6 +28,7 @@
|
||||||
| asr08 | Arca Sim Racing '08 | |
|
| asr08 | Arca Sim Racing '08 | |
|
||||||
| assettocorsa | Assetto Corsa | |
|
| assettocorsa | Assetto Corsa | |
|
||||||
| atlas | Atlas | [Valve Protocol](#valve) |
|
| atlas | Atlas | [Valve Protocol](#valve) |
|
||||||
|
| ats | American Truck Simulator | [Valve Protocol](#valve) |
|
||||||
| avorion | Avorion | [Valve Protocol](#valve) |
|
| avorion | Avorion | [Valve Protocol](#valve) |
|
||||||
| avp2 | Aliens versus Predator 2 | |
|
| avp2 | Aliens versus Predator 2 | |
|
||||||
| avp2010 | Aliens vs. Predator 2010 | [Valve Protocol](#valve) |
|
| avp2010 | Aliens vs. Predator 2010 | [Valve Protocol](#valve) |
|
||||||
|
|
@ -190,6 +191,7 @@
|
||||||
| mbe | Minecraft: Bedrock Edition | |
|
| mbe | Minecraft: Bedrock Edition | |
|
||||||
| medievalengineers | Medieval Engineers | [Valve Protocol](#valve) |
|
| medievalengineers | Medieval Engineers | [Valve Protocol](#valve) |
|
||||||
| mgm | Mumble - GT Murmur | [Notes](#mumble) |
|
| mgm | Mumble - GT Murmur | [Notes](#mumble) |
|
||||||
|
| mindustry | Mindustry | |
|
||||||
| minecraft | Minecraft | [Notes](#minecraft) |
|
| minecraft | Minecraft | [Notes](#minecraft) |
|
||||||
| minetest | Minetest | |
|
| minetest | Minetest | |
|
||||||
| mnc | Monday Night Combat | [Valve Protocol](#valve) |
|
| mnc | Monday Night Combat | [Valve Protocol](#valve) |
|
||||||
|
|
@ -303,6 +305,7 @@
|
||||||
| synergy | Synergy | [Valve Protocol](#valve) |
|
| synergy | Synergy | [Valve Protocol](#valve) |
|
||||||
| t1s | Tribes 1: Starsiege | |
|
| t1s | Tribes 1: Starsiege | |
|
||||||
| tacticalops | Tactical Ops | |
|
| tacticalops | Tactical Ops | |
|
||||||
|
| tce | The Cenozoic Era | [Valve Protocol](#valve) |
|
||||||
| tcgraw | Tom Clancy's Ghost Recon Advanced Warfighter | |
|
| tcgraw | Tom Clancy's Ghost Recon Advanced Warfighter | |
|
||||||
| tcgraw2 | Tom Clancy's Ghost Recon Advanced Warfighter 2 | |
|
| tcgraw2 | Tom Clancy's Ghost Recon Advanced Warfighter 2 | |
|
||||||
| teamfactor | Team Factor | |
|
| teamfactor | Team Factor | |
|
||||||
|
|
@ -345,6 +348,7 @@
|
||||||
| valheim | Valheim | [Notes](#valheim), [Valve Protocol](#valve) |
|
| valheim | Valheim | [Notes](#valheim), [Valve Protocol](#valve) |
|
||||||
| vampireslayer | Vampire Slayer | [Valve Protocol](#valve) |
|
| vampireslayer | Vampire Slayer | [Valve Protocol](#valve) |
|
||||||
| vcm | Vice City Multiplayer | |
|
| vcm | Vice City Multiplayer | |
|
||||||
|
| vein | VEIN | [Valve Protocol](#valve) |
|
||||||
| ventrilo | Ventrilo | |
|
| ventrilo | Ventrilo | |
|
||||||
| vietcong | Vietcong | |
|
| vietcong | Vietcong | |
|
||||||
| vietcong2 | Vietcong 2 | |
|
| vietcong2 | Vietcong 2 | |
|
||||||
|
|
|
||||||
35
lib/games.js
35
lib/games.js
|
|
@ -89,6 +89,15 @@ export const games = {
|
||||||
protocol: 'assettocorsa'
|
protocol: 'assettocorsa'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
ats: {
|
||||||
|
name: 'American Truck Simulator',
|
||||||
|
release_year: 2016,
|
||||||
|
options: {
|
||||||
|
port: 27015,
|
||||||
|
port_query_offset: 1,
|
||||||
|
protocol: 'valve'
|
||||||
|
}
|
||||||
|
},
|
||||||
atlas: {
|
atlas: {
|
||||||
name: 'Atlas',
|
name: 'Atlas',
|
||||||
release_year: 2018,
|
release_year: 2018,
|
||||||
|
|
@ -1930,6 +1939,14 @@ export const games = {
|
||||||
doc_notes: 'minecraft'
|
doc_notes: 'minecraft'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mindustry: {
|
||||||
|
name: 'Mindustry',
|
||||||
|
release_year: 2017,
|
||||||
|
options: {
|
||||||
|
port: 6567,
|
||||||
|
protocol: 'mindustry'
|
||||||
|
}
|
||||||
|
},
|
||||||
minetest: {
|
minetest: {
|
||||||
name: 'Minetest',
|
name: 'Minetest',
|
||||||
release_year: 2010,
|
release_year: 2010,
|
||||||
|
|
@ -3057,6 +3074,15 @@ export const games = {
|
||||||
doc_notes: 'terraria'
|
doc_notes: 'terraria'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
tce: {
|
||||||
|
name: 'The Cenozoic Era',
|
||||||
|
release_year: 2024,
|
||||||
|
options: {
|
||||||
|
port: 7777,
|
||||||
|
port_query_offset: 1,
|
||||||
|
protocol: 'valve'
|
||||||
|
}
|
||||||
|
},
|
||||||
theforest: {
|
theforest: {
|
||||||
name: 'The Forest',
|
name: 'The Forest',
|
||||||
release_year: 2014,
|
release_year: 2014,
|
||||||
|
|
@ -3309,6 +3335,15 @@ export const games = {
|
||||||
doc_notes: 'valheim'
|
doc_notes: 'valheim'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
vein: {
|
||||||
|
name: 'VEIN',
|
||||||
|
release_year: 2024,
|
||||||
|
options: {
|
||||||
|
port: 7777,
|
||||||
|
port_query_offset: 1,
|
||||||
|
protocol: 'valve'
|
||||||
|
}
|
||||||
|
},
|
||||||
vcm: {
|
vcm: {
|
||||||
name: 'Vice City Multiplayer',
|
name: 'Vice City Multiplayer',
|
||||||
release_year: 2015,
|
release_year: 2015,
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import mafia2online from './mafia2online.js'
|
||||||
import minecraft from './minecraft.js'
|
import minecraft from './minecraft.js'
|
||||||
import minecraftbedrock from './minecraftbedrock.js'
|
import minecraftbedrock from './minecraftbedrock.js'
|
||||||
import minecraftvanilla from './minecraftvanilla.js'
|
import minecraftvanilla from './minecraftvanilla.js'
|
||||||
|
import mindustry from './mindustry.js'
|
||||||
import minetest from './minetest.js'
|
import minetest from './minetest.js'
|
||||||
import mumble from './mumble.js'
|
import mumble from './mumble.js'
|
||||||
import mumbleping from './mumbleping.js'
|
import mumbleping from './mumbleping.js'
|
||||||
|
|
@ -80,7 +81,7 @@ import scpsl from './scpsl.js'
|
||||||
export {
|
export {
|
||||||
armagetron, ase, asa, assettocorsa, battlefield, brokeprotocol, brokeprotocolmaster, buildandshoot, cs2d, discord, doom3, eco, epic, factorio, farmingsimulator, ffow,
|
armagetron, ase, asa, assettocorsa, battlefield, brokeprotocol, brokeprotocolmaster, buildandshoot, cs2d, discord, doom3, eco, epic, factorio, farmingsimulator, ffow,
|
||||||
fivem, gamespy1, gamespy2, gamespy3, geneshift, goldsrc, gtasao, hawakening, hawakeningmaster, hexen2, hytale, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft,
|
fivem, gamespy1, gamespy2, gamespy3, geneshift, goldsrc, gtasao, hawakening, hawakeningmaster, hexen2, hytale, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft,
|
||||||
minecraftbedrock, minecraftvanilla, minetest, mumble, mumbleping, nadeo, openttd, palworld, quake1, quake2, quake3, renegadex, renegadexmaster, renown, rfactor, ragemp, samp,
|
minecraftbedrock, minecraftvanilla, mindustry, minetest, mumble, mumbleping, nadeo, openttd, palworld, quake1, quake2, quake3, renegadex, renegadexmaster, renown, rfactor, ragemp, samp,
|
||||||
satisfactory, soldat, savage2, squad, starmade, starsiege, teamspeak2, teamspeak3, terraria, toxikk, tribes1, tribes1master, unreal2, ut3, valve,
|
satisfactory, soldat, savage2, squad, starmade, starsiege, teamspeak2, teamspeak3, terraria, toxikk, tribes1, tribes1master, unreal2, ut3, valve,
|
||||||
vcmp, ventrilo, warsow, eldewrito, beammpmaster, beammp, dayz, theisleevrima, xonotic, altvmp, vintagestorymaster, vintagestory, sdtd, scpsl
|
vcmp, ventrilo, warsow, eldewrito, beammpmaster, beammp, dayz, theisleevrima, xonotic, altvmp, vintagestorymaster, vintagestory, sdtd, scpsl
|
||||||
}
|
}
|
||||||
|
|
|
||||||
44
protocols/mindustry.js
Normal file
44
protocols/mindustry.js
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
import Core from './core.js'
|
||||||
|
|
||||||
|
const GAMEMODES = ['survival', 'sandbox', 'attack', 'pvp', 'editor']
|
||||||
|
|
||||||
|
export default class mindustry extends Core {
|
||||||
|
constructor () {
|
||||||
|
super()
|
||||||
|
this.encoding = 'utf8'
|
||||||
|
this.byteorder = 'be'
|
||||||
|
}
|
||||||
|
|
||||||
|
async run (state) {
|
||||||
|
if (!this.options.port) this.options.port = 6567
|
||||||
|
|
||||||
|
// arc-net discovery request: triggers the Mindustry server to reply
|
||||||
|
// with a serialized Host struct (see Mindustry NetworkIO.writeServerData).
|
||||||
|
const request = Buffer.from([0xfe, 0x01])
|
||||||
|
const buffer = await this.udpSend(request, b => b)
|
||||||
|
|
||||||
|
const reader = this.reader(buffer)
|
||||||
|
const name = reader.pascalString(1)
|
||||||
|
const map = reader.pascalString(1)
|
||||||
|
const players = reader.int(4)
|
||||||
|
const wave = reader.int(4)
|
||||||
|
const version = reader.int(4)
|
||||||
|
const vertype = reader.pascalString(1)
|
||||||
|
const gamemodeId = reader.uint(1)
|
||||||
|
const playerLimit = reader.int(4)
|
||||||
|
const description = reader.pascalString(1)
|
||||||
|
const modeName = reader.pascalString(1)
|
||||||
|
|
||||||
|
state.name = name
|
||||||
|
state.map = map
|
||||||
|
state.password = false
|
||||||
|
state.numplayers = players
|
||||||
|
state.maxplayers = playerLimit
|
||||||
|
state.version = String(version)
|
||||||
|
state.raw.wave = wave
|
||||||
|
state.raw.vertype = vertype
|
||||||
|
state.raw.gamemode = GAMEMODES[gamemodeId] ?? String(gamemodeId)
|
||||||
|
state.raw.description = description
|
||||||
|
state.raw.modeName = modeName
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue