Exemplo n.º 1
0
 public void Add(ResponseHandleData responseHandleData)
 {
     lock (m_works)
     {
         m_works.Enqueue(responseHandleData);
     }
 }
Exemplo n.º 2
0
 public void DO()
 {
     if (IsPaused)
     {
         return;
     }
     if (!IsQueuePrecessing && m_works.Count > 0)
     {
         //TODO:: disable isqueprecessing in publish version!!!!
         //cause it make net message do not work after error occours!!!
         //this.IsQueuePrecessing = true;
         lock (m_works)
         {
             while (m_works.Count > 0)
             {
                 m_currentHandleData = m_works.Dequeue();
                 var returnValue = m_currentHandleData.CommondResponseHandle(m_currentHandleData.DataBuffer, m_currentHandleData.SocketId);
                 #if UNITY_EDITOR && WRITE_NET_MESSAGE
                 Package pg;
                 pg = PackageHelper.ParseReceiveData(m_currentHandleData.DataBuffer);
                 String[] logText = new String[3];
                 logText[0] = "Receive:" + System.DateTime.Now.ToLocalTime().ToString();
                 logText[1] = pg.Head.MasterMsgType.ToString();
                 logText[2] = pg.Head.SubMsgType.ToString();
                 LogManager.Instance.WriteLog("NetResponse", logText);
                 #endif
                 if (returnValue == CommandCallbackType.Pause)
                 {
                     IsPaused = true;
                     break;
                 }
             }
         }
         this.IsQueuePrecessing = false;
     }
 }