少年修仙传客户端代码仓库
client_Hale
2018-09-18 c714a8c41dec8cda03d5ab920fde9305498dc8ef
3646 【前端】思璞游戏SDK接入 内网登陆封包修改
3个文件已修改
62 ■■■■ 已修改文件
Core/NetworkPackage/ClientPack/ClientToMapServer/C01_System/C0101_tagCPlayerLogin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/SDK/SDKUtility.cs 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Login/LoginModel.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/C01_System/C0101_tagCPlayerLogin.cs
@@ -17,6 +17,8 @@
    public byte Phone;    //是否绑定手机
    public uint ServerID;    //服务器ID
    public byte Adult;    //是否成年 0未成年 1成年
    public byte ExtraLen; // 扩展信息长度
    public string Extra; // 扩展信息
    public C0101_tagCPlayerLogin()
    {
@@ -37,6 +39,8 @@
        WriteBytes(Phone, NetDataType.BYTE);
        WriteBytes(ServerID, NetDataType.DWORD);
        WriteBytes(Adult, NetDataType.BYTE);
        WriteBytes(ExtraLen, NetDataType.BYTE);
        WriteBytes(Extra, NetDataType.Chars, ExtraLen);
    }
}
Core/SDK/SDKUtility.cs
@@ -18,8 +18,9 @@
    public enum E_ChannelPlatform
    {
        Free,
        Mr,
        Free = 1,// 自由
        Mr = 2,// 猫耳
        Sp = 3,// 思璞
    }
    public E_ChannelPlatform ChannelPlatform { get; private set; }
@@ -315,6 +316,10 @@
                        {
                            ChannelPlatform = E_ChannelPlatform.Mr;
                        }
                        else if (_channelPlatform.Equals("sp"))
                        {
                            ChannelPlatform = E_ChannelPlatform.Sp;
                        }
                    }
                }
                break;
@@ -498,6 +503,7 @@
        public const int PayFinished = 105;
        public const int CreateRole = 106;
        public const int RoleLogin = 107;
        public const int RoleLevelUp = 108;
        /**
         * 极光推送
         * */
@@ -546,6 +552,8 @@
        public string tokenExpire;
        public int phone;
        public int accountID;
        public string timeStamp;
        public string sessionID;
    }
    public struct FP_CheckIDAuthentication
@@ -689,13 +697,27 @@
                        m_Json["cpInfo"] = cpInfo;
                        m_Json["title"] = title;
                        if (ChannelPlatform == E_ChannelPlatform.Mr)
                        if(ChannelPlatform == E_ChannelPlatform.Mr
                        || ChannelPlatform == E_ChannelPlatform.Sp)
                        {
                            m_Json["notifyurl"] = _json["notifyurl"];
                            m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID;
                            m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName;
                            m_Json["level"] = PlayerDatas.Instance.baseData.LV.ToString();
                            m_Json["sid"] = "s" + ServerListCenter.Instance.currentServer.region_flag;
                        }
                        if (ChannelPlatform == E_ChannelPlatform.Mr)
                        {
                            m_Json["notifyurl"] = _json["notifyurl"];
                        }
                        else if(ChannelPlatform == E_ChannelPlatform.Sp)
                        {
                            m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
                            m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
                            m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString();
                            m_Json["money"] = PlayerDatas.Instance.baseData.Gold.ToString();
                            m_Json["gameName"] = VersionConfig.Get().productName;
                            m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
                        }
#if UNITY_IOS
                        m_Json["identifier"] = VersionConfig.Get().bundleIdentifier;
@@ -787,7 +809,6 @@
        if (_iDict.Contains("token"))
        {
            FreePlatformInfo.token = json["token"].ToString();
            Debug.Log("token: " + FreePlatformInfo.token);
        }
        if (_iDict.Contains("token_expire"))
        {
@@ -800,12 +821,21 @@
        if (_iDict.Contains("account"))
        {
            FreePlatformInfo.account = json["account"].ToString();
            Debug.Log("account: " + FreePlatformInfo.account);
        }
        if (_iDict.Contains("account_id"))
        {
            int.TryParse(json["account_id"].ToString(), out FreePlatformInfo.accountID);
            Debug.Log("account_id: " + FreePlatformInfo.accountID);
        }
        if (_iDict.Contains("session_id"))
        {
            FreePlatformInfo.sessionID = (string)json["session_id"];
        }
        if (_iDict.Contains("timeStamp"))
        {
            FreePlatformInfo.timeStamp = (string)json["timeStamp"];
        }
        FreePlatformInfo.phone = 0;
@@ -848,9 +878,17 @@
    {
        m_Json.Clear();
        m_Json["code"] = CodeU2A.CreateRole;
        m_Json["roleID"] = roleID;
        m_Json["roleName"] = roleName;
        m_Json["sid"] = "s" + ServerListCenter.Instance.currentServer.region_flag;
        m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
        m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
        m_Json["level"] = "1";
        m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString();
        m_Json["money"] = PlayerDatas.Instance.baseData.Gold.ToString();
        m_Json["gameName"] = VersionConfig.Get().productName;
        m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
        SendMessageToSDK(m_Json);
    }
System/Login/LoginModel.cs
@@ -271,6 +271,8 @@
                    send.Phone = 0;
                    send.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag;
                    send.Adult = 1;
                    send.ExtraLen = 0;
                    send.Extra = "";
                    break;
                case VersionAuthority.Release:
                    if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Free)
@@ -281,6 +283,10 @@
                    {
                        send.IDType = 2;
                    }
                    else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Sp)
                    {
                        send.IDType = 3;
                    }
                    send.AccID = sdkLoginResult.account;
                    send.Password = sdkLoginResult.token;
                    send.MAC = DeviceUtility.GetMac();