public void ReadMessage(string message, ulong clientId)
        {
            IMessage <IMainController> messageObject = null;

            if (message == "client disconnected")
            {
                mainManager.RemoveClient(clientId);
            }
            else
            {
                messageObject = ServerReader.GetObjectFromXML <IMainController>(message, clientId);//message must be without any \0 characters
                messageObject?.Process(mainManager);
            }
            ConsoleWriter.Show("Unknown Client: " + clientId + " sent message of type: " + messageObject?.GetType().Name);
        }
Пример #2
0
        public void ReadMessage(string message, ulong clientId)
        {
            IMessage <IGMController> messageObject = null;

            if (message == "client disconnected")
            {
                GameController.CloseGame();
            }
            else
            {
                messageObject = ServerReader.GetObjectFromXML <IGMController>(message, clientId);//message must be without any \0 characters
                messageObject?.Process(GameController);
            }
            ConsoleWriter.Show("GM Client: " + clientId + " sent message of type: " + messageObject?.GetType().Name);
        }