From 68dfad909fb1638da759efa3dc523e20696ecf7b Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 24 Oct 2011 12:01:52 -0400 Subject: [PATCH] Limit gametype support. CA, LMS, and CTS are not usable for all servers right now. --- xonstat/views/submission.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 952556f..efe69d2 100755 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -11,6 +11,15 @@ from xonstat.util import strip_colors log = logging.getLogger(__name__) +def is_supported_gametype(gametype): + """Whether a gametype is supported or not""" + flg_supported = True + + if gametype == 'cts' or gametype == 'ca' or gametype == 'lms': + flg_supported = False + + return flg_supported + def is_verified_request(request): (idfp, status) = d0_blind_id_verify( @@ -457,7 +466,10 @@ def stats_submit(request): log.debug("Required game meta fields (T, G, M, or S) missing. "\ "Can't continue.") raise Exception("Required game meta fields (T, G, M, or S) missing.") - + + if not is_supported_gametype(game_meta['G']): + raise Exception("Gametype not supported.") + if not has_minimum_real_players(players): raise Exception("The number of real players is below the minimum. "\ "Stats will be ignored.") -- 2.39.2