node-gamedig/games/ut3.js

49 lines
1.3 KiB
JavaScript
Raw Normal View History

module.exports = require('./protocols/gamespy3').extend({
init: function() {
this._super();
this.pretty = 'Unreal Tournament 3';
this.options.port = 6500;
2013-07-10 18:17:11 +02:00
},
finalizeState: function(state) {
this._super(state);
this.translate(state.raw,{
2013-07-10 18:41:49 +02:00
'mapname': false,
'p1073741825': 'map',
'p1073741826': 'gametype',
'p1073741827': 'servername',
'p1073741828': 'custom_mutators',
2013-07-10 18:41:49 +02:00
'gamemode': 'joininprogress',
's32779': 'gamemode',
's0': 'bot_skill',
's6': 'pure_server',
's7': 'password',
's8': 'vs_bots',
's10': 'force_respawn',
'p268435704': 'frag_limit',
'p268435705': 'time_limit',
'p268435703': 'numbots',
2013-07-10 18:17:44 +02:00
'p268435717': 'stock_mutators',
2013-07-10 18:41:49 +02:00
'p1073741829': 'stock_mutators',
's1': false,
's9': false,
's11': false,
's12': false,
's13': false,
2013-07-10 18:41:49 +02:00
's14': false,
'p268435706': false,
'p268435968': false,
'p268435969': false
});
2013-07-10 18:41:49 +02:00
function split(a) {
var s = a.split('\x1c');
s = s.filter(function(e) { return e });
return s;
}
2014-02-01 16:46:50 +01:00
if('custom_mutators' in state.raw) state.raw['custom_mutators'] = split(state.raw['custom_mutators']);
if('stock_mutators' in state.raw) state.raw['stock_mutators'] = split(state.raw['stock_mutators']);
if('map' in state.raw) state.map = state.raw.map;
}
});