From 1353d37cb1eb0896116536d176e5d62ac10ae5d6 Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Sun, 10 Feb 2019 23:06:17 -0500 Subject: [PATCH] Add FL checks, improve replay handler --- handlers/getFullReplayHandler.py | 16 ++++++---------- handlers/submitModularHandler.pyx | 15 +++++++++++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/handlers/getFullReplayHandler.py b/handlers/getFullReplayHandler.py index 836481e..3457f97 100644 --- a/handlers/getFullReplayHandler.py +++ b/handlers/getFullReplayHandler.py @@ -17,15 +17,11 @@ class handler(requestsManager.asyncRequestHandler): def asyncGet(self, replayID): try: fullReplay = replayHelper.buildFullReplay(scoreID=replayID) - self.write(fullReplay) - self.add_header("Content-type", "application/octet-stream") - self.set_header("Content-length", len(fullReplay)) - self.set_header("Content-Description", "File Transfer") - self.set_header("Content-Disposition", "attachment; filename=\"{}.osr\"".format(replayID)) except (exceptions.fileNotFoundException, exceptions.scoreNotFoundError): fullReplay = replayHelper.rxbuildFullReplay(scoreID=replayID) - self.write(fullReplay) - self.add_header("Content-type", "application/octet-stream") - self.set_header("Content-length", len(fullReplay)) - self.set_header("Content-Description", "File Transfer") - self.set_header("Content-Disposition", "attachment; filename=\"{}.osr\"".format(replayID)) \ No newline at end of file + + self.write(fullReplay) + self.add_header("Content-type", "application/octet-stream") + self.set_header("Content-length", len(fullReplay)) + self.set_header("Content-Description", "File Transfer") + self.set_header("Content-Disposition", "attachment; filename=\"{}.osr\"".format(replayID)) \ No newline at end of file diff --git a/handlers/submitModularHandler.pyx b/handlers/submitModularHandler.pyx index 0e2a3c9..194950b 100644 --- a/handlers/submitModularHandler.pyx +++ b/handlers/submitModularHandler.pyx @@ -160,13 +160,16 @@ class handler(requestsManager.asyncRequestHandler): # Restrict obvious cheaters™ if restricted == False: if isRelaxing: # Relax - rxGods = [7340, 2137, 6868, 1215, 15066, 14522, 1325, 5798, 21610, 1254] # Yea yea it's a bad way of doing it, kill yourself - cmyui osu gaming + rxGods = [7340, 2137, 6868, 1215, 15066, 14522, 1325, 5798, 21610, 1254, 15070, 3445, 17157, 14791, 14728] # Yea yea it's a bad way of doing it, kill yourself - cmyui osu gaming """ CTBLIST = [] TAIKOLIST = [] """ - - if (s.pp >= 2000 and s.gameMode == gameModes.STD) and userID not in rxGods: + if (s.pp >= 1200 and s.gameMode == gameModes.STD and used_mods & 1024) and userID not in rxGods: + userUtils.restrict(userID) + userUtils.appendNotes(userID, "Restricted due to too high pp gain with FLASHLIGHT ({}pp)".format(s.pp)) + log.warning("**{}** ({}) has been restricted due to too high pp gain with FLASHLIGHT **({}pp)**".format(username, userID, s.pp), "cm") + elif (s.pp >= 2000 and s.gameMode == gameModes.STD) and userID not in rxGods: userUtils.restrict(userID) userUtils.appendNotes(userID, "Restricted due to too high pp gain ({}pp)".format(s.pp)) log.warning("**{}** ({}) has been restricted due to too high pp gain **({}pp)**".format(username, userID, s.pp), "cm") @@ -181,7 +184,11 @@ class handler(requestsManager.asyncRequestHandler): log.warning("**{}** ({}) has been restricted due to too high pp gain **({}pp)**".format(username, userID, s.pp), "cm") """ else: # Vanilla - if (s.pp >= 700 and s.gameMode == gameModes.STD): + if (s.pp >= 500 and s.gameMode == gameModes.STD and used_mods & 1024): + userUtils.restrict(userID) + userUtils.appendNotes(userID, "Restricted due to too high pp gain with FLASHLIGHT ({}pp)".format(s.pp)) + log.warning("**{}** ({}) has been restricted due to too high pp gain with FLASHLIGHT **({}pp)**".format(username, userID, s.pp), "cm") + elif (s.pp >= 700 and s.gameMode == gameModes.STD): userUtils.restrict(userID) userUtils.appendNotes(userID, "Restricted due to too high pp gain ({}pp)".format(s.pp)) log.warning("**{}** ({}) has been restricted due to too high pp gain **({}pp)**".format(username, userID, s.pp), "cm")