Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
| | |
| | |
|
| | | GameNetSystem.Instance.netState = GameNetSystem.NetState.Connected;
|
| | | GameNetSystem.Instance.SetIsWaitLoginMap(false);
|
| | | GameNetSystem.Instance.SendCachePackage();
|
| | | NetLinkWin.Hide();
|
| | |
|
| | | if (LoginManager.Instance.reconnectBackGround)
|
| | |
| | | waitLoginMap = _wait; |
| | | } |
| | | |
| | | public bool GetIsWaitLoginMap() |
| | | { |
| | | return waitLoginMap; |
| | | } |
| | | |
| | | //0403登录之前的包缓存 |
| | | Queue<GameNetPackBasic> sendQueue = new Queue<GameNetPackBasic>(); |
| | | |
| | | public void SendCachePackage() |
| | | { |
| | | int cnt = sendQueue.Count; |
| | | if (mainSocket != null) |
| | | { |
| | | while (sendQueue.Count > 0) |
| | | { |
| | | SendInfo(sendQueue.Dequeue()); |
| | | } |
| | | } |
| | | Debug.LogError($"重点提醒:0403登录后 发送缓存包数量 {cnt} 个"); |
| | | } |
| | | |
| | | public void SendInfo(GameNetPackBasic protocol) |
| | | { |
| | | if (waitLogin) |
| | |
| | | } |
| | | } |
| | | |
| | | // 0102是从地图发送的 说明已登录,除非服务端报错异常,这里可以不屏蔽 |
| | | // if (waitLoginMap) |
| | | // { |
| | | // if (protocol is not C0123_tagCClientPackVersion && protocol is not C0101_tagCPlayerLogin) |
| | | // { |
| | | // Debug.LogError("等待0403包,不允许发送其他包 " + protocol.ToString()); |
| | | // return; |
| | | // } |
| | | // } |
| | | // 0102是从地图发送的 说明已登录,但可能卡顿导致通知route状态慢于客户端,依然需要防范 |
| | | if (waitLoginMap) |
| | | { |
| | | if (protocol is not C0123_tagCClientPackVersion && protocol is not C0101_tagCPlayerLogin) |
| | | { |
| | | Debug.LogError("重点提醒:登录完成前的封包先加入队列 等0403回包后再一起发送服务端 " + protocol.ToString()); |
| | | sendQueue.Enqueue(protocol); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (mainSocket != null) |
| | | { |
| | |
| | | //销毁所有战场
|
| | | BattleManager.Instance.DestroyAllBattleField();
|
| | |
|
| | | //游戏内日志关闭
|
| | | #if !UNITY_EDITOR
|
| | | if (File.Exists(Directory.GetParent(Application.persistentDataPath) + "/Debug") ||
|
| | | LocalSave.GetString("#@#BrancH") != string.Empty)
|
| | | {
|
| | | Debug.unityLogger.logEnabled = true;
|
| | | }
|
| | | else
|
| | | { |
| | | Debug.unityLogger.logEnabled = true;
|
| | | }
|
| | |
|
| | | #endif
|
| | |
|
| | | }
|
| | |
|
| | | private static void ReleaseMgrs()
|
| | |
| | | using System;
|
| | | using System.IO;
|
| | | using Cysharp.Threading.Tasks;
|
| | | using UnityEngine;
|
| | | using UnityEngine.SceneManagement;
|
| | |
| | | AfterLoadingGameScene?.Invoke();
|
| | |
|
| | | UIManager.Instance.OpenWindow<MainWin>();
|
| | |
|
| | | //游戏内日志关闭
|
| | | #if !UNITY_EDITOR
|
| | | if (File.Exists(Directory.GetParent(Application.persistentDataPath) + "/Debug") ||
|
| | | LocalSave.GetString("#@#BrancH") != string.Empty)
|
| | | {
|
| | | Debug.unityLogger.logEnabled = true;
|
| | | }
|
| | | else
|
| | | { |
| | | Debug.unityLogger.logEnabled = false;
|
| | | }
|
| | |
|
| | | #endif
|
| | | }
|
| | |
|
| | | protected async UniTask OnLoading(AsyncOperation asyncOperation, Func<float> getLoadingProgress, Func<UniTask> anthorTask = null)
|
| | |
| | | case ChatChannel.World: |
| | | return Language.Get("Chat17", data.Name, data.Content); |
| | | case ChatChannel.Guild: |
| | | return Language.Get("Chat16", Language.Get("ChatTab1"), data.Name, data.Content); |
| | | FairyMember fairyMember = PlayerDatas.Instance.fairyData.GetMember((int)data.PlayerID); |
| | | int fmlv = 0; |
| | | if (fairyMember != null) |
| | | { |
| | | fmlv = fairyMember.FmLV; |
| | | } |
| | | return Language.Get("Chat16", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), data.Name, data.Content); |
| | | default: |
| | | return data.Content; |
| | | } |