Example #1
0
 internal static void Init()
 {
     if (!s_Inited)
     {
         s_MessageHandlers = new JsonMessageHandlerInfo[(int)JsonMessageID.MaxNum];
         for (int i = (int)JsonMessageID.Zero; i < (int)JsonMessageID.MaxNum; ++i)
         {
             s_MessageHandlers[i] = new JsonMessageHandlerInfo();
         }
         s_Inited = true;
     }
 }
Example #2
0
        internal static void HandleDcoreMessage(JsonMessage msg, int handle, uint session)
        {
            if (s_Inited && msg != null)
            {
                //LogSys.Log(LOG_TYPE.DEBUG, "Handle Json Message:{0}={1}", msg.m_ID, msg.GetType().Name);

                JsonMessageHandlerInfo info = s_MessageHandlers[(int)msg.m_ID];
                if (info != null && info.m_Handler != null)
                {
                    info.m_Handler(msg, handle, session);
                }
            }
        }