コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }