Initial commit

This commit is contained in:
Josh
2018-12-09 00:15:56 -05:00
commit aad3c9bb54
125 changed files with 18177 additions and 0 deletions

0
constants/__init__.py Normal file
View File

11
constants/dataTypes.py Normal file
View File

@@ -0,0 +1,11 @@
byte = 0
uInt16 = 1
sInt16 = 2
uInt32 = 3
sInt32 = 4
uInt64 = 5
sInt64 = 6
string = 7
ffloat = 8
bbytes = 9
rawReplay = 10

54
constants/exceptions.py Normal file
View File

@@ -0,0 +1,54 @@
from common.log import logUtils as log
class invalidArgumentsException(Exception):
def __init__(self, handler):
log.warning("{} - Invalid arguments".format(handler))
class loginFailedException(Exception):
def __init__(self, handler, who):
log.warning("{} - {}'s Login failed".format(handler, who))
class userBannedException(Exception):
def __init__(self, handler, who):
log.warning("{} - {} is banned".format(handler, who))
class userLockedException(Exception):
def __init__(self, handler, who):
log.warning("{} - {} is locked".format(handler, who))
class noBanchoSessionException(Exception):
def __init__(self, handler, who, ip):
log.warning("{handler} - {username} has tried to submit a score from {ip} without an active bancho session from that ip. If this happens often, {username} is trying to use a score submitter.".format(handler=handler, ip=ip, username=who), "bunker")
class osuApiFailException(Exception):
def __init__(self, handler):
log.warning("{} - Invalid data from osu!api".format(handler))
class fileNotFoundException(Exception):
def __init__(self, handler, f):
log.warning("{} - File not found ({})".format(handler, f))
class invalidBeatmapException(Exception):
pass
class unsupportedGameModeException(Exception):
pass
class beatmapTooLongException(Exception):
def __init__(self, handler):
log.warning("{} - Requested beatmap is too long.".format(handler))
class need2FAException(Exception):
def __init__(self, handler, who, ip):
log.warning("{} - 2FA check needed for user {} ({})".format(handler, who, ip))
class noAPIDataError(Exception):
pass
class scoreNotFoundError(Exception):
pass
class ppCalcException(Exception):
def __init__(self, exception):
self.exception = exception

View File

@@ -0,0 +1,8 @@
UNKNOWN = -2
NOT_SUBMITTED = -1
PENDING = 0
NEED_UPDATE = 1
RANKED = 2
APPROVED = 3
QUALIFIED = 4
LOVED = 5