/** 每秒调用 */ public override void onSecond(int delay) { IntSet needSendSet = _needSendSet; IntIntMap dic = _lockDic; int fv = dic.getFreeValue(); int[] keys = dic.getKeys(); int[] values = dic.getValues(); int key; for (int i = keys.Length - 1; i >= 0; --i) { if ((key = keys[i]) != fv) { if (values[i] > 0) { if (--values[i] == 0) { if (needSendSet.contains(key)) { needSendSet.remove(key); //是当前页才发送 if (_currentPage == key) { values[i] = Global.pageToolShowCD; sendGet(key); } } } } } } }
/** 每秒调用 */ public override void onSecond(int delay) { _cachePageDataMap.forEachValue(v => { IntSet needSendSet = v.needSendSet; IntIntMap dic = v.lockDic; int fv = dic.getFreeValue(); int[] keys = dic.getKeys(); int[] values = dic.getValues(); int key; for (int i = keys.Length - 1; i >= 0; --i) { if ((key = keys[i]) != fv) { if (values[i] > 0) { if (--values[i] == 0) { if (needSendSet.contains(key)) { needSendSet.remove(key); //是当前页才发送 if (v.currentPage == key) { values[i] = Global.pageToolShowCD; sendGet(v.subsectionIndex, v.subsectionSubIndex, key, v.arg); } } } } } } }); }