# Path: constants/dataTypes.py
# BYTE = 0
# UINT16 = 1
# SINT16 = 2
# UINT32 = 3
# SINT32 = 4
# UINT64 = 5
# SINT64 = 6
# STRING = 7
# FFLOAT = 8		# 'float' is a keyword
# BBYTES = 9      # 'bytes' is a keyword
# INT_LIST = 10   # TODO: Maybe there are some packets that still use uInt16 + uInt32 thing somewhere.
# 
# Path: constants/packetIDs.py

# 
# Path: constants/userRanks.py
# NORMAL			= 0
# PLAYER			= 1
# BAT				= 2
# SUPPORTER		= 4
# MOD				= 6
# PEPPY			= 8
# ADMIN			= 16
# TOURNAMENT_STAFF = 32
# 
# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# DATADOG_PREFIX = "peppy"


from common.constants import privileges
from common.ripple import userUtils
from constants import dataTypes
from constants import packetIDs
from constants import userRanks
from helpers import packetHelper
from objects import glob
	packets = packetHelper.buildPacket(packetIDs.server_userID, [[-1, dataTypes.SINT32]])
	packets += notification("Your account is locked. You can't log in, but your profile and scores are still visible from the website. If you want to unlock your account, send an email to support@ripple.moe from the email address you've used to sign up.")
	return packets

def loginError():
	return packetHelper.buildPacket(packetIDs.server_userID, [[-5, dataTypes.SINT32]])

def needSupporter():
	return packetHelper.buildPacket(packetIDs.server_userID, [[-6, dataTypes.SINT32]])

def needVerification():
	return packetHelper.buildPacket(packetIDs.server_userID, [[-8, dataTypes.SINT32]])


""" Login packets """
def userID(uid):
	return packetHelper.buildPacket(packetIDs.server_userID, [[uid, dataTypes.SINT32]])

def silenceEndTime(seconds):
	return packetHelper.buildPacket(packetIDs.server_silenceEnd, [[seconds, dataTypes.UINT32]])

def protocolVersion(version = 19):
	return packetHelper.buildPacket(packetIDs.server_protocolVersion, [[version, dataTypes.UINT32]])

def mainMenuIcon(icon):
	return packetHelper.buildPacket(packetIDs.server_mainMenuIcon, [[icon, dataTypes.STRING]])

def userSupporterGMT(supporter, GMT, tournamentStaff):
	result = 1
	if supporter:

# Path: constants/dataTypes.py
# BYTE = 0
# UINT16 = 1
# SINT16 = 2
# UINT32 = 3
# SINT32 = 4
# UINT64 = 5
# SINT64 = 6
# STRING = 7
# FFLOAT = 8		# 'float' is a keyword
# BBYTES = 9      # 'bytes' is a keyword
# INT_LIST = 10   # TODO: Maybe there are some packets that still use uInt16 + uInt32 thing somewhere.
# 
# Path: constants/packetIDs.py

# 
# Path: constants/userRanks.py
# NORMAL			= 0
# PLAYER			= 1
# BAT				= 2
# SUPPORTER		= 4
# MOD				= 6
# PEPPY			= 8
# ADMIN			= 16
# TOURNAMENT_STAFF = 32
# 
# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# DATADOG_PREFIX = "peppy"


# Path: constants/serverPackets.py
from common.constants import privileges
from common.ripple import userUtils
from constants import dataTypes
from constants import packetIDs
from constants import userRanks
from helpers import packetHelper
from objects import glob

	packets = packetHelper.buildPacket(packetIDs.server_userID, [[-1, dataTypes.SINT32]])
	packets += notification("Your account is locked. You can't log in, but your profile and scores are still visible from the website. If you want to unlock your account, send an email to support@ripple.moe from the email address you've used to sign up.")
	return packets

def loginError():
	return packetHelper.buildPacket(packetIDs.server_userID, [[-5, dataTypes.SINT32]])

def needSupporter():
	return packetHelper.buildPacket(packetIDs.server_userID, [[-6, dataTypes.SINT32]])

def needVerification():
	return packetHelper.buildPacket(packetIDs.server_userID, [[-8, dataTypes.SINT32]])


""" Login packets """
def userID(uid):
	return packetHelper.buildPacket(packetIDs.server_userID, [[uid, dataTypes.SINT32]])

def silenceEndTime(seconds):
	return packetHelper.buildPacket(packetIDs.server_silenceEnd, [[seconds, dataTypes.UINT32]])

def protocolVersion(version = 19):
	return packetHelper.buildPacket(packetIDs.server_protocolVersion, [[version, dataTypes.UINT32]])

def mainMenuIcon(icon):
	return packetHelper.buildPacket(packetIDs.server_mainMenuIcon, [[icon, dataTypes.STRING]])

def userSupporterGMT(supporter, GMT, tournamentStaff):
	result = 1
	if supporter:

		result |= userRanks.SUPPORTER