少年修仙传客户端代码仓库
client_Zxw
2018-09-04 4f8930892464c578b6e872e87e3561a9867f8034
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
3个文件已修改
54 ■■■■ 已修改文件
System/Chat/ChatCtrl.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/FileExtersion.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/LanguageVerify.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Chat/ChatCtrl.cs
@@ -249,6 +249,12 @@
    {
        bool _dirty = false;
        if (CheckEmptyChat(msg))
        {
            SysNotifyMgr.Instance.ShowTip("CanootTalk14");
            return;
        }
        ChatReport(type, msg, PteChatName);
        if (!ChatCenter.s_VoiceRegex.IsMatch(msg))
@@ -347,6 +353,15 @@
             }
         });
    }
    bool CheckEmptyChat(string msg)
    {
        if (string.IsNullOrEmpty(msg.Replace(" ", string.Empty)))
        {
            return true;
        }
        return false;
    }
    /// <summary>
    /// 世界频道
    /// </summary>
Utility/FileExtersion.cs
@@ -155,4 +155,24 @@
            throw new Exception("GetMD5HashFromFile() fail,error:" + ex.Message);
        }
    }
    public static string GetStringMD5Hash(string str)
    {
        try
        {
            var bytes = Encoding.UTF8.GetBytes(str);
            var md5 = new MD5CryptoServiceProvider();
            var retVal = md5.ComputeHash(bytes);
            var sb = new StringBuilder();
            for (int i = 0; i < retVal.Length; i++)
            {
                sb.Append(retVal[i].ToString("x2"));
            }
            return sb.ToString();
        }
        catch (Exception ex)
        {
            throw new Exception("GetMD5HashFromFile() fail,error:" + ex.Message);
        }
    }
}
Utility/LanguageVerify.cs
@@ -54,7 +54,7 @@
        tables["sender_vip_level"] = vipLv.ToString();
        var ts = System.DateTime.UtcNow - new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
        tables["timestamp"] = ((long)System.Convert.ToInt64(ts.TotalSeconds)).ToString();
        tables["key"] = ToMD5(StringUtility.Contact(Sercret, tables["timestamp"]));
        tables["key"] = FileExtersion.GetStringMD5Hash(StringUtility.Contact(Sercret, tables["timestamp"]));
        HttpRequest.Instance.RequestHttpPost(VerifyPlayerNameUrl, tables, HttpRequest.defaultHttpContentType, 3,
            (bool ok, string result) =>
               {
@@ -118,7 +118,7 @@
        tables["notice"] = op_type == 2 ? string.Empty : verifyContent;
        var ts = System.DateTime.UtcNow - new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
        tables["timestamp"] = ((long)System.Convert.ToInt64(ts.TotalSeconds)).ToString();
        tables["key"] = ToMD5(StringUtility.Contact(Sercret, tables["timestamp"]));
        tables["key"] = FileExtersion.GetStringMD5Hash(StringUtility.Contact(Sercret, tables["timestamp"]));
        HttpRequest.Instance.RequestHttpPost(VerifyFairyUrl, tables, HttpRequest.defaultHttpContentType, 3,
            (bool ok, string result) =>
@@ -185,7 +185,7 @@
        var ts = System.DateTime.UtcNow - new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
        tables["timestamp"] = ((long)System.Convert.ToInt64(ts.TotalSeconds)).ToString();
        tables["key"] = ToMD5(StringUtility.Contact(Sercret, tables["timestamp"]));
        tables["key"] = FileExtersion.GetStringMD5Hash(StringUtility.Contact(Sercret, tables["timestamp"]));
        HttpRequest.Instance.RequestHttpPost(VerifyChatUrl, tables, HttpRequest.defaultHttpContentType, 3,
            (bool ok, string result) =>
@@ -250,19 +250,6 @@
        }
        return true;
    }
    static string ToMD5(string content)
    {
        byte[] bytes = Encoding.UTF8.GetBytes(content);
        MD5 md5 = new MD5CryptoServiceProvider();
        byte[] hash = md5.ComputeHash(bytes);
        s_StringBuilder.Length = 0;
        for (int i = 0; i < hash.Length; i++)
        {
            s_StringBuilder.Append(hash[i].ToString("X2"));
        }
        return s_StringBuilder.ToString();
    }
    public class VerifyResponse
    {