public override Systems CreateUpdateSystems(IContexts contexts1) { var gameModule = new CompositeGameModule(); var contexts = contexts1 as Contexts; var loadSceneSystem = new InitialSceneLoadingSystem(this, contexts, null, true); loadSceneSystem.AsapMode = true; gameModule.AddSystem(loadSceneSystem); gameModule.AddSystem(new InitTriggerObjectManagerSystem(contexts)); gameModule.AddSystem(new ServerScenePostprocessorSystem(contexts.session.commonSession)); //gameModule.AddModule(new ResourcePreloadModule(this)); var featrue = new ServerPrepareFeature("loadMapConfig", gameModule, contexts.session.commonSession.AssetManager); featrue.Add(new MapConfigInitModule(contexts, this)); if (contexts.session.commonSession.RoomInfo.MapId == 2) { contexts.session.commonSession.InitPosition = new Vector3(1906, 20, -1964); } else { contexts.session.commonSession.InitPosition = Vector3.zero; } return(featrue); }
public static CompositeGameModule CreatePreparePlayerGameModule(Contexts contexts) { var gameModule = new CompositeGameModule(); gameModule.AddModule(new ClientPlayerModule(contexts)); return(gameModule); }
private IGameModule CreateSystems(Contexts contexts) { var module = new CompositeGameModule(); module.AddModule(new UiLoadModule(this, contexts)); return(module); }
public override Systems CreateUpdateSystems(IContexts contexts1) { var contexts = contexts1 as Contexts; var sessionObjects = contexts.session.commonSession; var entityIdGenerator = sessionObjects.EntityIdGenerator; _gameModule = new CompositeGameModule(); _gameModule.AddModule(new ServerPlayerModule(contexts)); _gameModule.AddModule(new ServerEntityInitModule(contexts)); _gameModule.AddModule(new ServerBulletModule(contexts)); IHitBoxEntityManager hitBoxEntityManager = new HitBoxEntityManager(contexts, true); var snapshotSelectorContainer = contexts.session.serverSessionObjects.CompensationSnapshotSelector; ICompensationWorldFactory factory = new ServerCompensationWorldFactory(snapshotSelectorContainer, hitBoxEntityManager); var serverDamageInfoCollector = new ServerDamageInfoCollector(contexts.player); _gameModule.AddModule(new UserCmdGameModule(contexts, factory, new BulletHitHandler(contexts, entityIdGenerator, room.PlayerDamager, serverDamageInfoCollector, contexts.session.entityFactoryObject.SoundEntityFactory, SingletonManager.Get <EnvironmentTypeConfigManager>()), new MeleeHitHandler(contexts, room.PlayerDamager, entityIdGenerator, serverDamageInfoCollector, contexts.session.entityFactoryObject.SoundEntityFactory), new ThrowingHitHandler(contexts, room.PlayerDamager), sessionObjects, MotorsFactory.CraeteMotors(contexts, SingletonManager.Get <CameraConfigManager>().Config))); _gameModule.AddModule(new ServerPostPredictionModule(contexts)); _gameModule.AddModule(new ServerVehicleModule(contexts, contexts.session.serverSessionObjects.VehicleTimer)); _gameModule.AddModule(new ServerGamePlayModule(contexts, room)); _gameModule.AddModule( new ServerSceneObjectModule(contexts, this, sessionObjects.EquipmentEntityIdGenerator)); IUserCmdExecuteSystemHandler userCmdExecuteSystemHandler = new UserCmdExecuteSystemHandler(contexts); IVehicleCmdExecuteSystemHandler vehicleCmdExecuteSystemHandler = new ServerVehicleCmdExecuteSystemHandler(contexts); var systems = new Feature("GameSessionState"); systems.Add(new PingSystem(contexts)); systems.Add(new ServerMainFeature( "ServerSystems", _gameModule, userCmdExecuteSystemHandler, vehicleCmdExecuteSystemHandler, contexts.session.serverSessionObjects.SimulationTimer, new VehicleExecutionSelector(contexts), sessionObjects, room)); return(systems); }
private CompositeGameModule CreateCompositeGameModule(Contexts contexts) { var gameModule = new CompositeGameModule(); gameModule.AddSystem(new InitOcclusionCullingControllerSystem(this, contexts)); return(gameModule); }
private CompositeGameModule CreateCompositeGameModule(Contexts contexts) { var gameModule = new CompositeGameModule(); gameModule.AddModule(new ClientInitModule(contexts, this)); return(gameModule); }
public static CompositeGameModule CreateCompositeGameModule(Contexts contexts) { var motors = MotorsFactory.CraeteMotors(contexts, SingletonManager.Get <CameraConfigManager>().Config); var sessionObjects = contexts.session.commonSession; var gameModule = new CompositeGameModule(); IHitBoxEntityManager hitBoxEntityManager = new HitBoxEntityManager(contexts, false); ICompensationWorldFactory factory = new ClientCompensationWorldFactory(contexts.session.commonSession.GameContexts, hitBoxEntityManager); GameModule cmdModule = new UserCmdGameModule(contexts, factory, new BulletHitHandler(contexts, sessionObjects.EntityIdGenerator, null), new MeleeHitHandler(null), new ThrowingHitHandler(null), contexts.session.commonSession, motors); // cmdModule.AddSystem(new PlayerAddMarkSystem(contexts)); cmdModule.AddSystem(new PlayerSprayPaintSystem(contexts)); gameModule.AddModule(cmdModule); gameModule.AddModule(new BulletModule(contexts)); gameModule.AddModule(new ThrowingModule(contexts)); gameModule.AddModule(new ClientEffectModule(contexts)); gameModule.AddModule(new ClientVehicleModule(contexts)); gameModule.AddModule(new ClientPlayerModule(contexts)); gameModule.AddModule(new ClientSoundModule(contexts)); if (SharedConfig.IsRobot) { gameModule.AddModule(new ClientRobotModule(contexts)); } gameModule.AddSystem(new VisionCenterUpdateSystem(contexts)); gameModule.AddSystem(new TerrainDataLoadSystem(contexts)); if (SingletonManager.Get <MapConfigManager>().SceneParameters is SceneConfig || SingletonManager.Get <MapConfigManager>().SceneParameters.Id == 0) { gameModule.AddSystem(new ClientAutoWorldShiftRenderSystem(contexts)); } //gameModule.AddSystem(new OcclusionCullingSystem(contexts)); gameModule.AddModule(new ClientSceneObjectModule(contexts, sessionObjects)); // gameModule.AddModule(new ClientSoundModule(contexts)); gameModule.AddModule(new ClientGamePlayModule(contexts)); gameModule.AddModule(new ClientFreeMoveModule(contexts)); gameModule.AddModule(new UiModule(contexts)); gameModule.AddModule(new ConfigurationRefreshModule(contexts)); SingletonManager.Get <FreeUiManager>().Contexts1 = contexts; SimpleMessageManager.Instance.Init(contexts.session.entityFactoryObject.SoundEntityFactory); return(gameModule); }
public override Systems CreateUpdateSystems(IContexts contexts1) { var gameModule = new CompositeGameModule(); var contexts = contexts1 as Contexts; gameModule.AddModule(new ServerInitModule(contexts, this)); gameModule.AddModule(new SubResourceConfigurationInitModule(this)); var featrue = new ServerPrepareFeature("loadSubResourceConfig", gameModule, contexts.session.commonSession.AssetManager); return(featrue); }
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); }
public static CompositeGameModule CreateRobotCompositeGameModule(Contexts contexts) { var motors = MotorsFactory.CraeteMotors(contexts, SingletonManager.Get <CameraConfigManager>().Config); var sessionObjects = contexts.session.commonSession; var gameModule = new CompositeGameModule(); IHitBoxEntityManager hitBoxEntityManager = new HitBoxEntityManager(contexts, false); ICompensationWorldFactory factory = new ClientCompensationWorldFactory(contexts.session.commonSession.GameContexts, hitBoxEntityManager); GameModule cmdModule = new UserCmdGameModule(contexts, factory, new BulletHitHandler(contexts, sessionObjects.EntityIdGenerator, null), new MeleeHitHandler(null), new ThrowingHitHandler(null), contexts.session.commonSession, motors); // cmdModule.AddSystem(new PlayerAddMarkSystem(contexts)); gameModule.AddModule(cmdModule); // gameModule.AddModule(new BulletModule(contexts)); // gameModule.AddModule(new ThrowingModule(contexts)); // gameModule.AddModule(new ClientEffectModule(contexts)); // gameModule.AddModule(new ClientVehicleModule(contexts)); // gameModule.AddModule(new ClientPlayerModule(contexts)); if (SharedConfig.IsRobot) { gameModule.AddModule(new ClientRobotModule(contexts)); } // gameModule.AddModule(new ClientSceneObjectModule(contexts, sessionObjects)); // gameModule.AddModule(new ClientSoundModule(contexts)); gameModule.AddModule(new ClientGamePlayModule(contexts)); gameModule.AddModule(new ClientFreeMoveModule(contexts)); gameModule.AddModule(new ConfigurationRefreshModule(contexts)); SimpleProto loginSucess = FreePool.Allocate(); loginSucess.Key = FreeMessageConstant.ClientLoginSucess; if (contexts.session.clientSessionObjects.NetworkChannel != null) { contexts.session.clientSessionObjects.NetworkChannel.SendReliable((int)EClient2ServerMessage.FreeEvent, loginSucess); } SingletonManager.Get <FreeUiManager>().Contexts1 = contexts; SimpleMessageManager.Instance.Init(contexts.session.entityFactoryObject.SoundEntityFactory); return(gameModule); }
public override Systems CreateUpdateSystems(IContexts contexts) { Contexts _contexts = (Contexts)contexts; //SingletonManager.Get<MapConfigManager>().SetCurrentMap(_contexts.session.clientSessionObjects.MapId); _gameModule = CreateCompositeGameModule(_contexts); var systems = new Entitas.Systems(); systems.Add(new ClientPreLoginFeature( "PreLoginState", _gameModule, _contexts.session.commonSession )); return(systems); }
public override Systems CreateUpdateSystems(IContexts contexts1) { var gameModule = new CompositeGameModule(); var contexts = contexts1 as Contexts; var loadSceneSystem = new InitialSceneLoadingSystem(this, contexts, null, true); loadSceneSystem.AsapMode = true; gameModule.AddSystem(loadSceneSystem); gameModule.AddSystem(new InitTriggerObjectManagerSystem(contexts)); gameModule.AddSystem(new ServerScenePostprocessorSystem(contexts.session.commonSession)); //gameModule.AddModule(new ResourcePreloadModule(this)); var featrue = new ServerPrepareFeature("loadMapConfig", gameModule, contexts.session.commonSession); return(featrue); }
public override Systems CreateUpdateSystems(IContexts contexts1) { var contexts = contexts1 as Contexts; var sessionObjects = contexts.session.commonSession; var entityIdGenerator = sessionObjects.EntityIdGenerator; _gameModule = new CompositeGameModule(); _gameModule.AddModule(new ServerPlayerModule(contexts)); //if (GameRules.IsChicken(contexts.session.commonSession.RoomInfo.ModeId)) //{ _gameModule.AddModule(new ServerEntityInitModule(contexts)); //} IHitBoxEntityManager hitBoxEntityManager = new HitBoxEntityManager(contexts, true); var SnapshotSelector = contexts.session.serverSessionObjects.SnapshotSelector; ICompensationWorldFactory factory = new ServerCompensationWorldFactory(SnapshotSelector, hitBoxEntityManager); _gameModule.AddModule(new UserCmdGameModule(contexts, factory, new BulletHitHandler(contexts, entityIdGenerator, room.PlayerDamager), new MeleeHitHandler(room.PlayerDamager), new ThrowingHitHandler(room.PlayerDamager), sessionObjects, MotorsFactory.CraeteMotors(contexts, SingletonManager.Get <CameraConfigManager>().Config))); _gameModule.AddModule(new ServerPostPredictionModule(contexts)); _gameModule.AddModule(new ServerVehicleModule(contexts, contexts.session.serverSessionObjects.VehicleTimer)); _gameModule.AddModule(new ServerGamePlayModule(contexts, room)); _gameModule.AddModule( new ServerSceneObjectModule(contexts, this, sessionObjects.EquipmentEntityIdGenerator)); IServerUserCmdList serrverServerUserCmdList = new ServerServerUserCmdList(contexts); IVehicleCmdExecuteSystemHandler vehicleCmdExecuteSystemHandler = new ServerVehicleCmdExecuteSystemHandler(contexts); var systems = new Feature("GameSessionState"); systems.Add(new PingSystem(contexts)); systems.Add(new ServerMainFeature("ServerSystems", _gameModule, serrverServerUserCmdList, vehicleCmdExecuteSystemHandler, contexts.session.serverSessionObjects.SimulationTimer, new VehicleExecutionSelector(contexts), sessionObjects, room)); return(systems); }
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); }
public override Systems CreateUpdateSystems(IContexts contexts) { Contexts _contexts = (Contexts)contexts; //SingletonManager.Get<MapConfigManager>().SetCurrentMap(_contexts.session.clientSessionObjects.MapId); _gameModule = CreateCompositeGameModule(_contexts); var systems = new Entitas.Systems(); systems.Add(new LocalizeSessionSystem(this, _contexts.session.commonSession.AssetManager)); systems.Add(new BaseConfigurationInitModule(this, _contexts.session.commonSession.AssetManager)); systems.Add(new ClientPreLoginFeature( "BasePreparing", _gameModule, _contexts.session.commonSession )); return(systems); }
public override Systems CreateUpdateSystems(IContexts contexts) { var ctx = (Contexts)contexts; var systems = new Feature("ProfileState"); ctx.player.flagSelfEntity.cameraObj.MainCamera = Camera.main; ctx.player.flagSelfEntity.cameraObj.MainCamera.transform.position = ctx.player.flagSelfEntity.position.Value; CompositeGameModule module = new CompositeGameModule(); module.AddSystem(new VisionCenterUpdateSystem(ctx)); module.AddSystem(new TerrainDataLoadSystem(ctx)); systems.Add(new AutoTerrainNavigatorSystem((Contexts)contexts)); systems.Add(new ProfileFeature(module, ctx.session.commonSession)); return(systems); }
private CompositeGameModule CreateCompositeGameModule(Contexts contexts) { var gameModule = new CompositeGameModule(); var loadSceneSystem = new InitialSceneLoadingSystem(this, contexts, new StreamingGoByDistance(), _isServer); loadSceneSystem.AsapMode = _loadSceneAsap; gameModule.AddSystem(loadSceneSystem); gameModule.AddSystem(new InitTriggerObjectManagerSystem(contexts)); gameModule.AddSystem(new GameObjectRecordSystem(contexts)); gameModule.AddSystem(new ClientScenePostprocessorSystem(contexts.session.commonSession)); gameModule.AddSystem(new TerrainRendererInitSystem(contexts.session.commonSession, contexts.session.clientSessionObjects)); gameModule.AddSystem(new ClientWorldShiftPostProcessSystem(contexts.session.commonSession)); gameModule.AddSystem(new TerrainDataLoadSystem(this, contexts)); return(gameModule); }