Add FL checks, improve replay handler

This commit is contained in:
Josh Smith 2019-02-10 23:06:17 -05:00
parent 021a4dee31
commit 1353d37cb1
2 changed files with 17 additions and 14 deletions

View File

@ -17,13 +17,9 @@ class handler(requestsManager.asyncRequestHandler):
def asyncGet(self, replayID): def asyncGet(self, replayID):
try: try:
fullReplay = replayHelper.buildFullReplay(scoreID=replayID) 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): except (exceptions.fileNotFoundException, exceptions.scoreNotFoundError):
fullReplay = replayHelper.rxbuildFullReplay(scoreID=replayID) fullReplay = replayHelper.rxbuildFullReplay(scoreID=replayID)
self.write(fullReplay) self.write(fullReplay)
self.add_header("Content-type", "application/octet-stream") self.add_header("Content-type", "application/octet-stream")
self.set_header("Content-length", len(fullReplay)) self.set_header("Content-length", len(fullReplay))

View File

@ -160,13 +160,16 @@ class handler(requestsManager.asyncRequestHandler):
# Restrict obvious cheaters™ # Restrict obvious cheaters™
if restricted == False: if restricted == False:
if isRelaxing: # Relax 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 = [] CTBLIST = []
TAIKOLIST = [] TAIKOLIST = []
""" """
if (s.pp >= 1200 and s.gameMode == gameModes.STD and used_mods & 1024) and userID not in rxGods:
if (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 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.restrict(userID)
userUtils.appendNotes(userID, "Restricted due to too high pp gain ({}pp)".format(s.pp)) 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") 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") log.warning("**{}** ({}) has been restricted due to too high pp gain **({}pp)**".format(username, userID, s.pp), "cm")
""" """
else: # Vanilla 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.restrict(userID)
userUtils.appendNotes(userID, "Restricted due to too high pp gain ({}pp)".format(s.pp)) 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") log.warning("**{}** ({}) has been restricted due to too high pp gain **({}pp)**".format(username, userID, s.pp), "cm")