Exemple #1
0
        public bool HandleMessage(Message msg, IConnection connection)
        {
            MessageDelegateNode messageDelegateNode = messageDelegateInitializer.GetMessageDelegate(msg.GetType());

            bool result;

            if (messageDelegateNode == null)
            {
                result = false;
            }
            else
            {
                messageDelegateNode.ReceiveMessage(msg);
                if (messageDelegateNode.isShortConnect)
                {
                    connection.Disconnect();
                }
                result = true;
            }

            return(result);
        }
Exemple #2
0
 public void AddMessageReceiveDelegate(Type msgType, MessageDelegateNode msgDelegate)
 {
     messageType2MessageDelegateNodeDic.Add(msgType, msgDelegate);
 }