From ed98029a88cd89702980ac7c40b711afddc5aeb2 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 20 十一月 2025 14:44:59 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
---
Main/Core/NetworkPackage/GameNetSystem.cs | 73 ++++++++++++++++++++----------------
1 files changed, 41 insertions(+), 32 deletions(-)
diff --git a/Main/Core/NetworkPackage/GameNetSystem.cs b/Main/Core/NetworkPackage/GameNetSystem.cs
index 5b1e167..56744e6 100644
--- a/Main/Core/NetworkPackage/GameNetSystem.cs
+++ b/Main/Core/NetworkPackage/GameNetSystem.cs
@@ -6,6 +6,10 @@
public class GameNetSystem : Singleton<GameNetSystem>
{
+ //闄愬埗瀹㈡埛绔殑涓嬩竴涓寘鏄櫥褰曞寘C0101_tagCPlayerLogin锛屽鏋滀笉鏄櫥褰曞寘涓嶅厑璁稿彂閫�
+ bool waitLogin = false; //绛夊緟鍙戦�佺櫥褰曞寘锛屽鏋滄湁鍏朵粬鍖呯洿鎺ュ睆钄斤紝閬垮厤鏂嚎閲嶈繛鐨勬儏鍐靛彂浜嗘敾鍑诲寘涔嬬被鐨�
+ //绛夊緟鏈嶅姟绔�0403鐨勫寘鍚庢墠鑳藉彂鍏朵粬鐨勫姛鑳藉寘锛屽彧鏈塁0123_tagCClientPackVersion 鍜� C0101_tagCPlayerLogin 鍙互鍙戦��
+ bool waitLoginMap = false;
NetUpdateBehaviour m_NetUpdateBehaviour;
NeverConnectState neverConnectState;
AccountLoginState accountLoginState;
@@ -125,8 +129,38 @@
});
}
+ //闄愬埗瀹㈡埛绔殑涓嬩竴涓寘鏄櫥褰曞寘C0101_tagCPlayerLogin锛屽鏋滀笉鏄櫥褰曞寘涓嶅厑璁稿彂閫�
+ public void SetIsWaitLogin(bool _wait)
+ {
+ waitLogin = _wait;
+ }
+
+ //绛夊緟鏈嶅姟绔�0403鐨勫寘鍚庢墠鑳藉彂鍏朵粬鐨勫姛鑳藉寘锛屽彧鏈塁0123_tagCClientPackVersion 鍜� C0101_tagCPlayerLogin 鍙互鍙戦��
+ public void SetIsWaitLoginMap(bool _wait)
+ {
+ waitLoginMap = _wait;
+ }
+
public void SendInfo(GameNetPackBasic protocol)
{
+ if (waitLogin)
+ {
+ if (protocol is not C0101_tagCPlayerLogin)
+ {
+ Debug.LogWarning("绛夊緟鎵ц鐧诲綍锛屼笉鍏佽鍙戦�佸叾浠栧寘 " + protocol.ToString());
+ return;
+ }
+ }
+
+ if (waitLoginMap)
+ {
+ if (protocol is not C0123_tagCClientPackVersion && protocol is not C0101_tagCPlayerLogin)
+ {
+ Debug.LogWarning("绛夊緟0403鍖咃紝涓嶅厑璁稿彂閫佸叾浠栧寘 " + protocol.ToString());
+ return;
+ }
+ }
+
if (mainSocket != null)
{
mainSocket.SendInfo(protocol);
@@ -183,8 +217,7 @@
finally
{
netState = NetState.DisConnected;
- // var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
- // loginModel.busy = false;
+ LoginManager.Instance.busy = false;
}
}
@@ -208,21 +241,16 @@
finally
{
netState = NetState.AccountLogin;
- // var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
- // loginModel.busy = false;
- // loginModel.ReAccountLogin();
+ LoginManager.Instance.busy = false;
+ LoginManager.Instance.ReAccountLogin();
}
}
public void LoginOut()
{
- // if (CameraController.Instance != null)
- // CameraController.Instance.SetInGame(false);
- // DTC0102_tagCDBPlayer.isAfterPlayerDataInitialize = false;
-
try
{
- // ynmbxxjUtil.Instance.RoleLoginOut();
+ SDKUtils.Instance.RoleLoginOut();
if (mainSocket != null)
{
@@ -238,31 +266,11 @@
finally
{
netState = NetState.NerverConnect;
- // TODO YYL
- // var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
- // loginModel.busy = false;
+ LoginManager.Instance.busy = false;
- // StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
- // {
- // toMapId = 1,
- // toLineId = 0,
- // needEmpty = false,
- // needLoadResource = true,
- // serverType = ServerType.Main,
- // isClientLoadMap = true
- // });
- // //CameraManager.uiCamera.clearFlags = CameraClearFlags.SolidColor;
- // //GameObject obj = GameObject.Find("NormalCanvas");
- // //int count = obj.transform.childCount;
- // //for (int i = count - 1; i >= 0; --i)
- // //{
- // // //Debug.LogError(obj.transform.GetChild(i).name);
- // // GameObject.Destroy(obj.transform.GetChild(i).gameObject);
- // //}
- // //SceneManager.LoadScene("Empty");
+ StageManager.Instance.ReturnToLoginScene();
NetLinkWin.Hide();
- // DTC0403_tagPlayerLoginLoadOK.neverLoginOk = true;
}
}
@@ -309,4 +317,5 @@
{
Main = 1,
B430 = 2,
+ MainFight = 3,
}
--
Gitblit v1.8.0