public static void HandleMessage(JoinGame request, CommunicationServer server, Socket handler)
        {
            if (request == null)
            {
                return;
            }

            //if (server.startedGames.Contains(request.gameName))
            //{
            //    ConsoleDebug.Error("Game already started");
            //    return;
            //}


            Game.IGame g = server.RegisteredGames.GetGameByName(request.gameName);
            if (g == null)
            {
                ConsoleDebug.Error("Game with specified name not found");
                return;
            }
            if (g.HasStarted)
            {
                ConsoleDebug.Error("Game already started");
                return;
            }

            lock (joinLock)
            {
                request.playerId          = server.IdForNewClient();
                request.playerIdSpecified = true;
                server.Clients.Add(request.playerId, handler);
                g.Players.Add(new Game.Player {
                    Id = request.playerId
                });
            }

            var response = XmlMessageConverter.ToXml(request);

            server.ConnectionEndpoint.SendFromServer(g.GameMaster, response);
            return;
        }