]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Limit gametype support. CA, LMS, and CTS are not usable for all servers right now.
authorAnt Zucaro <azucaro@gmail.com>
Mon, 24 Oct 2011 16:01:52 +0000 (12:01 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 24 Oct 2011 16:01:52 +0000 (12:01 -0400)
xonstat/views/submission.py

index 952556f5088b8a579a2281a1d2b6df0aa4e94911..efe69d286dd37e089a6cc71bb2130548a43f6bff 100755 (executable)
@@ -11,6 +11,15 @@ from xonstat.util import strip_colors
 \r
 log = logging.getLogger(__name__)\r
 \r
+def is_supported_gametype(gametype):\r
+    """Whether a gametype is supported or not"""\r
+    flg_supported = True\r
+\r
+    if gametype == 'cts' or gametype == 'ca' or gametype == 'lms':\r
+        flg_supported = False\r
+\r
+    return flg_supported\r
+\r
 \r
 def is_verified_request(request):\r
     (idfp, status) = d0_blind_id_verify(\r
@@ -457,7 +466,10 @@ def stats_submit(request):
             log.debug("Required game meta fields (T, G, M, or S) missing. "\\r
                     "Can't continue.")\r
             raise Exception("Required game meta fields (T, G, M, or S) missing.")\r
-    \r
+   \r
+        if not is_supported_gametype(game_meta['G']):\r
+            raise Exception("Gametype not supported.")\r
+     \r
         if not has_minimum_real_players(players):\r
             raise Exception("The number of real players is below the minimum. "\\r
                     "Stats will be ignored.")\r