Ejemplo n.º 1
0
        public override void ProcessEvent(MsgBase msg)
        {
            // 没有注册
            if (!eventTree.ContainsKey(msg.msgId))
            {
                Debug.LogWarning("msg not contain  msgid =" + msg.msgId);

                Debug.LogWarning("msg manager  =" + msg.GetManager());
                return;
            }
            else
            {
                // Debug.Log("  msgid =" + msg.msgId);
                EventNode tmp = eventTree[msg.msgId];


                do
                {
                    //ITools.Debugger(" asset Coming");
                    tmp.data.ProcessEvent(msg);


                    tmp = tmp.next;
                }while (tmp != null);
            }
        }
Ejemplo n.º 2
0
 public void SendMsg(MsgBase msg)
 {
     if (msg.GetManager() == (int)ManagerID.NetManager)
     {
         ProcessEvent(msg);
     }
     else
     {
         MsgCenter.instance.SendToMsg(msg);
     }
 }
Ejemplo n.º 3
0
        public void SendToMsg(MsgBase msg)
        {
            ManagerBase baseManager = managerDict[msg.GetManager()];

            if (baseManager == null)
            {
                Debug.LogError("Manager不存在");
                return;
            }
            baseManager.ProcessEvent(msg);
        }
Ejemplo n.º 4
0
 public override void SendMsg(MsgBase msg)
 {
     if (msg.GetManager() == ManagerID.UIManager)
     {
         //ManagerBase 本模块自己处理
         ProcessEvent(msg);
     }
     else
     {
         MsgCenter.Instance.SendToMsg(msg);
     }
 }
Ejemplo n.º 5
0
        public void SendMsg(MsgBase msg)
        {
            if (msg.GetManager() == (int)ManagerID.AssetManager)
            {
                // Debug.Log("asset manager recv msg ==" +msg.msgId);

                ProcessEvent(msg);
            }
            else
            {
                MsgCenter.instance.SendToMsg(msg);
            }
        }
Ejemplo n.º 6
0
 static int GetManager(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         U3DEventFrame.MsgBase obj = (U3DEventFrame.MsgBase)ToLua.CheckObject(L, 1, typeof(U3DEventFrame.MsgBase));
         int o = obj.GetManager();
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 可以让消息 多少秒内有回调 消息
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="backId"></param>
        public void SendMsg(MsgBase msg, int backId = -1)
        {
            this.ProcessSendBackMsg(backId);

            if (msg.GetManager() == (int)ManagerID.UIManager)
            {
                // 处理 UI 模块的消息

                ProcessEvent(msg);
            }
            else
            {
                // sever
                MsgCenter.instance.SendToMsg(msg);
            }
        }
Ejemplo n.º 8
0
        private void AnasysisMsg(MsgBase tmpBody)
        {
            if (tmpBody == null)
            {
                return;
            }


            //0  3000   6000
            int tmpid = tmpBody.GetManager();
//			Debug.Log("AnasysisMsg  ============="+ tmpBody.msgId);

            //if (tmpid < (int)ManagerID.NetManager)
            //{
            //    //lua
            //   // Debuger.Log("sendmsg  to lua =="+tmpBody.msgId);
            //    LuaEventProcess.instance.ProcessEvent(tmpBody);
            //}
            // else
            // {
            //    switch (tmpid)
            //    {
            //            //16*3000 +2999
            //        case  (ushort)ManagerID.AssetManager:

            //            //  转发给  asset 模块
            //            AssetManager.instance.ProcessEvent(tmpBody);
            //            break;

            //        case (ushort)ManagerID.AudioManager:

            //            //  ITools.Debugger("audio2");
            //            AudioManager.instance.ProcessEvent(tmpBody);
            //            break;

            //        case (ushort)ManagerID.CharatorManager:

            //            //Debug.Log("charactor =="+tmpBody.msgId);
            //            CharaterManager.instance.ProcessEvent(tmpBody);
            //            break;

            //        case (ushort)ManagerID.DataManager:


            //            break;

            //        case (ushort)ManagerID.GameManager:

            //            GameManager.instance.ProcessEvent(tmpBody);
            //            break;

            //        case (ushort)ManagerID.NetManager:

            //            NetManager.instance.ProcessEvent(tmpBody);
            //            break;


            //        case (ushort)ManagerID.NPCManager:
            //            NPCManager.instance.ProcessEvent(tmpBody);
            //            break;

            //        case (ushort)ManagerID.UIManager:


            //            //    Debug.Log("ui is coming");
            //            UIManager.instance.ProcessEvent(tmpBody);
            //            break;

            //        //case ManagerID.LuaManager:


            //        //    //    Debug.Log("ui is coming");
            //        //    LuaEventProcess.instance.ProcessEvent(tmpBody);
            //        //    break;

            //        default:
            //            break;


            //    }
            //}
        }