private void DropLagPlayers() { List <TSPlayer> list = new List <TSPlayer>(); int refTick = this.GetRefTick(this.GetSyncedDataTick()); bool flag = refTick >= 0; if (flag) { int i = 0; int count = this.activePlayers.Count; while (i < count) { TSPlayer tSPlayer = this.activePlayers[i]; bool flag2 = !tSPlayer.IsDataReady(refTick); if (flag2) { tSPlayer.dropCount++; list.Add(tSPlayer); } i++; } } int j = 0; int count2 = list.Count; while (j < count2) { TSPlayer p = list[j]; this.CheckDrop(p); bool sendDataForDrop = list[j].GetSendDataForDrop(this.localPlayer.ID, this._syncedDataCacheDrop); if (sendDataForDrop) { // 199 this.communicator.OpRaiseEvent(SEND_CODE, SyncedData.Encode(this._syncedDataCacheDrop), true, null); SyncedData.pool.GiveBack(this._syncedDataCacheDrop[0]); } j++; } }
/// <summary> /// Lag:落后, 延迟 /// </summary> private void DropLagPlayers() { Debug.Log("DropLagPlayers"); List <TSPlayer> list = new List <TSPlayer>(); int refTick = GetRefTick(GetSyncedDataTick()); if (refTick >= 0) { int i = 0; int count = activePlayers.Count; while (i < count) { TSPlayer tSPlayer = activePlayers[i]; if (!tSPlayer.IsDataReady(refTick)) { tSPlayer.dropCount++; list.Add(tSPlayer); } i++; } } int j = 0; int count2 = list.Count; while (j < count2) { TSPlayer p = list[j]; CheckDrop(p); bool sendDataForDrop = list[j].GetSendDataForDrop(localPlayer.ID, _syncedDataCacheDrop); if (sendDataForDrop) { communicator.OpRaiseEvent(SEND_CODE, SyncedData.Encode(_syncedDataCacheDrop), true, null); SyncedData.pool.GiveBack(_syncedDataCacheDrop[0]); } j++; } }