public virtual void StartWaitingPacket(WAITING_PACKET type, bool keep_sync, float add_margin_time = 0f) { if (!IsCoopNone()) { WaitingPacketParam waitingPacketParam = new WaitingPacketParam(); waitingPacketParam.type = type; waitingPacketParam.startTime = Time.get_time(); waitingPacketParam.keepSync = keep_sync; waitingPacketParam.addMarginTime = add_margin_time; waitingPacketParams[(int)type] = waitingPacketParam; } }
public void KeepWaitingPacket(WAITING_PACKET type) { WaitingPacketParam waitingPacketParam = waitingPacketParams[(int)type]; if (waitingPacketParam != null) { waitingPacketParam.startTime = Time.get_time(); if (packetSender != null) { packetSender.OnKeepWaitingPacket(waitingPacketParam.type); } } }
public virtual void UpdateWaitingPacket() { if (!IsCoopNone()) { int num = 0; int num2 = 14; while (true) { if (num >= num2) { return; } WaitingPacketParam waitingPacketParam = waitingPacketParams[num]; if (waitingPacketParam != null) { if (waitingPacketParam.startTime <= 0f) { break; } if (IsOriginal()) { if (waitingPacketParam.keepSync && Time.get_time() >= waitingPacketParam.startTime + objectParameter.waitingPacketIntervalTime) { KeepWaitingPacket(waitingPacketParam.type); } } else if (IsPuppet() || IsMirror()) { float num3 = objectParameter.waitingPacketMarginTime + waitingPacketParam.addMarginTime; if (waitingPacketParam.keepSync) { num3 += objectParameter.waitingPacketIntervalTime; } if (Time.get_time() > waitingPacketParam.startTime + num3) { OnFailedWaitingPacket(waitingPacketParam.type); } } } num++; } Log.Error("StageObject::UpdateWaitingPacket() Err ( waitingPacketStartTime <= 0.0f )"); } }