Beispiel #1
0
 public void HandleJsonMessage(JsonMessage msg)
 {
     if (s_Inited && msg != null)
     {
         JsonMessageHandlerInfo info = s_MessageHandlers[(int)msg.m_ID];
         if (info != null && info.m_Handler != null)
         {
             info.m_Handler(msg);
         }
     }
 }
Beispiel #2
0
 public void Init()
 {
     if (!s_Inited)
     {
         s_MessageHandlers = new JsonMessageHandlerInfo[(int)LCJsonMessageID.MaxNum];
         for (int i = (int)LCJsonMessageID.Zero; i < (int)LCJsonMessageID.MaxNum; ++i)
         {
             s_MessageHandlers[i] = new JsonMessageHandlerInfo();
         }
         s_Inited = true;
     }
 }