コード例 #1
0
 void UpdateMsg()
 {
     if (_webData.MsgQueue.Count > 0)
     {
         string   info = _webData.MsgQueue.Dequeue();
         JSONNode json = JSON.Parse(info);
         NetMsgHandler.SendMsg(json["Type"].ToString().Trim('"'), json["Data"].ToString());
     }
 }
コード例 #2
0
 void GetDevicesListResp(string msg)
 {
     Debug.Log(msg);
     devicesDG.Destroy();
     devicesData         = JSON.Parse(msg);
     devicesDG.MaxLength = devicesData.Count;
     ItemRender[] dgirs = devicesDG.getItemRenders();
     for (int i = 0; i < dgirs.Length; i++)
     {
         dgirs[i].AddItemSetDataFunc((int index) =>
         {
             SetToggleItemDate(dgirs[i].gameObj, devicesData[index]);
         });
         int idx = dgirs[i].m_renderData;
         SetToggleItemDate(dgirs[i].gameObj, devicesData[idx]);
     }
     NetMsgHandler.SendMsg(NetMessageConst.UpdateAllDeviceInfo, devicesData.Count.ToString());
 }
コード例 #3
0
 public static Exception ServerClosedTCPStream()
 {
     NetMsgHandler.SendMsg(NetMessageConst.SocketServerClosed, string.Empty);
     return(new Exception("TCP Stream closed unexpectedly by the remote server"));
 }