From be6ae7d3819761fa1126ebf1b8db97c10dd2830c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 11 十二月 2025 11:37:08 +0800
Subject: [PATCH] 0312 登录完成前缓存封包处理
---
Main/Core/NetworkPackage/GameNetSystem.cs | 40 +++++++++++++++++++++++++++++++---------
1 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/Main/Core/NetworkPackage/GameNetSystem.cs b/Main/Core/NetworkPackage/GameNetSystem.cs
index 059ca0b..a0661a3 100644
--- a/Main/Core/NetworkPackage/GameNetSystem.cs
+++ b/Main/Core/NetworkPackage/GameNetSystem.cs
@@ -141,6 +141,27 @@
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)
@@ -152,15 +173,16 @@
}
}
- // 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)
{
--
Gitblit v1.8.0