Beispiel #1
0
        public bool HandleMessage(IMessage message, PhotonClientPeer peer)
        {
            bool handled = false;

            switch (message.Type)
            {
            case MessageType.Request:
                handled = CheckMessage(message, peer, _requestHandlerList);
                break;
            }

            return(handled);
        }
Beispiel #2
0
        private bool CheckMessage(IMessage message, PhotonClientPeer peer, Dictionary <int, PhotonClientHandler> list)
        {
            var handled = false;

            if (message.SubCode.HasValue && list.ContainsKey(message.SubCode.Value))
            {
                list[message.SubCode.Value].HandleMessage(message, peer);
                handled = true;
            }
            else if (!message.SubCode.HasValue && list.ContainsKey(message.Code))
            {
                list[message.Code].HandleMessage(message, peer);
                handled = true;
            }

            return(handled);
        }