mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
Convert tabs to spaces
This commit is contained in:
parent
0dd25bfcda
commit
3674d384d0
39 changed files with 2414 additions and 2414 deletions
|
|
@ -1,23 +1,23 @@
|
|||
class AmericasArmy extends require('./gamespy2') {
|
||||
finalizeState(state) {
|
||||
super.finalizeState(state);
|
||||
state.name = this.stripColor(state.name);
|
||||
state.map = this.stripColor(state.map);
|
||||
for(const key of Object.keys(state.raw)) {
|
||||
if(typeof state.raw[key] === 'string') {
|
||||
finalizeState(state) {
|
||||
super.finalizeState(state);
|
||||
state.name = this.stripColor(state.name);
|
||||
state.map = this.stripColor(state.map);
|
||||
for(const key of Object.keys(state.raw)) {
|
||||
if(typeof state.raw[key] === 'string') {
|
||||
state.raw[key] = this.stripColor(state.raw[key]);
|
||||
}
|
||||
}
|
||||
for(const player of state.players) {
|
||||
if(!('name' in player)) continue;
|
||||
player.name = this.stripColor(player.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(const player of state.players) {
|
||||
if(!('name' in player)) continue;
|
||||
player.name = this.stripColor(player.name);
|
||||
}
|
||||
}
|
||||
|
||||
stripColor(str) {
|
||||
// uses unreal 2 color codes
|
||||
return str.replace(/\x1b...|[\x00-\x1a]/g,'');
|
||||
}
|
||||
stripColor(str) {
|
||||
// uses unreal 2 color codes
|
||||
return str.replace(/\x1b...|[\x00-\x1a]/g,'');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AmericasArmy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue