mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 15:17:36 +00:00
feat: add Renegade X support (#643)
This commit is contained in:
parent
b3947164d3
commit
fe9d4f2cfc
7 changed files with 266 additions and 2 deletions
21
protocols/renegadexmaster.js
Normal file
21
protocols/renegadexmaster.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import renegadex from './renegadex.js'
|
||||
|
||||
/**
|
||||
* Implements the protocol for retrieving a master list for Renegade X, an UnrealEngine3 based game
|
||||
*/
|
||||
export default class renegadexmaster extends renegadex {
|
||||
async run (state) {
|
||||
const servers = await this.getMasterServerList()
|
||||
|
||||
// pass processed servers as raw list
|
||||
state.raw.servers = servers.map((serverInfo) => {
|
||||
// TODO: may use any other deep-copy method like structuredClone() (in Node.js 17+)
|
||||
// or use a method of Core to retrieve a clean state
|
||||
const serverState = JSON.parse(JSON.stringify(state))
|
||||
|
||||
// set state properties based on received server info
|
||||
this.populateProperties(serverState, serverInfo)
|
||||
return serverState
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue