public static void UnbanUser(string name, string admin) { if (!Program.mbansSubmit || !Program.mbansEnable) return; if (Program.PlyGetRank(name) == "banned") return; BanStruct bstr = new BanStruct(); bstr.action = "unban"; bstr.name = name; bstr.admin = admin; bstr.reason = ""; new Thread(new ParameterizedThreadStart(__BanUser)).Start(bstr); }
static string __GetValidation(BanStruct bstr) { SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider(); string temp = ""; string result = ""; byte[] res = sha1.ComputeHash(System.Text.Encoding.ASCII.GetBytes("wizzy_" + bstr.action + "_i_" + bstr.name + "_love_" + bstr.admin + "_you_" + bstr.reason + "_forever_" + Program.externalIP + "_!")); for (int i = 0; i < res.Length; i++) { temp = Convert.ToString(res[i], 16); if (temp.Length == 1) temp = "0" + temp; result += temp; } return result; }