public void HandleFullStateMessage(MsgFullState message) { if (!GameStates.ContainsKey(message.State.Sequence)) { AckGameState(message.State.Sequence); message.State.GameTime = 0;//(float)timing.CurTime.TotalSeconds; ApplyGameState(message.State); } }
public void HandleStateUpdateMessage(MsgStateUpdate message) { GameStateDelta delta = message.StateDelta; if (GameStates.ContainsKey(delta.FromSequence)) { AckGameState(delta.Sequence); GameState fromState = GameStates[delta.FromSequence]; GameState newState = fromState + delta; newState.GameTime = (float)timing.CurTime.TotalSeconds; ApplyGameState(newState); CullOldStates(delta.FromSequence); } }