Skip to content

Commit

Permalink
- matches with "untracked" in the factory name are now ignored (no st…
Browse files Browse the repository at this point in the history
…ats)

- matches with "unrated" or "unranked" in the factory name will be unrated and show status info "game was voted unranked"
  • Loading branch information
PredatH0r committed Jun 10, 2016
1 parent 395f970 commit 0eb8f4b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
8 changes: 4 additions & 4 deletions development.ini
Expand Up @@ -43,15 +43,15 @@ xonstat.leaderboard_lifetime = 30
xonstat.verify_requests = false

# put the URL here, leave it blank to use the default "http://<hostname>:8081/" or set it to "false" to hide the "Add Server" button
qlstat.feeder_webadmin_url =
qlstat.feeder_webadmin_url=

# set the base url of the feeder process running the webapi module. The API is used by client side javascript to query live server data (i.e. "Now Playing" on the server info page)
# when left blank, "http://<hostname>:8081/" will be used.
qlstat.feeder_webapi_url =
qlstat.feeder_webapi_url=

# URL of the forum web site that will be shown in an iframe in news_index.mako. $1 in the posting url is replaced with the #hash. If not set, there will be no News/Forum link in the navbar.
qlstat.forum_index_url =
qlstat.forum_posting_url =
qlstat.forum_index_url=
qlstat.forum_posting_url=


##### END XONSTAT CONFIG SETTINGS #####
Expand Down
4 changes: 4 additions & 0 deletions feeder/feeder.node.js
Expand Up @@ -755,6 +755,10 @@ function processGameData(game) {
_logger.debug(addr + ": ignoring aborted game " + game.matchStats.MATCH_GUID);
return Q(false);
}
if (/untracked/i.test(game.matchStats.FACTORY_TITLE)) {
_logger.debug(addr + ": ignoring untracked game " + game.matchStats.MATCH_GUID);
return Q(false);
}

var gt = game.matchStats.GAME_TYPE.toLowerCase();

Expand Down
8 changes: 7 additions & 1 deletion feeder/modules/gamerating.js
Expand Up @@ -22,7 +22,8 @@ const
ERR_DATAFILEMISSING = 7,
ERR_FACTORY_OR_SETTINGS = 8,
ERR_UNSUPPORTED_GAME_TYPE = 9,
ERR_UNRATED_SERVER = 10;
ERR_UNRATED_SERVER = 10,
ERR_UNRATED_GAME = 11;

const rateEachSingleMatch = true;
var _config;
Expand Down Expand Up @@ -399,6 +400,11 @@ function processGame(cli, gameId, game) {
}

function extractDataFromGameObject(game) {
if (/unrated|unranked/i.test(game.matchStats.FACTORY_TITLE)) {
_logger.debug(addr + ": ignoring unrated game " + game.matchStats.MATCH_GUID);
return ERR_UNRATED_GAME;
}

if (!strategy.isSupported) return ERR_UNSUPPORTED_GAME_TYPE;
if (game.matchStats.ABORTED) return ERR_ABORTED;
if (game.matchStats.INFECTED) return ERR_FACTORY_OR_SETTINGS;
Expand Down
3 changes: 2 additions & 1 deletion feeder/modules/statsconn.js
Expand Up @@ -51,8 +51,9 @@ function StatsConnection(owner, ip, port, pass, onZmqMessageCallback, gamePort)
// stuff for feeder to track rounds and real play time
this.round = 0;
this.roundStartTime = 0;
this.roundDurations = [];
this.emitter = new events.EventEmitter();
this.roundStats = [];
this.quitters = [];
}

StatsConnection.prototype.connect = function (isReconnect) {
Expand Down
2 changes: 1 addition & 1 deletion xonstat/templates/game_info.mako
Expand Up @@ -52,7 +52,7 @@ Game Information
statusMsg={
0: "Not rated yet", 1: "Rated", 2: "match aborted", 3: "unsupported round/time/fraglimit", 4: "bots present",
5: "uneven playtime in teams", 6: "not enough qualifying players", 7: "missing data", 8: "B-rated (custom settings/factory)",
9: "unsupported game type", 10: "server is exluded from ratings"
9: "unsupported game type", 10: "server is excluded from ratings", 11: "game was voted unranked"
}
msg= statusMsg[game.g2_status] if game.g2_status in (1,8) else "Not rated (" + statusMsg[game.g2_status] + ")"
%>
Expand Down

0 comments on commit 0eb8f4b

Please sign in to comment.