Super epic commit 3

Move everything around
Add another 50 or so games
*** 'port' option should now be CONNECT port, not query port ***
add reference for many missing games
This commit is contained in:
Michael Morrison 2014-02-03 14:00:51 -06:00
parent 8488cdcca9
commit bc6b5c9225
64 changed files with 2071 additions and 430 deletions

20
protocols/americasarmy.js Normal file
View file

@ -0,0 +1,20 @@
module.exports = require('./gamespy2').extend({
finalizeState: function(state) {
this._super(state);
state.name = this.stripColor(state.name);
state.map = this.stripColor(state.map);
for(var i in state.raw) {
if(!(typeof state.raw[i] == 'string')) continue;
state.raw[i] = this.stripColor(state.raw[i]);
}
for(var i = 0; i < state.players.length; i++) {
var player = state.players[i];
if(!('name' in player)) continue;
player.name = this.stripColor(player.name);
}
},
stripColor: function(str) {
// uses unreal 2 color codes
return str.replace(/\x1b...|[\x00-\x1a]/g,'');
}
});