public virtual ZeroLagCommand GetTimeoutedCommand(TimeoutCommand timeout) { List <ZeroLagCommand> currTurnCommands; if (!commands.TryGetValue(timeout.targetCommandStep, out currTurnCommands)) { return(null); } ZeroLagCommand targetCommand = currTurnCommands.Find(cmd => cmd.hash == timeout.targetCommandHash); return(targetCommand); }
public void ReceiveTimeout(TimeoutCommand timeout) { List <TimeoutCommand> currStepReceivedTimeouts; int step = getCurrStep(); if (!timeouts.TryGetValue(step, out currStepReceivedTimeouts)) { currStepReceivedTimeouts = new List <TimeoutCommand>(); timeouts.Add(step, currStepReceivedTimeouts); } currStepReceivedTimeouts.Add(timeout); }
private bool TryConsumeTimeout(TimeoutCommand timeout) { ZeroLagCommand targetCommand = playedGameReplay.GetTimeoutedCommand(timeout); if (targetCommand == null) { return(false); } int targetCommandStep = targetCommand.stepInd; lastActualStep = Math.Min(lastActualStep, targetCommandStep); targetCommand.OnTimedout(timeout); playedGameReplay.commands[targetCommandStep].RemoveOne(cmd => cmd.hash == timeout.targetCommandHash); if (timeout.whatToDo == ActionOnTimeout.ExecuteLater) { ReceiveCommand(targetCommand); // Receive command later. } return(true); }
public virtual void ReceiveTimeout(TimeoutCommand timeout) { }
public override ZeroLagCommand GetTimeoutedCommand(TimeoutCommand timeout) { var replay = FlatternToReplay(); return(replay.GetTimeoutedCommand(timeout)); }
public override void ReceiveTimeout(TimeoutCommand timeout) { lock (timeoutsBufferLock) timeoutsThreadBuffer.Add(timeout); }
public override void ReceiveTimeout(TimeoutCommand timeout) { base.ReceiveTimeout(timeout); notConsideredCommands.Add(timeout); }