Exemplo n.º 1
0
func handle_client_player_selection(ctx frontend.Service, client frontend.Client, m *msg.PlayerSelectionReq) {
	player, ok := ctx.Players().GetById(m.PlayerId)
	if !ok {
		client.CloseWith(&msg.PlayerSelectionErrorResp{})
		return
	}

	client.SetPlayer(player)
	client.Send(&msg.PlayerSelectionResp{player})
}