private void Remove(StoreOne _this) { if (_this.trigger != null) { TeamServerControl.tm.DeleteTrigger(_this.trigger); _this.trigger = null; } _this.mDad.ItemList.Remove(_this.StoreGuid); }
//尝试加入 public void TryPushNewItem(StoreOne newItem) { if (StoreManager.mNewList.Count > 200) { return; } if (newItem.lookCount > 9999) { return; } PushNewItem(newItem); }
//心跳 private void Updata(StoreOne _this) { _this.UpdataCount++; if (_this.UpdataCount >= RemoveCount) { Remove(_this); return; } if (!_this.isNew) { StoreManager.TryPushNewItem(_this); } }
//添加一个道具的广播 public void AddItem(int itemId, int count, int need, ulong cGuid, int level, string name) { var guid = GetNextId(); var sl = GetStoreList(itemId); var temp = new StoreOne(sl) { StoreGuid = guid, ItemId = itemId, Count = count, Need = need, CharacterGuid = cGuid }; sl.ItemList[guid] = temp; PushNewItem(temp); }
public void Construct(StoreOne _this, StoreList d) { _this.trigger = TeamServerControl.tm.CreateTrigger(DateTime.Now.AddSeconds(5), () => Updata(_this), 5000); _this.mDad = d; }
//尝试加入 public static void TryPushNewItem(StoreOne newItem) { mImpl.TryPushNewItem(newItem); }
//添加一个新的内容 private void PushNewItem(StoreOne newItem) { StoreManager.mNewList.Add(newItem); }