public void Process(string html) { if (string.IsNullOrEmpty(html)) { return; } var params0 = HelperStrings.SubString(html, "var params = [[", "],"); if (string.IsNullOrEmpty(params0)) { return; } var spar0 = HelperStrings.ParseArguments(params0); if (spar0.Length < 9) { return; } var location = spar0[5]; var splocation = location.Split(new[] { " [" }, StringSplitOptions.RemoveEmptyEntries); if (splocation.Length == 2) { splocation[1] = splocation[1].Substring(0, splocation[1].Length - 1); location = splocation[1]; } var isonline = !string.IsNullOrEmpty(location); var flog = spar0[7]; if (flog.Equals("0", StringComparison.Ordinal)) { flog = string.Empty; } NextCheck = DateTime.Now.AddSeconds(30); if (!isonline) { return; } if (flog.Equals(Flog)) { return; } Flog = flog; if (string.IsNullOrEmpty(flog)) { return; } var fight = NeverInfo.GetFlog(flog); //fight = File.ReadAllText("boss3.txt"); if (string.IsNullOrEmpty(fight)) { return; } // var lives_g2 = [[3,"Королева Змей",49331,100000,2304578,1]]; // [1,"Anothers_girl",21,4,"c174",1070,1070,1] // [1,"PAPA",16,3,"c249",795,795,1] // [1,"E Pluribus Unum",15,2,"c176",1095,1095,1] // 16:53:27 Босс Королева Змей [25] нападает... // 16:53:27 Босс Королева Змей [25]: 99950/100000 // 13:30:22 Босс Хранитель Леса [25]: 0/100000 // 13:30:22 Босс Королева Змей [25]: 100000/100000 var livesg1 = HelperStrings.SubString(fight, "var lives_g1 = [[", "]]"); var livesg2 = HelperStrings.SubString(fight, "var lives_g2 = [[", "]]"); if (string.IsNullOrEmpty(livesg1) || string.IsNullOrEmpty(livesg2)) { return; } //File.WriteAllText($"x{flog}.txt", fight); if (CheckLives(Name, flog, html, location, livesg1)) { ContactsManager.AddUsers(livesg2); //File.WriteAllText($"x{flog}.txt", fight); return; } if (CheckLives(Name, flog, html, location, livesg2)) { ContactsManager.AddUsers(livesg1); //File.WriteAllText($"x{flog}.txt", fight); return; } }
private static string HtmlPercEntry(string nick) { var userInfo = NeverApi.GetAll(nick); if (userInfo == null) { return("Аноним"); } nick = userInfo.Nick; var nnhtmlSec = nick.Replace("+", "%2B"); var colorNick = nick; switch (ContactsManager.GetClassIdOfContact(nick)) { case 1: colorNick = @"<font color=""#8A0808"">" + colorNick + "</font>"; break; case 2: colorNick = @"<font color=""#0B610B"">" + colorNick + "</font>"; break; default: colorNick = @"<font color=""#000000"">" + colorNick + "</font>"; break; } var align = userInfo.Align; var sign = userInfo.ClanSign; var level = userInfo.Level; var clan = userInfo.ClanName; var sbeff = new StringBuilder(); if (userInfo.EffectsCodes.Length > 0) { for (var k = 0; k < userInfo.EffectsCodes.Length; k++) { var effcode = userInfo.EffectsCodes[k]; var effname = userInfo.EffectsNames[k]; sbeff.AppendFormat( @" <img src=http://image.neverlands.ru/pinfo/eff_{0}.gif width=15 height=15 align=absmiddle title=""{1}"">", effcode, effname); } } var sleeps = string.Empty /*sbeff.ToString()*/; var ali1 = string.Empty; var ali2 = string.Empty; switch (align) { case "0": ali1 = string.Empty; ali2 = string.Empty; break; case "1": ali1 = "darks.gif"; ali2 = "Дети Тьмы"; break; case "2": ali1 = "lights.gif"; ali2 = "Дети Света"; break; case "3": ali1 = "sumers.gif"; ali2 = "Дети Сумерек"; break; case "4": ali1 = "chaoss.gif"; ali2 = "Дети Хаоса"; break; case "5": ali1 = "light.gif"; ali2 = "Истинный Свет"; break; case "6": ali1 = "dark.gif"; ali2 = "Истинная Тьма"; break; case "7": ali1 = "sumer.gif"; ali2 = "Нейтральные Сумерки"; break; case "8": ali1 = "chaos.gif"; ali2 = "Абсолютный Хаос"; break; case "9": ali1 = "angel.gif"; ali2 = "Ангел"; break; } align = string.IsNullOrEmpty(ali1)? string.Empty : "<img src=http://image.neverlands.ru/signs/" + ali1 + @" width=15 height=12 align=absmiddle border=0 title=""" + ali2 + @"""> "; var ss = string.Empty; if (!string.IsNullOrEmpty(clan)) { ss = "<img src=http://image.neverlands.ru/signs/" + sign + @" width=15 height=12 align=absmiddle title=""" + clan + @"""> "; } var result = @"<a href=""#"" onclick=""top.say_private('" + nick + @"');""><img src=http://image.neverlands.ru/chat/private.gif width=11 height=12 border=0 align=absmiddle></a> " + align + ss + @"<a class=""activenick"" href=""#"" onclick=""top.say_to('" + nick + @"');""><font class=nickname><b>" + colorNick + "</b></a>[" + level + @"]</font><a href=""http://www.neverlands.ru/pinfo.cgi?" + nnhtmlSec + @""" onclick=""window.open(this.href);""><img src=http://image.neverlands.ru/chat/info.gif width=11 height=12 border=0 align=absmiddle></a>" + sleeps; return(result); }
private static string HtmlPercEntry(string nick, string html) { if (string.IsNullOrEmpty(html)) { return("Аноним"); } var params0 = HelperStrings.SubString(html, "var params = [[", "],"); if (string.IsNullOrEmpty(params0)) { return("Аноним"); } var hpmp = HelperStrings.SubString(html, "var hpmp = [", "]"); if (string.IsNullOrEmpty(hpmp)) { return("Аноним"); } var spar1 = HelperStrings.ParseArguments(hpmp); if (spar1.Length < 5) { return("Аноним"); } var spar0 = HelperStrings.ParseArguments(params0); if (spar0.Length < 9) { return("Аноним"); } //var nick = spar0[0].Trim(); var nnhtmlSec = nick; { nnhtmlSec = nnhtmlSec.Replace("+", "%2B"); } var colorNick = nick; switch (ContactsManager.GetClassIdOfContact(nick)) { case -1: case 0: colorNick = @"<font color=""#000000"">" + colorNick + "</font>"; break; case 1: colorNick = @"<font color=""#8A0808"">" + colorNick + "</font>"; break; case 2: colorNick = @"<font color=""#0B610B"">" + colorNick + "</font>"; break; } var sign = spar0[2]; var level = spar0[3]; var clan = spar0[8]; // var effects = [[1,'Боевая травма (x9) (еще 23:06:17)'],[2,'Тяжелая травма (x2) (еще 07:01:22)'],[17,'Молчанка (еще 00:00:05)']]; var effects = HelperStrings.SubString(html, "var effects = [", "];"); var sbeff = new StringBuilder(); if (!string.IsNullOrEmpty(effects)) { var seffects = effects.Split(new[] { "],[" }, StringSplitOptions.RemoveEmptyEntries); for (var k = 0; k < seffects.Length; k++) { var effk = seffects[k].Trim(new[] { '[', ']' }); var seffk = effk.Split(','); if (seffk.Length <= 1) { continue; } var effcode = seffk[0]; var effname = seffk[1].Replace("<b>", string.Empty).Replace("</b>", string.Empty); sbeff.AppendFormat( @" <img src=http://image.neverlands.ru/pinfo/eff_{0}.gif width=15 height=15 align=absmiddle title=""{1}"">", effcode, effname); } } var ss = string.Empty; if (!string.IsNullOrEmpty(clan)) { ss = "<img src=http://image.neverlands.ru/signs/" + sign + @" width=15 height=12 align=absmiddle title=""" + clan + @"""> "; } var result = @"<a href=""#"" onclick=""top.say_private('" + nick + @"');""><img src=http://image.neverlands.ru/chat/private.gif width=11 height=12 border=0 align=absmiddle></a> " + ss + @"<a class=""activenick"" href=""#"" onclick=""top.say_to('" + nick + @"');""><font class=nickname><b>" + colorNick + "</b></a>[" + level + @"]</font><a href=""http://www.neverlands.ru/pinfo.cgi?" + nnhtmlSec + @""" onclick=""window.open(this.href);""><img src=http://image.neverlands.ru/chat/info.gif width=11 height=12 border=0 align=absmiddle></a>"; return(result); }