Exemplo n.º 1
0
        public void RegMsg(ProtocolEnum protoId, OnMsgHandle msgHandle)
        {
            List <OnMsgHandle> msgLst;

            if (!m_netMsgLst.TryGetValue(protoId, out msgLst))
            {
                msgLst = new List <OnMsgHandle>();
                m_netMsgLst.Add(protoId, msgLst);
            }
            msgLst.Add(msgHandle);
        }
Exemplo n.º 2
0
        public void UnRegMsg(ProtocolEnum protoId, OnMsgHandle msgHandle)
        {
            List <OnMsgHandle> msgLst;

            if (!m_netMsgLst.TryGetValue(protoId, out msgLst))
            {
                return;
            }

            msgLst.Remove(msgHandle);
            if (msgLst.Count <= 0)
            {
                m_netMsgLst.Remove(protoId);
            }
        }
Exemplo n.º 3
0
 protected virtual void UnRegMsg(ProtocolEnum protoId, OnMsgHandle handle)
 {
     NetMsgDispatch.MInstance.UnRegMsg((ProtocolEnum)protoId, handle);
 }