mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
Add support for rFactor (2.0.10)
This commit is contained in:
parent
0ac80cc139
commit
81750805f6
12 changed files with 103 additions and 54 deletions
|
|
@ -99,6 +99,21 @@ class Core extends EventEmitter {
|
|||
// because lots of servers prefix with spaces to try to appear first
|
||||
state.name = (state.name || '').trim();
|
||||
|
||||
if (typeof state.players === 'number') {
|
||||
const num = state.players;
|
||||
state.players = [];
|
||||
for (let i = 0; i < num; i++) {
|
||||
state.players.push({});
|
||||
}
|
||||
}
|
||||
if (typeof state.bots === 'number') {
|
||||
const num = state.bots;
|
||||
state.bots = [];
|
||||
for (let i = 0; i < num; i++) {
|
||||
state.bots.push({});
|
||||
}
|
||||
}
|
||||
|
||||
if (!('connect' in state)) {
|
||||
state.connect = ''
|
||||
+ (state.gameHost || this.options.host || this.options.address)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue