# Path: constants/clientPackets.py
# def userActionChange(stream):
# def userStatsRequest(stream):
# def userPanelRequest(stream):
# def sendPublicMessage(stream):
# def sendPrivateMessage(stream):
# def setAwayMessage(stream):
# def channelJoin(stream):
# def channelPart(stream):
# def addRemoveFriend(stream):
# def startSpectating(stream):
# def matchSettings(stream):
# def createMatch(stream):
# def changeMatchSettings(stream):
# def changeSlot(stream):
# def joinMatch(stream):
# def changeMods(stream):
# def lockSlot(stream):
# def transferHost(stream):
# def matchInvite(stream):
# def matchFrames(stream):
# def tournamentMatchInfoRequest(stream):
# def tournamentJoinMatchChannel(stream):
# def tournamentLeaveMatchChannel(stream):
# 
# Path: constants/matchModModes.py
# NORMAL = 0
# FREE_MOD = 1
# 
# Path: constants/matchTeamTypes.py
# HEAD_TO_HEAD = 0
# TAG_COOP = 1
# TEAM_VS = 2
# TAG_TEAM_VS = 3
# 
# Path: constants/matchTeams.py
# NO_TEAM = 0
# BLUE = 1
# RED = 2
# 
# Path: constants/slotStatuses.py
# FREE = 1
# LOCKED = 2
# NOT_READY = 4
# READY = 8
# NO_MAP = 16
# PLAYING = 32
# OCCUPIED = 124
# PLAYING_QUIT = 128
# 
# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# DATADOG_PREFIX = "peppy"


import random
from common import generalUtils
from common.log import logUtils as log
from constants import clientPackets
from constants import matchModModes
from constants import matchTeamTypes
from constants import matchTeams
from constants import slotStatuses
from objects import glob



def handle(userToken, packetData):
	# Read new settings
	packetData = clientPackets.changeMatchSettings(packetData)

	# Get match ID
	matchID = userToken.matchID
		
	# Make sure the match exists

# Path: constants/clientPackets.py
# def userActionChange(stream):
# def userStatsRequest(stream):
# def userPanelRequest(stream):
# def sendPublicMessage(stream):
# def sendPrivateMessage(stream):
# def setAwayMessage(stream):
# def channelJoin(stream):
# def channelPart(stream):
# def addRemoveFriend(stream):
# def startSpectating(stream):
# def matchSettings(stream):
# def createMatch(stream):
# def changeMatchSettings(stream):
# def changeSlot(stream):
# def joinMatch(stream):
# def changeMods(stream):
# def lockSlot(stream):
# def transferHost(stream):
# def matchInvite(stream):
# def matchFrames(stream):
# def tournamentMatchInfoRequest(stream):
# def tournamentJoinMatchChannel(stream):
# def tournamentLeaveMatchChannel(stream):
# 
# Path: constants/matchModModes.py
# NORMAL = 0
# FREE_MOD = 1
# 
# Path: constants/matchTeamTypes.py
# HEAD_TO_HEAD = 0
# TAG_COOP = 1
# TEAM_VS = 2
# TAG_TEAM_VS = 3
# 
# Path: constants/matchTeams.py
# NO_TEAM = 0
# BLUE = 1
# RED = 2
# 
# Path: constants/slotStatuses.py
# FREE = 1
# LOCKED = 2
# NOT_READY = 4
# READY = 8
# NO_MAP = 16
# PLAYING = 32
# OCCUPIED = 124
# PLAYING_QUIT = 128
# 
# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# DATADOG_PREFIX = "peppy"


# Path: events/changeMatchSettingsEvent.py
import random
from common import generalUtils
from common.log import logUtils as log
from constants import clientPackets
from constants import matchModModes
from constants import matchTeamTypes
from constants import matchTeams
from constants import slotStatuses
from objects import glob




def handle(userToken, packetData):
	# Read new settings
	packetData = clientPackets.changeMatchSettings(packetData)

	# Get match ID
	matchID = userToken.matchID
		
	# Make sure the match exists

	if matchID not in glob.matches.matches: