Example #1
0
        public void CheckForMessages()
        {
            if (!IsActive)
            {
                return;
            }
            NetIncomingMessage im = _client.ReadMessage();

            while (im != null)
            {
                var netMessage = Parent.ParseMessage(im);
                if (netMessage == null)
                {
                }
                else
                {
                    Parent.ActOnMessage(netMessage);
                }
                im = _client.ReadMessage();
            }
        }
Example #2
0
        public void CheckForMessages()
        {
            if (!IsActive)
            {
                return;
            }
            NetIncomingMessage im = _server.ReadMessage();

            while (im != null)
            {
                var netMessage = Parent.ParseMessage(im);
                if (netMessage == null)
                {
                }
                else
                {
                    Parent.ActOnMessage(netMessage);
                    BroadcastMessage(netMessage, im.SenderConnection);
                }
                im = _server.ReadMessage();
            }
        }