mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 07:07:33 +00:00
feat: add vintage story support (#606)
* feat: add vintage story support * remove debug console.log
This commit is contained in:
parent
72893df2b3
commit
dcd12d0360
6 changed files with 60 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
## To Be Released...
|
||||
## 5.X.Y
|
||||
* Added Vintage Story support via the master server (#606)
|
||||
|
||||
## 4.3.2
|
||||
* Locked dependencies versions
|
||||
|
|
|
|||
|
|
@ -137,9 +137,9 @@
|
|||
| globaloperations | Global Operations | |
|
||||
| goldeneyesource | GoldenEye: Source | [Valve Protocol](#valve) |
|
||||
| groundbreach | Ground Breach | [Valve Protocol](#valve) |
|
||||
| gta5am | Grand Theft Auto V - alt:V Multiplayer | [Notes](#gta5am) |
|
||||
| gta5f | Grand Theft Auto V - FiveM | |
|
||||
| gta5r | Grand Theft Auto V - RAGE MP | [Notes](#gta5r) |
|
||||
| gta5am | Grand Theft Auto V - alt:V Multiplayer | [Notes](#gta5am) |
|
||||
| gta5r | Grand Theft Auto V - RageMP | [Notes](#gta5r) |
|
||||
| gtasam | Grand Theft Auto: San Andreas Multiplayer | |
|
||||
| gtasamta | Grand Theft Auto: San Andreas - Multi Theft Auto | |
|
||||
| gtasao | Grand Theft Auto: San Andreas OpenMP | |
|
||||
|
|
@ -258,7 +258,7 @@
|
|||
| serioussam2 | Serious Sam 2 | |
|
||||
| shatteredhorizon | Shattered Horizon | [Valve Protocol](#valve) |
|
||||
| shogo | Shogo | |
|
||||
| shootmania | Shootmania | [Notes](#nadeo-shootmania--trackmania--etc) |
|
||||
| shootmania | Shootmania | [Notes](#nadeo) |
|
||||
| sin | SiN | |
|
||||
| sinepisodes | SiN Episodes | [Valve Protocol](#valve) |
|
||||
| sof | Soldier of Fortune | |
|
||||
|
|
@ -309,8 +309,8 @@
|
|||
| toh | Take On Helicopters | |
|
||||
| tonolf | The Operative: No One Lives Forever | |
|
||||
| towerunite | Tower Unite | [Valve Protocol](#valve) |
|
||||
| trackmania2 | Trackmania 2 | [Notes](#nadeo-shootmania--trackmania--etc) |
|
||||
| trackmaniaforever | Trackmania Forever | [Notes](#nadeo-shootmania--trackmania--etc) |
|
||||
| trackmania2 | Trackmania 2 | [Notes](#nadeo) |
|
||||
| trackmaniaforever | Trackmania Forever | [Notes](#nadeo) |
|
||||
| tremulous | Tremulous | |
|
||||
| tribesvengeance | Tribes: Vengeance | |
|
||||
| tron20 | Tron 2.0 | |
|
||||
|
|
@ -331,6 +331,7 @@
|
|||
| ventrilo | Ventrilo | |
|
||||
| vietcong | Vietcong | |
|
||||
| vietcong2 | Vietcong 2 | |
|
||||
| vintagestory | Vintage Story | |
|
||||
| vrising | V Rising | [Valve Protocol](#valve) |
|
||||
| warfork | Warfork | |
|
||||
| warsow | Warsow | |
|
||||
|
|
|
|||
|
|
@ -3214,6 +3214,14 @@ export const games = {
|
|||
old_id: 'vs'
|
||||
}
|
||||
},
|
||||
vintagestory: {
|
||||
name: 'Vintage Story',
|
||||
release_year: 2016,
|
||||
options: {
|
||||
port: 42420,
|
||||
protocol: 'vintagestory'
|
||||
}
|
||||
},
|
||||
warsow: {
|
||||
name: 'Warsow',
|
||||
release_year: 2012,
|
||||
|
|
|
|||
|
|
@ -60,11 +60,14 @@ import theisleevrima from './theisleevrima.js'
|
|||
import ragemp from './ragemp.js'
|
||||
import xonotic from './xonotic.js'
|
||||
import altvmp from './altvmp.js'
|
||||
import vintagestorymaster from './vintagestorymaster.js'
|
||||
import vintagestory from './vintagestory.js'
|
||||
|
||||
export {
|
||||
armagetron, ase, asa, assettocorsa, battlefield, buildandshoot, cs2d, discord, doom3, eco, epic, factorio, farmingsimulator, ffow,
|
||||
fivem, gamespy1, gamespy2, gamespy3, geneshift, goldsrc, gtasao, hexen2, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft,
|
||||
minecraftbedrock, minecraftvanilla, minetest, mumble, mumbleping, nadeo, openttd, palworld, quake1, quake2, quake3, rfactor, ragemp, samp,
|
||||
savage2, starmade, starsiege, teamspeak2, teamspeak3, terraria, tribes1, tribes1master, unreal2, ut3, valve,
|
||||
vcmp, ventrilo, warsow, eldewrito, beammpmaster, beammp, dayz, theisleevrima, xonotic, altvmp
|
||||
vcmp, ventrilo, warsow, eldewrito, beammpmaster, beammp, dayz, theisleevrima, xonotic, altvmp, vintagestorymaster,
|
||||
vintagestory
|
||||
}
|
||||
|
|
|
|||
24
protocols/vintagestory.js
Normal file
24
protocols/vintagestory.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import Core from './core.js'
|
||||
import vintagestorymaster from './vintagestorymaster.js'
|
||||
|
||||
export default class vintagestory extends Core {
|
||||
async run (state) {
|
||||
const master = new vintagestorymaster()
|
||||
master.options = this.options
|
||||
const masterState = await master.runOnceSafe()
|
||||
const servers = masterState.raw.servers
|
||||
const server = servers.find(s => s.serverIP === `${this.options.address}:${this.options.port}`)
|
||||
|
||||
if (!server) {
|
||||
throw new Error('Server not found in the master list')
|
||||
}
|
||||
|
||||
state.name = server.serverName
|
||||
state.password = server.hasPassword
|
||||
state.numplayers = parseInt(server.players)
|
||||
state.maxplayers = parseInt(server.maxPlayers)
|
||||
state.version = server.gameVersion
|
||||
|
||||
state.raw = server
|
||||
}
|
||||
}
|
||||
17
protocols/vintagestorymaster.js
Normal file
17
protocols/vintagestorymaster.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import Core from './core.js'
|
||||
|
||||
export default class vintagestorymaster extends Core {
|
||||
constructor () {
|
||||
super()
|
||||
this.usedTcp = true
|
||||
}
|
||||
|
||||
async run (state) {
|
||||
const response = await this.request({
|
||||
url: 'https://masterserver.vintagestory.at/api/v1/servers/list',
|
||||
responseType: 'json'
|
||||
})
|
||||
|
||||
state.raw.servers = response?.data || []
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue