yyl
19 小时以前 21126f5304efa5bbb9031c7119ad396bbf91e0e9
Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
3个文件已修改
50 ■■■■■ 已修改文件
Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/GameNetSystem.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Login/LoginManager.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs
@@ -15,7 +15,7 @@
        var vNetData = vNetPack as H0403_tagPlayerLoginLoadOK;
        GameNetSystem.Instance.netState = GameNetSystem.NetState.Connected;
        GameNetSystem.Instance.SetIsWaitLoginMap(false);
        NetLinkWin.Hide();
        if (LoginManager.Instance.reconnectBackGround)
Main/Core/NetworkPackage/GameNetSystem.cs
@@ -6,6 +6,10 @@
public class GameNetSystem : Singleton<GameNetSystem>
{
    //限制客户端的下一个包是登录包C0101_tagCPlayerLogin,如果不是登录包不允许发送
    bool waitLogin = false; //等待发送登录包,如果有其他包直接屏蔽,避免断线重连的情况发了攻击包之类的
    //等待服务端0403的包后才能发其他的功能包,只有C0123_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的包后才能发其他的功能包,只有C0123_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);
Main/System/Login/LoginManager.cs
@@ -66,6 +66,9 @@
        SDKUtils.Instance.onFreePlatformBindOk += OnSDKAccountBindOk;
        LaunchInHot.Instance.OnApplicationOut += OnApplicationOut;
        // #if UNITY_EDITOR
        // GlobalTimeEvent.Instance.MSEvent += OnMSEvent;
        // #endif
    }
    public override void Release()
@@ -243,9 +246,12 @@
    {
        if (ok)
        {
            GameNetSystem.Instance.SetIsWaitLogin(false);
            GameNetSystem.Instance.SetIsWaitLoginMap(true);
            var sendInfo = new C0123_tagCClientPackVersion();
            sendInfo.Version = DwVersionNo;
            GameNetSystem.Instance.SendInfo(sendInfo);
            GameNetSystem.Instance.SetIsWaitLogin(true);
        }
        else
        {
@@ -253,6 +259,13 @@
        }
    }
    // void OnMSEvent()
    // {
    //     //测试用 测试登录流程中一直发无用的包是否影响登录
    //     var pack = new CA504_tagCMPlayerGetReward();
    //     GameNetSystem.Instance.SendInfo(pack);
    // }
    public void AccessLogin(H0101_tagServerPrepared _serverInfo)
    {
@@ -291,6 +304,7 @@
    public C0101_tagCPlayerLogin Get0101SendPackage(H0101_tagServerPrepared _serverInfo)
    {
        GameNetSystem.Instance.SetIsWaitLogin(false);
        var send = new C0101_tagCPlayerLogin();
        switch (VersionConfig.Get().versionAuthority)
        {