mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
Upgrade syntax of everything to more modern javascript
This commit is contained in:
parent
f8d903b982
commit
69288baebc
43 changed files with 1499 additions and 1521 deletions
|
|
@ -1,24 +1,18 @@
|
|||
/*
|
||||
module.exports = require('./valve').extend({
|
||||
init: function() {
|
||||
this._super();
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
// supposedly, gamespy3 is the "official" query protocol for jcmp,
|
||||
// but it's broken (requires useOnlySingleSplit), and doesn't include player names
|
||||
module.exports = require('./gamespy3').extend({
|
||||
init: function() {
|
||||
this._super();
|
||||
class Jc2mp extends require('./gamespy3') {
|
||||
constructor() {
|
||||
super();
|
||||
this.useOnlySingleSplit = true;
|
||||
},
|
||||
finalizeState: function(state) {
|
||||
this._super(state);
|
||||
}
|
||||
finalizeState(state) {
|
||||
super.finalizeState(state);
|
||||
if(!state.players.length && parseInt(state.raw.numplayers)) {
|
||||
for(var i = 0; i < parseInt(state.raw.numplayers); i++) {
|
||||
for(let i = 0; i < parseInt(state.raw.numplayers); i++) {
|
||||
state.players.push({});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = Jc2mp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue