Example #1
0
 public void Remove(NetCacheOne data)
 {
     if (this.mList.Contains(data))
     {
         this.mList.Remove(data);
         if (this.IsEmpty)
         {
             LocalSave.Instance.mEquip.check_invalid();
         }
         base.Refresh();
     }
 }
Example #2
0
 private void OnUpdate()
 {
     if (this.serveruserid == 0L)
     {
         this.serveruserid = LocalSave.Instance.GetServerUserID();
         NetManager.UpdateNetConnect();
     }
     else if ((this.serveruserid > 0L) && (this.serveruserid != LocalSave.Instance.GetServerUserID()))
     {
         this.Clear();
     }
     else
     {
         if (this.bSendLogin && ((Time.unscaledTime - this.mSendLoginStartTime) > 0.1f))
         {
             if (this.mList.Count == 0)
             {
                 LocalSave.Instance.DoLogin(SendType.eUDP, null);
             }
             this.bSendLogin = false;
         }
         if (!GameLogic.InGame && ((Time.unscaledTime - this.mTime) > 0.1f))
         {
             NetManager.UpdateNetConnect();
             if (NetManager.IsNetConnect && this.bCurrentSendOver)
             {
                 this.mCount = this.mList.Count;
                 if (this.mCount > 0)
                 {
                     this.bCurrentSendOver = false;
                     this.mCurrent         = this.mList[0];
                     this.mList.RemoveAt(0);
                     base.Refresh();
                     NetManager.SendInternal(this.mCurrent, delegate(NetResponse response) {
                         this.bCurrentSendOver = true;
                         if (this.mList.Count == 0)
                         {
                             this.mSendLoginStartTime = Time.unscaledTime;
                             this.bSendLogin          = true;
                         }
                     });
                 }
             }
             this.mTime = Time.unscaledTime;
         }
     }
 }
Example #3
0
 public void Add(NetCacheOne data, bool reduce_count)
 {
     if (data.trycount <= 20)
     {
         if (reduce_count)
         {
             data.trycount++;
         }
         ulong serverUserID = LocalSave.Instance.GetServerUserID();
         if (this.serveruserid != serverUserID)
         {
             this.Clear();
         }
         else
         {
             this.mList.Add(data);
             base.Refresh();
         }
     }
 }