public ClientMainFeature(string name, IGameModule topLevelGameModule, ISyncLatestManager syncLatestManager, IPlaybackManager playbackManager, IPredictionInitManager userPredictionInitManager, IUserPredictionInfoProvider predicatoinInfoProvider, ISimulationTimer simulationTimer, IVehicleCmdExecuteSystemHandler vehicleCmdExecuteSystemHandler, IVehicleExecutionSelector vehicleExecutionSelector, ICommonSessionObjects commonSessionObjects) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, commonSessionObjects.AssetManager)); Add(new EntityCreateSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); Add(new SyncLatestSystem(syncLatestManager).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); if (!SharedConfig.IsOffline) { Add(new PlaybackInitSystem(playbackManager).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); } Add(new PlaybackSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); //添加游戏状态更新处理 Add(new GameStateUpdateSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); // 需要在playback之后,因为要根据车的位置更新人的位置 // 要在predicte之前,因为要根据车的位置,更像摄像机位置 Add(new PhysicsInitSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.CmdFrameStep)); Add(new PhysicsUpdateSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.CmdFrameStep)); Add(new VehicleCmdExecuteManagerSystem(vehicleExecutionSelector, topLevelGameModule, vehicleCmdExecuteSystemHandler, simulationTimer, false, SharedConfig.ServerAuthorative).WithExecFrameStep(EEcecuteStep.CmdFrameStep)); Add(new UserPrePredictionSystem(topLevelGameModule, predicatoinInfoProvider, userPredictionInitManager).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); //每帧执行的cmd要放在回滚之前,不然会导致多执行帧 Add(new PhysicsPostUpdateSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.CmdFrameStep)); Add(new PredictionInitSystem(userPredictionInitManager).WithExecFrameStep(EEcecuteStep.CmdFrameStep)); Add(new UserPredictionSystem(topLevelGameModule, predicatoinInfoProvider, userPredictionInitManager).WithExecFrameStep(EEcecuteStep.CmdFrameStep)); Add(new ResourceLoadSystem(topLevelGameModule, commonSessionObjects.AssetManager).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); Add(new GamePlaySystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.CmdFrameStep)); Add(new RenderSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); Add(new UiSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.UIFrameStep)); Add(new UiHfrSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); Add(new CommonLifeTimeSystem(commonSessionObjects.GameContexts).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); Add(new CommoTickImmutabblitySystem(commonSessionObjects.GameContexts).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); Add(new EntityCleanUpSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); Add(new CommonDestroySystem(commonSessionObjects).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); }
public SceneResourceLoadingFeature(string name, IGameModule topLevelGameModule, ICommonSessionObjects commonSessionObjects) : base(name) { topLevelGameModule.Init(); Add(new ResourceLoadSystem(topLevelGameModule, commonSessionObjects.AssetManager)); }
public ProfileFeature(IGameModule topLevelGameModule, ICommonSessionObjects commonSessionObjects) { topLevelGameModule.Init(); Add(new RenderSystem(topLevelGameModule).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); Add(new ResourceLoadSystem(topLevelGameModule, commonSessionObjects.AssetManager).WithExecFrameStep(EEcecuteStep.NormalFrameStep)); }
public ProfilePreparationFeature(string name, IGameModule topLevelGameModule, ICommonSessionObjects commonSessionObjects) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, commonSessionObjects.AssetManager)); }
public ServerPrepareFeature(string name, IGameModule topLevelGameModule, IUnityAssetManager assetManager) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, assetManager)); Add(new EntityCreateSystem(topLevelGameModule)); Add(new ResourceLoadSystem(topLevelGameModule, assetManager)); }
public PreloadFeature(string name, IGameModule topLevelGameModule, ICommonSessionObjects commonSessionObjects) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, commonSessionObjects.AssetManager)); Add(new UnityAssetManangerSystem(commonSessionObjects)); Add(new ResourceLoadSystem(topLevelGameModule, commonSessionObjects.AssetManager)); }
public ServerPrepareFeature( string name, IGameModule topLevelGameModule, ICommonSessionObjects commonSessionObjects) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, commonSessionObjects.LoadRequestManager)); Add(new EntityCreateSystem(topLevelGameModule)); Add(new LoadRequestManagerSystem(commonSessionObjects)); Add(new ResourceLoadSystem(topLevelGameModule, commonSessionObjects.LoadRequestManager)); }
public ClientPreparePlayerMainFeature(string name, IGameModule topLevelGameModule, ICommonSessionObjects commonSessionObjects) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, commonSessionObjects.AssetManager)); Add(new EntityCreateSystem(topLevelGameModule)); Add(new ResourceLoadSystem(topLevelGameModule, commonSessionObjects.AssetManager)); Add(new EntityCleanUpSystem(topLevelGameModule)); Add(new CommonDestroySystem(commonSessionObjects)); }
public ServerMainFeature( string name, IGameModule topLevelGameModule, IUserCmdExecuteSystemHandler userCmdExecuteSystemHandler, IVehicleCmdExecuteSystemHandler vehicleCmdExecuteSystemHandler, ISimulationTimer simluationTimer, IVehicleExecutionSelector vehicleExecutionSelector, ICommonSessionObjects sessionObjects, IRoom room) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, sessionObjects.LoadRequestManager)); Add(new EntityCreateSystem(topLevelGameModule)); Add(new GameStateUpdateSystem(topLevelGameModule)); Add(new PhysicsInitSystem(topLevelGameModule)); Add(new PhysicsUpdateSystem(topLevelGameModule)); Add(new VehicleCmdExecuteManagerSystem(vehicleExecutionSelector, topLevelGameModule, vehicleCmdExecuteSystemHandler, simluationTimer, true, SharedConfig.ServerAuthorative)); Add(new PhysicsPostUpdateSystem(topLevelGameModule)); #if (true) // Add(new UserCmdExecuteManagerSystem(topLevelGameModule, // userCmdExecuteSystemHandler, // sessionObjects.GameStateProcessorFactory)); Add(new UserCmdUpdateMsgExecuteManagerSystem(topLevelGameModule, userCmdExecuteSystemHandler, new SyncUpdateLatestMsgHandler())); #else Add(new UserCmdParallelExecuteManagerSystem(topLevelGameModule, userCmdExecuteSystemHandler, sessionObjects.GameStateProcessorFactory, 4)); #endif Add(new LoadRequestManagerSystem(sessionObjects)); Add(new ResourceLoadSystem(topLevelGameModule, sessionObjects.LoadRequestManager)); Add(new GamePlaySystem(topLevelGameModule)); Add(new CommonLifeTimeSystem(sessionObjects.GameContexts)); Add(new EntityCleanUpSystem(topLevelGameModule)); Add(new CommonDestroySystem(sessionObjects)); Add(new FreeGameRuleSystem(room)); Add(new SendSnapshotSystem(room)); Add(new CompensationSnapshotSystem(room)); }
public ClientPreLoginFeature( string name, IGameModule topLevelGameModule, ICommonSessionObjects sessionObjects) : base(name) { topLevelGameModule.Init(); Add(new ModuleInitSystem(topLevelGameModule, sessionObjects.AssetManager)); Add(new EntityCreateSystem(topLevelGameModule)); Add(new UnityAssetManangerSystem(sessionObjects)); Add(new ResourceLoadSystem(topLevelGameModule, sessionObjects.AssetManager)); Add(new RenderSystem(topLevelGameModule)); Add(new CommonLifeTimeSystem(sessionObjects.GameContexts)); Add(new EntityCleanUpSystem(topLevelGameModule)); Add(new CommonDestroySystem(sessionObjects)); }