Changed hardcoded type to gamedig to lookup correct type based on game

Fixes #4
This commit is contained in:
Björn Dahlgren 2015-04-25 12:17:24 +02:00
parent 38c1601b74
commit fcd02b3ccd

View File

@ -8,6 +8,15 @@ var ArmaServer = require('arma-server');
var config = require('../config.js');
var queryInterval = 5000;
var queryTypes = {
arma1: 'arma',
arma2: 'arma2',
arma2oa: 'arma2',
arma3: 'arma3',
cwa: 'operationflashpoint',
ofp: 'operationflashpoint',
ofpresistance: 'operationflashpoint',
};
var Server = function (path, type, options) {
this.path = path;
@ -37,7 +46,7 @@ Server.prototype.queryStatus = function() {
var self = this;
Gamedig.query(
{
type: 'arma3',
type: queryTypes[config.game],
host: '127.0.0.1',
port: self.port,
},