Пример #1
0
def deserialize_matchmaker_join(dct):
	try:
		game = gamemodule.deserialize(dct['join']['game'])
		player = playermodule.deserialize(dct['join']['player'])
		return MatchmakerJoin(game, player)
	except:
		raise ValueError('Malformed alfred.message.MatchmakerJoin data: %s' % dct)
Пример #2
0
def deserialize_matchmaker_match(dct):
	try:
		game = gamemodule.deserialize(dct['match']['game'])
		players = dct['match']['players']
		i = 0

		while i < len(players):
			players[i] = playermodule.deserialize(players[i])
			i += 1

		return MatchmakerMatch(game, players)
	except:
		raise ValueError('Malformed alfred.message.MatchmakerMatch data: %s' % dct)
Пример #3
0
def deserialize_super_server_job(dct):
	try:
		game = gamemodule.deserialize(dct['job']['game'])
		players = dct['job']['players']
		i = 0

		while i < len(players):
			players[i] = playermodule.deserialize(players[i])
			i += 1

		return SuperServerJob(game, players)
	except:
		raise ValueError('Malformed alfred.message.SuperServerJob data: %s' % dct)
Пример #4
0
def deserialize_super_server_job_result(dct):
	try:
		game = dct['job_result']['game']

		if game != 0:
			game = gamemodule.deserialize(game)

		players = dct['job_result']['players']

		if players != 0:
			i = 0

			while i < len(players):
				players[i] = playermodule.deserialize(players[i])
				i += 1

		return SuperServerJobResult(dct['job_result']['success'], game, players)
	except:
		raise ValueError('Malformed alfred.message.SuperServerJobResult data: %s' % dct)