From 6cacdea5e21866003dd87de72379c9459c9e0328 Mon Sep 17 00:00:00 2001 From: dsimmons87 Date: Thu, 29 Mar 2018 10:22:12 +0100 Subject: [PATCH] Remove option to upload maps older than Map Format 10 --- openra/handlers.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/openra/handlers.py b/openra/handlers.py index 578f751..41f67fe 100644 --- a/openra/handlers.py +++ b/openra/handlers.py @@ -103,14 +103,15 @@ def ProcessUploading(self, user_id, f, post, rev=1, pre_r=0): misc.send_email_to_admin_OnMapFail(tempname) return resp_map_data + if int(resp_map_data['mapformat']) < 10: + misc.send_email_to_admin_OnMapFail(tempname) + return "Unable to import maps older than map format 10." + # Read Rules - base64_rules = {} - base64_rules['data'] = '' - base64_rules['advanced'] = resp_map_data['advanced'] - if int(resp_map_data['mapformat']) >= 10: - base64_rules = utility.ReadRules(False, tempname, parser, resp_map_data['game_mod']) - if (base64_rules['error']): - print(base64_rules['response']) + base64_rules = utility.ReadRules(False, tempname, parser, resp_map_data['game_mod']) + if (base64_rules['error']): + print(base64_rules['response']) + if base64_rules['advanced']: resp_map_data['advanced'] = True @@ -203,8 +204,6 @@ def ProcessUploading(self, user_id, f, post, rev=1, pre_r=0): else: Maps.objects.filter(id=transac.id).update(requires_upgrade=True) - if int(resp_map_data['mapformat']) < 10: - self.GenerateMinimap(resp_map_data['game_mod'], parser) print("--- New map: %s" % self.UID) return False # no errors