| | |
| | | toMapId = 1,
|
| | | toLineId = 0,
|
| | | needEmpty = false,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
| | | toMapId = baseData.MapID,
|
| | | toLineId = 0,
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.CrossSever,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (package.socketType== ServerType.CrossSever)
|
| | | if (package.socketType == ServerType.CrossSever)
|
| | | {
|
| | | if (PlayerDatas.Instance.hero != null)
|
| | | {
|
| | |
| | | if (package.socketType == ServerType.Main
|
| | | && GameNetSystem.Instance.crossServerData.crossState == GameNetSystem.CrossServerState.Yes)
|
| | | {
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | fromMapId = StageLoad.Instance.mapIdRecord,
|
| | | fromLineId = StageLoad.Instance.lineIdRecord,
|
| | | toMapId = mapConfig.MapID,
|
| | | toLineId = MapUtility.GetLineId(mapConfig.MapID, PlayerDatas.Instance.baseData.dungeonLineId),
|
| | | needEmpty = true,
|
| | | needLoadResource = false,
|
| | | serverType = package.socketType,
|
| | | isClientLoadMap = false
|
| | | });
|
| | |
|
| | | var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
|
| | | var account = loginModel.accountBuf;
|
| | | var ip = GameNetSystem.Instance.crossServerData.ip;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var fromMapId = StageLoad.Instance.mapIdRecord;
|
| | | var fromLineId = StageLoad.Instance.lineIdRecord;
|
| | | var needLoadResource = true;
|
| | | if (fromMapId != package.MapID)
|
| | | {
|
| | | needLoadResource = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | var config1 = MapResourcesConfig.GetConfig(MapUtility.GetDataMapId(fromMapId), fromLineId);
|
| | | var config2 = MapResourcesConfig.GetConfig(MapUtility.GetDataMapId(package.MapID), lineId);
|
| | | needLoadResource = config1.MapResources != config2.MapResources;
|
| | | }
|
| | |
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | fromMapId = StageLoad.Instance.mapIdRecord,
|
| | | fromLineId=StageLoad.Instance.lineIdRecord,
|
| | | fromLineId = StageLoad.Instance.lineIdRecord,
|
| | | toMapId = mapConfig.MapID,
|
| | | toLineId = MapUtility.GetLineId( mapConfig.MapID,PlayerDatas.Instance.baseData.dungeonLineId),
|
| | | toLineId = MapUtility.GetLineId(mapConfig.MapID, PlayerDatas.Instance.baseData.dungeonLineId),
|
| | | needEmpty = true,
|
| | | needLoadResource = needLoadResource,
|
| | | serverType = package.socketType,
|
| | | isClientLoadMap = false
|
| | | });
|
| | |
| | | StageLoadTimeOutCatcher.RecordProtocol(vNetPack.socketType, "0403", DateTime.Now);
|
| | |
|
| | | GameNetSystem.Instance.netState = GameNetSystem.NetState.Connected;
|
| | | StageLoad.Instance.UpdateServerFlag(StageLoad.ServerFlagType.Flag_0403, vNetData.socketType, true);
|
| | |
|
| | | finishedLogin = true;
|
| | | GA_Hero.s_MapSwitching = false;
|
| | |
| | | break; |
| | | } |
| | | |
| | | var fromMapId = StageLoad.Instance.mapIdRecord; |
| | | var fromLineId = StageLoad.Instance.lineIdRecord; |
| | | var needLoadResource = true; |
| | | if (fromMapId != (int)package.MapID) |
| | | { |
| | | needLoadResource = true; |
| | | } |
| | | else |
| | | { |
| | | var config1 = MapResourcesConfig.GetConfig(MapUtility.GetDataMapId(fromMapId), fromLineId); |
| | | var config2 = MapResourcesConfig.GetConfig(MapUtility.GetDataMapId((int)package.MapID), lineId); |
| | | needLoadResource = config1.MapResources != config2.MapResources; |
| | | } |
| | | |
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand() |
| | | { |
| | | fromMapId = StageLoad.Instance.mapIdRecord, |
| | |
| | | toMapId = (int)package.MapID, |
| | | toLineId = lineId, |
| | | needEmpty = true, |
| | | needLoadResource = needLoadResource, |
| | | serverType = package.socketType, |
| | | isClientLoadMap = false |
| | | }); |
| | |
| | | toMapId = 1,
|
| | | toLineId = 0,
|
| | | needEmpty = false,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
| | | } |
| | | else |
| | | { |
| | | var needChangeScene = false; |
| | | switch (command.toMapId) |
| | | { |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | needChangeScene = true; |
| | | break; |
| | | default: |
| | | if (command.fromMapId != command.toMapId) |
| | | { |
| | | needChangeScene = true; |
| | | } |
| | | else |
| | | { |
| | | var config1 = MapResourcesConfig.GetConfig(MapUtility.GetDataMapId(command.fromMapId), command.fromLineId); |
| | | var config2 = MapResourcesConfig.GetConfig(MapUtility.GetDataMapId(command.toMapId), command.toLineId); |
| | | needChangeScene = config1.MapResources != config2.MapResources; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | if (needChangeScene) |
| | | if (command.needLoadResource) |
| | | { |
| | | tasks.Enqueue(new StageLoadProcessor.PreProcessTask(command)); |
| | | tasks.Enqueue(new StageLoadProcessor.UnLoadAndGCTask(command)); |
| | | } |
| | | |
| | | if (needChangeScene && command.needEmpty) |
| | | if (command.needLoadResource && command.needEmpty) |
| | | { |
| | | tasks.Enqueue(new StageLoadProcessor.LoadEmptyTask(command)); |
| | | } |
| | | |
| | | if (needChangeScene) |
| | | if (command.needLoadResource) |
| | | { |
| | | tasks.Enqueue(new StageLoadProcessor.LoadNewSceneTask(command)); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (needChangeScene) |
| | | if (command.needLoadResource) |
| | | { |
| | | tasks.Enqueue(new StageLoadProcessor.PostProcessTask(command)); |
| | | } |
| | | } |
| | | |
| | | serverFlag_0109 = default(ServerFlag); |
| | | serverFlag_0403 = default(ServerFlag); |
| | | |
| | | var gameObject = new GameObject("StageLoadProcessor"); |
| | | DontDestroyOnLoad(gameObject); |
| | |
| | | { |
| | | case ServerFlagType.Flag_0109: |
| | | serverFlag_0109 = new ServerFlag() |
| | | { |
| | | flagType = flagType, |
| | | serverType = socketType, |
| | | flag = flag, |
| | | }; |
| | | break; |
| | | case ServerFlagType.Flag_0403: |
| | | serverFlag_0403 = new ServerFlag() |
| | | { |
| | | flagType = flagType, |
| | | serverType = socketType, |
| | |
| | | public bool needEmpty; |
| | | public ServerType serverType; |
| | | public bool isClientLoadMap; |
| | | public bool needLoadResource; |
| | | } |
| | | |
| | | public enum ServerFlagType |
| | |
| | | && serverFlag_0109.flag; |
| | | default: |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public bool IsLoginOk() |
| | | { |
| | | if (serverFlag_0403.flagType == ServerFlagType.Flag_0403 |
| | | && serverFlag_0403.serverType == ServerType.Main |
| | | && serverFlag_0403.flag) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | public override void Update() |
| | | { |
| | | timer += Time.deltaTime; |
| | | if (!StageLoad.Instance.IsLoginOk()) |
| | | if (DTC0403_tagPlayerLoginLoadOK.neverLoginOk) |
| | | { |
| | | done = false; |
| | | progress = timer / duration; |
| | |
| | | toMapId = 2,
|
| | | toLineId = 0,
|
| | | needEmpty = false,
|
| | | needLoadResource=true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
| | | toMapId = 3,
|
| | | toLineId = 0,
|
| | | needEmpty = false,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|