Exemple #1
0
        //Send
        public void SendMessage(GameMsgBase Msg)
        {
            //writeDone.WaitOne();
            m_WriteMsgQueue.Enqueue(Msg);
            //writeDone.ReleaseMutex();

            //TrySendMsg();
        }
Exemple #2
0
        public static void DispatchNetMsg(GameMsgBase Msg)
        {
            //Debug.Log("DispatchNetMsg Msg:" + Msg.getMsgType() + "s_MsgMap count" + s_MsgMap.Count);
            GameMsgType nMsgType = Msg.getMsgType();

            if (s_MsgMap.Contains(nMsgType))
            {
                //Debug.Log("DispatchNetMsg 2");
                NetMsgProcessor MsgEntry = (NetMsgProcessor)s_MsgMap[nMsgType];
                if (MsgEntry != null)
                {
                    MsgEntry(Msg);
                }
                else
                {
                    Debug.LogError("MsgEntry is null ,ID:" + Msg.getMsgType());
                }
            }
        }