mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 07:07:33 +00:00
Improve starmade protocol
This commit is contained in:
parent
eba10df217
commit
2ffeda6098
2 changed files with 33 additions and 17 deletions
|
|
@ -102,15 +102,21 @@ class Core extends EventEmitter {
|
|||
if (typeof state.players === 'number') {
|
||||
const num = state.players;
|
||||
state.players = [];
|
||||
for (let i = 0; i < num; i++) {
|
||||
state.players.push({});
|
||||
state.raw.rcvNumPlayers = num;
|
||||
if (num < 10000) {
|
||||
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({});
|
||||
state.raw.rcvNumBots = num;
|
||||
if (num < 10000) {
|
||||
for (let i = 0; i < num; i++) {
|
||||
state.bots.push({});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue