public virtual bool IsValidWaitingPacket(WAITING_PACKET type) { if (IsCoopNone()) { return(false); } return(waitingPacketParams[(int)type] != null); }
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 EndWaitingPacket(WAITING_PACKET type) { waitingPacketParams[(int)type] = null; }
public virtual void OnFailedWaitingPacket(WAITING_PACKET type) { EndWaitingPacket(type); }