public void Initialize() { if (SharedConfig.IsOffline) { _sessionState.FullfillExitCondition(typeof(RequestSnapshotSystem)); } }
public void Execute() { if (SharedConfig.IsOffline) { if (!_loginSended) { _loginSended = true; var sessionObjects = _contexts.session.commonSession; IEntityIdGenerator idGenerator = sessionObjects.EntityIdGenerator; var id = idGenerator.GetNextEntityId(); var _offlineSelector = new OfflineSnapshotSelector(new EntityKey(id, (int)EEntityType.Player), _contexts.session.commonSession.GameContexts); _contexts.session.clientSessionObjects.SnapshotSelectorContainer.SnapshotSelector = _offlineSelector; _contexts.session.clientSessionObjects.SimulationTimer.CurrentTime = 0; _contexts.session.entityFactoryObject.SceneObjectEntityFactory = new ServerSceneObjectEntityFactory( _contexts.sceneObject, _contexts.player, sessionObjects.EntityIdGenerator, sessionObjects.EntityIdGenerator, _contexts.session.currentTimeObject); _contexts.session.entityFactoryObject.MapObjectEntityFactory = new ServerMapObjectEntityFactory(_contexts.mapObject, sessionObjects.EntityIdGenerator); IPlayerInfo playerInfo = TestUtility.CreateTestPlayer(); playerInfo.EntityId = id; var player = PlayerEntityFactory.CreateNewPlayerEntity(_contexts.player, SingletonManager.Get <MapsDescription>().SceneParameters.PlayerBirthPosition, playerInfo, true, false); _offlineSelector.Init(); _sessionState.FullfillExitCondition(typeof(RequestPlayerInfoSystem)); SingletonManager.Get <SubProgressBlackBoard>().Step(); } } else { var channel = _contexts.session.clientSessionObjects.NetworkChannel; var token = _contexts.session.clientSessionObjects.LoginToken; if (channel != null && channel.IsConnected) { if (!_loginSended) { _loginSended = true; var message = LoginMessage.Allocate(); message.Token = token; message.LoginStage = ELoginStage.GetPlayerInfo; message.ComponentSerializerVersion = ComponentSerializerManager.HashMd5; channel.SendReliable((int)EClient2ServerMessage.Login, message); _logger.InfoFormat("Sending Login Message {0}", message); message.ReleaseReference(); } if (_loginSuccReceived) { _sessionState.FullfillExitCondition(typeof(RequestPlayerInfoSystem)); SingletonManager.Get <SubProgressBlackBoard>().Step(); } } } }
public void Handle(INetworkChannel networkChannel, int messageType, object messageBody) { _logger.InfoFormat("Handle:{0}", messageBody); switch (messageType) { case (int)EServer2ClientMessage.SceneInfo: LoginSuccMessage msg = (LoginSuccMessage)messageBody; _contexts.session.clientSessionObjects.GameRule = msg.GameRule; _contexts.session.commonSession.RoomInfo.FromLoginSuccMsg(msg); _contexts.session.commonSession.SessionMode = ModeUtil.CreateClientMode(_contexts, _contexts.session.commonSession.RoomInfo.ModeId); _sessionState.FullfillExitCondition(typeof(RequestSceneInfoSystem)); break; } }
public void OnLoadSucc(string source, UnityObject unityObj) { SingletonManager.Get <SubProgressBlackBoard>().Step(); var manager = new InputManager(); if (!_inputContext.hasUserInputManager) { var helper = new UserInputHelper(manager); _inputContext.SetUserInputManager(manager, helper); } { var cfg = unityObj.As <TextAsset>(); if (null != cfg) { var content = cfg.text; var inputCfg = InputConfigLoader <InputConfig> .Load(content); _inputContext.userInputManager.Instance.SetConfig(inputCfg); } else { Logger.Error("Cfg is null or not text asset"); } } _sessionState.FullfillExitCondition(typeof(InputConfigInitSystem)); }
private void CheckExit() { if (_uiCount == 0) { _sessionState.FullfillExitCondition(typeof(UiLoadSystem)); } }
public void Handle(INetworkChannel networkChannel, int messageType, object messageBody) { if (messageType == (int)EServer2ClientMessage.LoginSucc) { LoginSuccMessage msg = (LoginSuccMessage)messageBody; _contexts.session.clientSessionObjects.GameRule = msg.GameRule; _contexts.session.commonSession.RoomInfo.FromLoginSuccMsg(msg); _contexts.session.commonSession.SessionMode = ModeUtil.CreateClientMode(_contexts, _contexts.session.commonSession.RoomInfo.ModeId); //_contexts.session.commonSession.WeaponModeLogic = ClientGameModeLogicFactoryManager.GetModeLogicFactory(_contexts, _contexts.session.commonSession.RoomInfo.ModeId).CreateWeaponModeLogic(); _loginSuccReceived = true; } if (_loginSuccReceived) { _sessionState.FullfillExitCondition(typeof(RequestRoomInfoSystem)); } }
private void ReduceFinishTimes() { if (--_finishedTimes == 0) { LoadTerrainConfig(); LoadSpecialZoneTriggers(); _sessionState.FullfillExitCondition(typeof(SceneConfigInitSystem)); } }
public void OnLoadSucc(string s, UnityObject unityObj) { var assetInfo = unityObj.Address; GameObject go = unityObj.AsGameObject; //UnityEngine.Object.DontDestroyOnLoad(go); I18nStarter.LoadTxt(); _sessionState.FullfillExitCondition(typeof(LocalizeSessionSystem)); }
public void OnLoadResources(IUnityAssetManager assetManager) { RequestForResource(assetManager); if (_levelManager.NotFinishedRequests <= 0) { _levelManager.SetAsapMode(AsapMode); _sessionState.FullfillExitCondition(typeof(InitialSceneLoadingSystem)); } }
private void OnOCDataLoaded(string source, UnityObject unityObj) { var ocData = unityObj.As <TextAsset>(); _ocParam.OCData = ocData == null ? null : ocData.bytes; var ocController = OcclisionCullingControllerFactory.CreateController(_levelType, _ocParam); _contexts.session.clientSessionObjects.OCController = ocController; _sessionState.FullfillExitCondition(typeof(InitOcclusionCullingControllerSystem)); }
public void Execute() { var player = _contexts.player.flagSelfEntity; if (player != null) { if (player.hasThirdPersonModel && player.thirdPersonModel.Value != null && player.hasFirstPersonModel && player.firstPersonModel.Value != null ) { _sessionState.FullfillExitCondition(typeof(CheckPreparingPlayerSystem)); } } }
public void OnLoadResources(ILoadRequestManager loadRequestManager) { if (!_isLoading) { _loadRequestManager = loadRequestManager; var assetInfos = _assetInfoProvider.AssetInfos; foreach (var assetInfo in assetInfos) { loadRequestManager.AppendLoadRequest(null, assetInfo, OnLoadSucc); } _loadingCount = assetInfos.Count; _isLoading = true; if (_loadingCount == 0) { _sessionState.FullfillExitCondition(typeof(PreLoadSystem)); } _logger.InfoFormat("Loading count {0}", _loadingCount); } }
public void OnLoadResources(ILoadRequestManager loadRequestManager) { if (!_isLoding) { _isLoding = true; loadRequestManager.AppendLoadRequest(null, _assetInfo, OnLoadSucc); } if (IsDone && !_isExit) { _sessionState.FullfillExitCondition(GetConditionId()); _isExit = true; Logger.InfoFormat("Exit {0}", GetConditionId()); } }
public void OnLoadResources(IUnityAssetManager assetManager) { if (SingletonManager.Get <T>().IsInitialized) { IsDone = true; } else if (!_isLoding) { _isLoding = true; assetManager.LoadAssetAsync(typeof(T).ToString(), _assetInfo, OnLoadSucc); } if (IsDone && !_isExit) { _sessionState.FullfillExitCondition(GetConditionId()); _isExit = true; Logger.InfoFormat("Exit {0}", GetConditionId()); } }
public void OnLoadResources(IUnityAssetManager assetManager) { _terrainRenderer.GetTerrainDataNames(_terrainName); if (_terrainName.Count > 0) { for (int i = 0; i < _terrainName.Count; ++i) { AssetInfo addr = new AssetInfo("tablesfrombuilding", _terrainName[i]); _logger.InfoFormat("´òËãÔØÈë _terrainName£¬BundleName={0}, AssetName={1}", addr.BundleName, addr.AssetName); assetManager.LoadAssetAsync((UnityEngine.Object)null, addr, _terrainRenderer.LoadedTerrainData); } _terrainName.Clear(); } if (_sessionState != null) { if (_levelManager.NotFinishedRequests <= 0 && _terrainRenderer.IsLoadingEnd) { _sessionState.FullfillExitCondition(typeof(TerrainDataLoadSystem)); } else { if ((System.DateTime.Now - _lastPrintTime).TotalMilliseconds > _logInterval) { _lastPrintTime = System.DateTime.Now; _logger.InfoFormat("NotFinishedRequests =={0}, IsLoadingEnd =={1}", _levelManager.NotFinishedRequests, _terrainRenderer.IsLoadingEnd); _logger.InfoFormat(_levelManager.GetRequestString()); //if (_logInterval < 60000) // _logInterval *= 2; } } } }
public void OnLoadSucc(string source, UnityObject unityObj) { SingletonManager.Get <SubProgressBlackBoard>().Step(); if (!Luminosity.IO.InputManager.Exists) { Logger.ErrorFormat("No Luminosity.IO.InputManager exist"); } else { var cfg = unityObj.As <TextAsset>(); if (null != cfg) { var content = cfg.bytes; Luminosity.IO.InputManager.Load(content); } else { Logger.Error("Cfg is null or not text asset"); } } _sessionState.FullfillExitCondition(typeof(InputManagerConfigInitSystem)); }
public void OnLoadResources(IUnityAssetManager assetManager) { _terrainRenderer.GetTerrainDataNames(_terrainName); if (_terrainName.Count > 0) { for (int i = 0; i < _terrainName.Count; ++i) { AssetInfo addr = new AssetInfo("tablesfrombuilding", _terrainName[i]); assetManager.LoadAssetAsync((UnityEngine.Object)null, addr, _terrainRenderer.LoadedTerrainData); } _terrainName.Clear(); } if (_sessionState != null) { if (_levelManager.NotFinishedRequests <= 0 && _terrainRenderer.IsLoadingEnd) { _sessionState.FullfillExitCondition(typeof(TerrainDataLoadSystem)); } } }
public void OnLoadSucc(object source, AssetInfo assetInfo, Object obj) { var ta = obj as TextAsset; _sessionState.FullfillExitCondition(typeof(ClientWeaponConfigInitSystem)); }
private void AllLoadSucc() { _sessionState.FullfillExitCondition(typeof(GlobalEffectManagerInitSystem)); }
private void ParseComplete() { _sessionState.FullfillExitCondition(typeof(AnimationConfigInitSystem)); }
private void Done() { _sessionState.FullfillExitCondition(ConditionString); SingletonManager.Get <SubProgressBlackBoard>().Step(); }