Ejemplo n.º 1
0
        public override Systems CreateUpdateSystems(IContexts contexts)
        {
            if (Camera.main == null)
            {
                throw new Exception("Camera.main is null");
            }
            Contexts _contexts = (Contexts)contexts;

            _gameModule = GameModuleFactory.CreateCompositeGameModule(_contexts);
            var sessionObjects = _contexts.session.clientSessionObjects;

            ISyncLatestManager     syncLatestManager     = sessionObjects.SyncLatestManager;
            IPlaybackManager       playbackManager       = sessionObjects.PlaybackManager;
            IPredictionInitManager predictionInitManager = sessionObjects.UserPredictionInitManager;

            IUserPredictionInfoProvider predicatoinInfoProvider = sessionObjects.UserPredictionInfoProvider;
            ISimulationTimer            simulationTimer         = sessionObjects.SimulationTimer;

            var systems = new Feature("LoginSuccState");

            systems.Add(new InputCollectSystem(_contexts).WithExecFrameStep(EEcecuteStep.NormalFrameStep));
            systems.Add(new MouseLockSystem(_contexts));
            systems.Add(new DriveTimeSystem(_contexts).WithExecFrameStep(EEcecuteStep.NormalFrameStep));
            systems.Add(new ClientFreeCmdGenerateSystem(_contexts).WithExecFrameStep(EEcecuteStep.NormalFrameStep));
            systems.Add(new UserCmdCollectSystem(_contexts).WithExecFrameStep(EEcecuteStep.NormalFrameStep));
            //  systems.Add(new ClientCameraPreUpdateSystem(_contexts.vehicle, _contexts.freeMove,_contexts.player, motors).WithExecFrameStep(EEcecuteStep.NormalFrameStep));
            systems.Add(new PlayerInterceptCmdSystem(_contexts).WithExecFrameStep(EEcecuteStep.NormalFrameStep));
            systems.Add(new UserCmdMergeSystem(_contexts).WithExecFrameStep(EEcecuteStep.CmdFrameStep));

            //Test
            systems.Add(new TerrainTestSystem(_contexts));
            //////
            systems.Add(new AutoTerrainNavigatorSystem(_contexts));
            systems.Add(new MinRendererSetSystem(_contexts));
            systems.Add(new WoodConflictSystem(_contexts));
            systems.Add(new ClientMainFeature(
                            "LoginSuccSystems",
                            _gameModule,
                            syncLatestManager,
                            playbackManager,
                            predictionInitManager,
                            predicatoinInfoProvider,
                            simulationTimer,
                            sessionObjects.VehicleCmdExecuteSystemHandler,
                            new ClientVehicleExecutionSelector(_contexts),
                            _contexts.session.commonSession));
            /*车辆命令走老流程*/
            systems.Add(new UserCmdSendSystem(_contexts).WithExecFrameStep(EEcecuteStep.CmdFrameStep));
            /*用户的命令*/
            systems.Add(new UserCmdUpdateSystem(_contexts).WithExecFrameStep(EEcecuteStep.CmdFrameStep));
            return(systems);
        }
Ejemplo n.º 2
0
        public override Systems CreateUpdateSystems(IContexts contexts)
        {
            if (Camera.main == null)
            {
                throw new Exception("Camera.main is null");
            }
            Contexts _contexts = (Contexts)contexts;

            _gameModule = GameModuleFactory.CreateCompositeGameModule(_contexts);
            var sessionObjects = _contexts.session.clientSessionObjects;

            SyncLastestManager netSyncManager  = sessionObjects.NetSyncManager;
            PlaybackManager    playbackManager = sessionObjects.PlaybackManager;
            var predictionManager            = sessionObjects.UserPredictionManager;
            var predicatoinProvider          = sessionObjects.UserPredictionProvider;
            ISimulationTimer simulationTimer = sessionObjects.SimulationTimer;

            var systems = new Feature("LoginSuccState");

            systems.Add(new DriveTimeSystem(_contexts));
            systems.Add(new PrepareSnapshotPairSystem(_contexts));
            systems.Add(new ClientUserCmdFeature("UserCmd", _contexts));
            systems.Add(new ClientProfileFeature("Profile", _contexts));
            if (SharedConfig.IsReplay)
            {
                systems.Add(new UserCmdReplaySystem(_contexts));
                systems.Add(new PrepareSnapshotPairSystem(_contexts));
            }
            systems.Add(new ClientMainFeature(
                            "LoginSuccSystems",
                            _gameModule,
                            netSyncManager,
                            playbackManager,
                            predictionManager,
                            predicatoinProvider,
                            simulationTimer,
                            sessionObjects.VehicleCmdExecuteSystemHandler,
                            new ClientVehicleExecutionSelector(_contexts),
                            _contexts.session.commonSession));
            /*车辆命令走老流程*/
            systems.Add(new UserCmdSendSystem(_contexts).WithExecFrameStep(EEcecuteStep.CmdFrameStep));
            /*用户的命令*/
            systems.Add(new UserCmdUpdateSystem(_contexts).WithExecFrameStep(EEcecuteStep.CmdFrameStep));
            return(systems);
        }