Ejemplo n.º 1
0
        public void ExecuteUserCmd(IUserCmdOwner owner, IUserCmd cmd)
        {
            PlayerEntity player = (PlayerEntity)owner.OwnerEntity;

            var playerSkyMove = player.playerSkyMove;

            SynFromInterVar(player);
            playerSkyMove.IsMoveEnabled = PlayerSkyMoveState.IsSkyMoveEnabled(player);

            if (playerSkyMove.IsMoveEnabled)
            {
                //var stage = playerSkyMove.MoveStage;
                var stage = playerSkyMove.MoveStage;
                //Logger.InfoFormat("ServerUpdate move enabled!!!playerSkyMove stage:{0}, game state:{1}, seq:{2}",stage, player.gamePlay.GameState, cmd.Seq);
                PlayerSkyMoveStateMachine.GetStates()[(int)stage].ServerUpdate(_contexts, player, cmd);
            }
        }
        public void ExecuteUserCmd(IPlayerUserCmdGetter getter, IUserCmd cmd)
        {
            PlayerEntity player = (PlayerEntity)getter.OwnerEntity;

            var playerSkyMove = player.playerSkyMove;

            SynToInterVar(player);
            playerSkyMove.IsMoveEnabled = PlayerSkyMoveState.IsSkyMoveEnabled(player);
            //Logger.InfoFormat("client move enabled!!!playerSkyMove stage:{0}, game state:{1}, seq:{2}",playerSkyMove.MoveStage, player.gamePlay.GameState, cmd.Seq);

            if (playerSkyMove.IsMoveEnabled)
            {
                var stage = playerSkyMove.MoveStage;
                PlayerSkyMoveStateMachine.GetStates()[(int)stage].Update(_contexts, player, cmd);
            }

            PlayerSkyMoveState.ValidateStateAfterUpdate(_contexts, player);
        }