public ClientMainFeature(string name, IGameModule topLevelGameModule, SyncLastestManager netSyncManager, PlaybackManager playbackManager, PredictionManager userPredictionManager, AbstractPredictionProvider predicatoinProvider, ISimulationTimer simulationTimer, IVehicleCmdExecuteSystemHandler vehicleCmdExecuteSystemHandler, IVehicleExecutionSelector vehicleExecutionSelector, ICommonSessionObjects commonSessionObjects) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, commonSessionObjects.AssetManager)); Add(new EntityCreateSystem(topLevelGameModule)); Add(new SyncLatestSystem(netSyncManager)); if (!SharedConfig.IsOffline) { Add(new PlaybackInitSystem(playbackManager)); } Add(new PlaybackExcuteSystem(topLevelGameModule)); //添加游戏状态更新处理 Add(new GameStateUpdateSystem(topLevelGameModule)); // 需要在playback之后,因为要根据车的位置更新人的位置 // 要在predicte之前,因为要根据车的位置,更像摄像机位置 Add(new PhysicsInitSystem(topLevelGameModule)); Add(new PhysicsUpdateSystem(topLevelGameModule)); Add(new VehicleCmdExecuteManagerSystem(vehicleExecutionSelector, topLevelGameModule, vehicleCmdExecuteSystemHandler, simulationTimer, false, SharedConfig.ServerAuthorative)); Add(new PhysicsPostUpdateSystem(topLevelGameModule)); Add(new PredictionCompareSystem(userPredictionManager)); Add(new UserPredictionSystem(topLevelGameModule, predicatoinProvider, userPredictionManager)); Add(new ResourceLoadSystem(topLevelGameModule, commonSessionObjects.AssetManager)); Add(new GamePlaySystem(topLevelGameModule)); Add(new RenderSystem(topLevelGameModule)); Add(new UiSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.UIFrameStep)); Add(new UiHfrSystem(topLevelGameModule)); Add(new CommonLifeTimeSystem(commonSessionObjects.GameContexts)); Add(new CommoTickImmutabblitySystem(commonSessionObjects.GameContexts)); Add(new EntityCleanUpSystem(topLevelGameModule)); Add(new CommonDestroySystem(commonSessionObjects)); }
// private PlayerStateCollectorPool gameStateProcessorFactory; // private IStateProviderPool stateProviderPool; // private IPlayerStateMap playerStateMap; public UserPredictionSystem(IGameModule gameModule, AbstractPredictionProvider provider, PredictionManager predictionManager) { logger.Info("start"); this.provider = provider; this.predictionManager = predictionManager; systems = gameModule.UserCmdExecuteSystems; // gameStateProcessorFactory = gameStateProcessorFactory; // stateProviderPool = gameStateProcessorFactory.GetProviderPool(); // playerStateMap = gameStateProcessorFactory.GetStatePool(); Init(); }