Skip to content

Instantly share code, notes, and snippets.

@JKamsker
Last active March 22, 2023 22:09
Show Gist options
  • Save JKamsker/9d1361b28ed6f9791b6e1ec4fea4a13e to your computer and use it in GitHub Desktop.
Save JKamsker/9d1361b28ed6f9791b6e1ec4fea4a13e to your computer and use it in GitHub Desktop.
dnSpySamples
using System;using System.Collections;using System.Collections.Generic;using System.Diagnostics;using System.Globalization;using System.IO;using System.Linq;using System.Linq.Expressions;using System.Net;using System.Net.Configuration;using System.Reflection;using System.Runtime.CompilerServices;using System.Runtime.InteropServices;using System.Text;using System.Text.RegularExpressions;using System.Threading;using System.Threading.Tasks;using CrawlerNGLib.models;using Microsoft.CSharp.RuntimeBinder;using Newtonsoft.Json;using NLog;using ns0;namespace CrawlerNGLib{public class HttpHandler{public HttpHandler(string serverUrl, string username, string password, string customUseragent, WebProxy webProxy){this.string_11 = serverUrl;this.string_13 = username;this.string_10 = password;this.string_12 = customUseragent ?? "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36";this.webProxy_0 = webProxy;HttpHandler.logger_0.Debug("[HttpHandler] Initialized.");HttpHandler.logger_0.Debug("[HttpHandler] Server url: {0}.", this.string_11);HttpHandler.logger_0.Debug("[HttpHandler] Username: {0}.", this.string_13);HttpHandler.logger_0.Debug("[HttpHandler] Password: {0}.", "***");HttpHandler.logger_0.Debug("[HttpHandler] Useragent: {0}.", this.string_12);HttpHandler.logger_0.Debug<WebProxy>("[HttpHandler] Web proxy: {0}.", this.webProxy_0);}// Note: this type is marked as 'beforefieldinit'.static HttpHandler(){}public async Task<bool> InitializeSession(){if (this.method_6(true)){HttpHandler.logger_0.Debug("[InitializeSession] Enabled ToggleAllowUnsafeHeaderParsing.");}HttpHandler.logger_0.Info("[InitializeSession] Initialize a new session.");this.security_0 = new Security();HttpHandler.logger_0.Debug<string, string>("[InitializeSession] Security - Key: {0} ID: {1}.", Encoding.UTF8.GetString(this.security_0.GetKey()), this.security_0.Id);this.session_0 = new Session();HttpHandler.logger_0.Debug("[InitializeSession] Session - ID: {0}.", this.session_0.SessionId);this.requestDecoder_0 = new RequestDecoder(this.security_0, this.session_0);HttpHandler.logger_0.Info("[InitializeSession] RequestDecoder initialized.");this.cryptography_0 = new Cryptography(this.security_0, this.session_0);HttpHandler.logger_0.Info("[InitializeSession] Cryptography initialized.");string text = this.cryptography_0.Encryption("AccountLogin", new string[]{this.string_13,this.method_3(),this.session_0.GetLoginCount(),"unity3d_webglplayer","","130000000000"});HttpHandler.logger_0.Debug("[InitializeSession] Request paramter: {0}", text);TaskAwaiter<string> taskAwaiter = this.method_0(this.method_2(text), false).GetAwaiter();TaskAwaiter<string> taskAwaiter2;if (!taskAwaiter.IsCompleted){await taskAwaiter;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<string>);}string text2 = taskAwaiter.GetResult();HttpHandler.logger_0.Debug("[InitializeSession] HttpRequest: {0}", text2);bool flag;if (text2 != null && this.requestDecoder_0.Accountlogin(text2)){HttpHandler.logger_0.Info("[InitializeSession] Session successfully initialized.");text = this.cryptography_0.Encryption("AccountLogin", new string[]{this.string_13,this.method_3(),this.session_0.GetLoginCount(),"unity3d_webglplayer","","130000000000"});HttpHandler.logger_0.Debug("[InitializeSession] Request paramter: {0}", text);taskAwaiter = this.method_0(this.method_2(text), false).GetAwaiter();if (!taskAwaiter.IsCompleted){await taskAwaiter;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<string>);}text2 = taskAwaiter.GetResult();HttpHandler.logger_0.Debug("[InitializeSession] Result: {0}", text2);if (text2 != null && this.requestDecoder_0.Accountlogin(text2)){this.playerHandler_0 = new PlayerHandler(text2, this.string_13);flag = this.requestDecoder_0.Accountlogin(text2);}else{flag = false;}}else{HttpHandler.logger_0.Info("[InitializeSession] Unable to initialize a session.");flag = false;}return flag;}public async Task<Account> CreateAnonAccount(){HttpHandler.logger_0.Info("[CreateAnonAccount] Creating Anon account.");for (int i = 0; i < 3; i++){HttpHandler.logger_0.Debug("[CreateAnonAccount] Try to create anon account: {0}.", i);string text = this.method_5(12);HttpHandler.logger_0.Debug("[CreateAnonAccount] Login name: {0}.", text);string text2 = this.method_5(12);HttpHandler.logger_0.Debug("[CreateAnonAccount] Password: {0}.", text2);string text3 = this.method_5(12) + "@gmail.com";HttpHandler.logger_0.Debug("[CreateAnonAccount] E-Mail: {0}.", text3);string text4 = this.cryptography_0.Encryption("AccountCheck", new string[] { text });HttpHandler.logger_0.Debug("[CreateAnonAccount] Request parameter: {0}.", text4);TaskAwaiter<string> taskAwaiter = this.method_0(this.method_2(text4), false).GetAwaiter();TaskAwaiter<string> taskAwaiter2;if (!taskAwaiter.IsCompleted){await taskAwaiter;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<string>);}string text5 = taskAwaiter.GetResult();HttpHandler.logger_0.Debug("[CreateAnonAccount] Result: {0}.", text5);if (text5 != null && !text5.StartsWith("Error", StringComparison.OrdinalIgnoreCase)){HttpHandler.logger_0.Info("[CreateAnonAccount] Successfully created anon account.");text4 = this.cryptography_0.Encryption("AccountCreate", new string[] { text, text2, text3, "1", "3", "3", "1, 309, 303, 6, 305, 2, 2, 5, 0", "0", "sfgame_new_flash", "de" });HttpHandler.logger_0.Debug("[CreateAnonAccount] Request parameter: {0}.", text4);taskAwaiter = this.method_0(this.method_2(text4), false).GetAwaiter();if (!taskAwaiter.IsCompleted){await taskAwaiter;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<string>);}text5 = taskAwaiter.GetResult();HttpHandler.logger_0.Debug("[CreateAnonAccount] Result: {0}.", text5);if (text5 != null && !text5.StartsWith("Error", StringComparison.OrdinalIgnoreCase)){HttpHandler.logger_0.Debug<string, string>("[CreateAnonAccount] Used anon account - Username: {0} Password: {1}.", text, text2);return new Account{Username = text,Password = text2};}}else{HttpHandler.logger_0.Info("[CreateAnonAccount] Unable to create anon account.");}text = null;text2 = null;text3 = null;}return null;}public async Task<Dictionary<int, Player>> GetPlayerList(int pages, int startPage, int maxLevel, IProgress<HttpHandler.HttpHandlerProgressReport> progress, CancellationToken token){HttpHandler.Class0 @class = new HttpHandler.Class0();@class.dictionary_0 = new Dictionary<int, Player>();bool flag = false;int num = startPage - 1;HttpHandler.logger_0.Info("[GetPlayerList] Getting playerlist.");TaskAwaiter<string> taskAwaiter2;int num2;while (!flag){HttpHandler.logger_0.Trace("[GetPlayerList] Page: {0}", num + 1);Cryptography cryptography = this.cryptography_0;string text = "PlayerGetHallOfFame";string[] array2;if (num != 0){string[] array = new string[4];array[0] = (30 * num + 15).ToString();array[1] = "";array[2] = "15";array2 = array;array[3] = "15";}else{string[] array3 = new string[4];array3[0] = "15";array3[1] = "";array3[2] = "15";array2 = array3;array3[3] = "15";}string text2 = cryptography.Encryption(text, array2);HttpHandler.logger_0.Trace("[GetPlayerList] Request paramter: {0}", text2);TaskAwaiter<string> taskAwaiter = this.method_0(this.method_2(text2), false).GetAwaiter();if (!taskAwaiter.IsCompleted){await taskAwaiter;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<string>);}string text3 = taskAwaiter.GetResult();string[] array4 = ((text3 != null) ? text3.Split(new char[] { '&' }) : null);Dictionary<int, Player> dictionary;if (array4 != null){text3 = text3.Replace("Ranklistplayer.r:", "").Trim(new char[] { ';' });HttpHandler.logger_0.Trace("[GetPlayerList] Result: {0}", text3);if (string.IsNullOrWhiteSpace(text3)){HttpHandler.logger_0.Error("[GetPlayerList] Server returned empty list, not searching further.");break;}string text4 = array4.Where(new Func<string, bool>(HttpHandler.<>c.<>c_0.method_0)).FirstOrDefault<string>();if (((text4 != null) ? text4.Replace("Ranklistplayer.r:", "").Trim(new char[] { ';' }).Split(new char[] { ';' }) : null).Select(new Func<string, long>(HttpHandler.<>c.<>c_0.method_1)).ToArray<long>().Max() <= (long)maxLevel){flag = true;}progress.Report(new HttpHandler.HttpHandlerProgressReport{ProgressType = "TARGETPAGE",CurrentProgressMessage = string.Format("Scanning Pages for Level {0} (Current Page {1})", maxLevel, num + 1)});if (!token.IsCancellationRequested){num2 = num;num = num2 + 1;continue;}HttpHandler.logger_0.Debug("[GetPlayerList] Cancelled, returning current playerlist.");dictionary = @class.dictionary_0;}else{HttpHandler.logger_0.Debug("[GetPlayerList] Result or data is null, aborting.");dictionary = null;}return dictionary;}HttpHandler.logger_0.Debug("[GetPlayerList] Progress evaluated playerlist.");for (int i = num - 1; i < num - 1 + pages; i = num2 + 1){HttpHandler.logger_0.Trace("[GetPlayerList] Page: {0}", num);Cryptography cryptography2 = this.cryptography_0;string text5 = "PlayerGetHallOfFame";string[] array6;if (i != 0){string[] array5 = new string[4];array5[0] = (30 * i + 15).ToString();array5[1] = "";array5[2] = "15";array6 = array5;array5[3] = "15";}else{string[] array7 = new string[4];array7[0] = "15";array7[1] = "";array7[2] = "15";array6 = array7;array7[3] = "15";}string text6 = cryptography2.Encryption(text5, array6);HttpHandler.logger_0.Trace("[GetPlayerList] Request paramter: {0}", text6);TaskAwaiter<string> taskAwaiter = this.method_0(this.method_2(text6), false).GetAwaiter();if (!taskAwaiter.IsCompleted){await taskAwaiter;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<string>);}string text7 = taskAwaiter.GetResult();if (text7 == null){HttpHandler.logger_0.Debug("[GetPlayerList] Result is null, aborting.");return null;}progress.Report(new HttpHandler.HttpHandlerProgressReport{CurrentProgressAmount = i - (num - 1),ProgressType = "PAGE",TotalProgressAmount = pages});string text8 = ((text7 != null) ? text7.Split(new char[] { '&' }) : null).Where(new Func<string, bool>(HttpHandler.<>c.<>c_0.method_2)).FirstOrDefault<string>();text7 = ((text8 != null) ? text8.Replace("Ranklistplayer.r:", "") : null);HttpHandler.logger_0.Trace("[GetPlayerList] Result: {0}", text7);TaskAwaiter<Dictionary<int, Player>> taskAwaiter3 = this.GetHoFListPlayers(text7, true, progress, token, new int[]{i,num - 1,pages}).GetAwaiter();if (!taskAwaiter3.IsCompleted){await taskAwaiter3;TaskAwaiter<Dictionary<int, Player>> taskAwaiter4;taskAwaiter3 = taskAwaiter4;taskAwaiter4 = default(TaskAwaiter<Dictionary<int, Player>>);}Dictionary<int, Player> result = taskAwaiter3.GetResult();HttpHandler.Class0 class2 = @class;IEnumerable<KeyValuePair<int, Player>> dictionary_ = @class.dictionary_0;Func<KeyValuePair<int, Player>, bool> func;if ((func = @class.func_0) == null){HttpHandler.Class0 class3 = @class;Func<KeyValuePair<int, Player>, bool> func2 = new Func<KeyValuePair<int, Player>, bool>(@class.method_0);class3.func_0 = func2;func = func2;}class2.dictionary_0 = dictionary_.Concat(result.Where(func)).ToDictionary(new Func<KeyValuePair<int, Player>, int>(HttpHandler.<>c.<>c_0.method_3), new Func<KeyValuePair<int, Player>, Player>(HttpHandler.<>c.<>c_0.method_4));if (token.IsCancellationRequested){HttpHandler.logger_0.Debug("[GetPlayerList] Cancelled, returning current playerlist.");return @class.dictionary_0;}num2 = i;}HttpHandler.logger_0.Debug("[GetPlayerList] Returning playerlist.");return @class.dictionary_0;}public async Task<Dictionary<int, Player>> GetHoFListPlayers(string result, bool load, IProgress<HttpHandler.HttpHandlerProgressReport> progress = null, CancellationToken token = default(CancellationToken), int[] progressValues = null){HttpHandler.logger_0.Info("[GetHoFListPlayers] Getting Hall of Fame playerlist.");HttpHandler.logger_0.Debug("[GetHoFListPlayers] Parsing result: {0}", result);Dictionary<int, Player> dictionary = new Dictionary<int, Player>();string[] array = result.Trim(new char[] { ';' }).Split(new char[] { ';' });Array.Resize<string>(ref array, array.Length - 1);List<string> list = array.Select(new Func<string, string>(HttpHandler.<>c.<>c_0.method_5)).ToList<string>();HttpHandler.logger_0.Debug("[GetHoFListPlayers] Player Names: {0}", string.Join(",", list.ToArray()));List<string> list2 = array.Select(new Func<string, string>(HttpHandler.<>c.<>c_0.method_6)).ToList<string>();HttpHandler.logger_0.Debug("[GetHoFListPlayers] Player Ranks: {0}", string.Join(",", list2.ToArray()));List<string> list3 = array.Select(new Func<string, string>(HttpHandler.<>c.<>c_0.method_7)).ToList<string>();HttpHandler.logger_0.Debug("[GetHoFListPlayers] Player Level: {0}", string.Join(",", list3.ToArray()));int i = 0;if (list.Count > 30){i = 1;}while (i < list.Count){try{Player player;int num;int num2;if (load){if (progressValues != null){if (progress != null){progress.Report(new HttpHandler.HttpHandlerProgressReport{CurrentProgressAmount = 30 * (progressValues[0] - progressValues[1]) + i,ProgressType = "PLAYER",TotalProgressAmount = 30 * progressValues[2],CurrentProgressMessage = list[i]});}}TaskAwaiter<Player> taskAwaiter = this.GetPlayer(list[i]).GetAwaiter();if (!taskAwaiter.IsCompleted){await taskAwaiter;TaskAwaiter<Player> taskAwaiter2;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<Player>);}player = taskAwaiter.GetResult();}else if (int.TryParse(list2[i], out num) & int.TryParse(list3[i], out num2)){player = new Player{Name = list[i],Rank = num,Level = num2,LoadingTime = DateTime.MinValue};}else{player = null;HttpHandler.logger_0.Error<string, string, string>("[GetHoFListPlayers] Unable to parse Name: {0} Ranke: {1} Level: {2}", list[i], list2[i], list3[i]);}if (player != null){dictionary.Add(int.Parse(list2[i]), player);}goto IL_394;}catch (Exception){HttpHandler.logger_0.Error("[GetHoFListPlayers] Exception occured");goto IL_394;}continue;IL_394:i++;}return dictionary;}public async Task<Dictionary<string, string>> GetClientTranslation(string language){HttpHandler.logger_0.Info("[GetClientTranslation] Getting client translation.");return JsonConvert.DeserializeObject<Dictionary<string, string>>(await this.method_0(string.Format("{0}/lang/sfgame_{1}.js?rnd={2}&client=flash%202.60.1072", this.string_11, language, this.method_4(0.0, 1.0)), false));}public async Task<Player> GetPlayer(string name){HttpHandler.logger_0.Trace("[GetPlayer] Getting player info.");string text = this.cryptography_0.Encryption("PlayerLookAt", new string[] { name });HttpHandler.logger_0.Trace("[GetPlayer] Request paramter: {0}.", text);string text2 = await this.method_0(this.method_2(text), false);HttpHandler.logger_0.Trace("[GetPlayer] Result: {0}.", text2);Player player;if (text2 == null){HttpHandler.logger_0.Debug("[GetPlayer] Result is null, aborting.");player = null;}else if (text2.Split(new char[] { '&' })[1].StartsWith("otherplayer.playerlookat:")){PlayerHandler playerHandler = new PlayerHandler(text2.Split(new char[] { '&' })[1].Replace("otherplayer.playerlookat:", ""), name);HttpHandler.logger_0.Trace("[GetPlayer] Player processed: {0}", name);player = playerHandler.GetPlayerData();}else{HttpHandler.logger_0.Debug("[GetPlayer] Result contains no success keyword, aborting.");player = null;}return player;}public async Task<List<ScrapbookEntry>> GetScrapbookEntries(Dictionary<string, string> translation, IProgress<HttpHandler.HttpHandlerProgressReport> progress){HttpHandler.logger_0.Debug("[GetScrapbookEntries] Reading scrapbook entries.");string text = this.cryptography_0.Encryption("PlayerPollScrapbook", new string[] { "" });HttpHandler.logger_0.Trace("[GetScrapbookEntries] Request paramter: {0}.", text);string text2 = await this.method_0(this.method_2(text), false);HttpHandler.logger_0.Trace("[GetScrapbookEntries] Result: {0}.", text2);List<ScrapbookEntry> list;if (text2 == null){HttpHandler.logger_0.Debug("[GetScrapbookEntries] Result is null, aborting.");list = null;}else{List<ScrapbookEntry> list2 = new Class3(translation, text2).method_0();HttpHandler.logger_0.Debug("[GetScrapbookEntries] Progressing scrapbook entries.");HttpHandler.logger_0.Debug("[GetScrapbookEntries] Returning scrapbook entries.");list = list2;}return list;}public async Task<List<Country>> GetCountriesAndServer(){HttpHandler.Class1 @class = new HttpHandler.Class1();HttpHandler.logger_0.Debug("[GetCountriesAndServer] Getting countries aqnd server.");@class.list_0 = new List<Country>();TaskAwaiter<string> taskAwaiter = this.method_0(string.Format("https://s1.sfgame.de/sfgame_cfg.php?rnd={0}&client=flash%202.60.1072&version=1bffceeb0a9e5a4df46e5cd2d4250308", this.method_4(0.0, 1.0)), false).GetAwaiter();if (!taskAwaiter.IsCompleted){await taskAwaiter;TaskAwaiter<string> taskAwaiter2;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<string>);}string result = taskAwaiter.GetResult();@class.string_0 = result;HttpHandler.logger_0.Debug("[GetCountriesAndServer] Result: {0}.", @class.string_0);List<Country> list;if (@class.string_0 != null){TaskAwaiter taskAwaiter3 = Task.Run(new Action(@class.method_0)).GetAwaiter();if (!taskAwaiter3.IsCompleted){await taskAwaiter3;TaskAwaiter taskAwaiter4;taskAwaiter3 = taskAwaiter4;taskAwaiter4 = default(TaskAwaiter);}taskAwaiter3.GetResult();HttpHandler.logger_0.Debug("[GetCountriesAndServer] Returning countries ordered by country code.");list = @class.list_0.OrderBy(new Func<Country, string>(HttpHandler.<>c.<>c_0.method_10)).ToList<Country>();}else{HttpHandler.logger_0.Debug("[GetCountriesAndServer] Result is null, aborting.");list = null;}return list;}private async Task<string> method_0(string string_14, bool bool_0){HttpHandler.logger_0.Trace("[HttpRequest] Execute http request.");HttpHandler.logger_0.Trace("[HttpRequest] URL: {0}.", string_14);HttpWebRequest httpWebRequest;try{httpWebRequest = WebRequest.Create(string_14) as HttpWebRequest;}catch (Exception ex){HttpHandler.logger_0.Error("[HttpRequest] {0}.", ex.Message);return null;}if (httpWebRequest != null){if (this.webProxy_0 != null){httpWebRequest.Proxy = this.webProxy_0;}httpWebRequest.MaximumAutomaticRedirections = 100;httpWebRequest.AllowAutoRedirect = true;httpWebRequest.Method = "GET";httpWebRequest.UserAgent = this.string_12;try{TaskAwaiter<WebResponse> taskAwaiter = httpWebRequest.GetResponseAsync().GetAwaiter();if (!taskAwaiter.IsCompleted){await taskAwaiter;TaskAwaiter<WebResponse> taskAwaiter2;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<WebResponse>);}HttpWebResponse httpWebResponse = taskAwaiter.GetResult() as HttpWebResponse;if (httpWebResponse != null && httpWebResponse.StatusCode == HttpStatusCode.OK){Stream responseStream = httpWebResponse.GetResponseStream();if (responseStream != null){StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);string text = streamReader.ReadToEnd();streamReader.Close();httpWebResponse.Close();try{if (bool_0){return (this.cryptography_0.Decryption(text, "") == "Error:sessionid invalid") ? null : this.cryptography_0.Decryption(text, "");}}catch (Exception){HttpHandler.logger_0.Warn("[HttpRequest] requested string seems not be encrypted.");}return (text == "Error:sessionid invalid") ? null : text;}}}catch (Exception ex2){HttpHandler.logger_0.Error("[HttpRequest] {0}.", ex2.Message);return null;}}HttpHandler.logger_0.Trace("[HttpRequest] Result is null, aborting.");return null;}public Session GetSession(){return this.session_0;}public Security GetSecurity(){return this.security_0;}public PlayerHandler GetPlayerHandler(){return this.playerHandler_0;}public async Task<bool> DownloadImageFile(string url){HttpHandler.logger_0.Trace("[DownloadImageFile] Downloading image.");string[] array = url.Split(new char[] { '/' });string text = array[array.Length - 1];string text2 = Path.Combine(HttpHandler.ImageFolder, text);HttpHandler.logger_0.Trace("[DownloadImageFile] Download URL: {0}.", url);HttpHandler.logger_0.Trace("[DownloadImageFile] Download destination: {0}.", text2);Directory.CreateDirectory(HttpHandler.ImageFolder);bool flag;if (flag = !File.Exists(text2)){flag = await this.method_1(url);}if (flag){using (WebClient webClient = new WebClient()){await webClient.DownloadFileTaskAsync(url, text2);return true;}}return false;}private async Task<bool> method_1(string string_14){HttpHandler.logger_0.Trace("[IsRessourceAviable] Checking ressource aviability.");HttpWebRequest httpWebRequest = WebRequest.Create(string_14) as HttpWebRequest;if (httpWebRequest != null){httpWebRequest.MaximumAutomaticRedirections = 100;httpWebRequest.AllowAutoRedirect = true;httpWebRequest.Method = "GET";httpWebRequest.UserAgent = this.string_12;try{TaskAwaiter<WebResponse> taskAwaiter = httpWebRequest.GetResponseAsync().GetAwaiter();if (!taskAwaiter.IsCompleted){await taskAwaiter;TaskAwaiter<WebResponse> taskAwaiter2;taskAwaiter = taskAwaiter2;taskAwaiter2 = default(TaskAwaiter<WebResponse>);}HttpWebResponse httpWebResponse = taskAwaiter.GetResult() as HttpWebResponse;if (httpWebResponse != null){httpWebResponse.Close();if (httpWebResponse.StatusCode == HttpStatusCode.OK){HttpHandler.logger_0.Trace("[IsRessourceAviable] StatusCode OK, returning true.");return true;}}}catch (Exception ex){HttpHandler.logger_0.Error("[IsRessourceAviable] Unable to progress request.");HttpHandler.logger_0.Error("[IsRessourceAviable] {0}", string_14);HttpHandler.logger_0.Error("[IsRessourceAviable] {0}", ex.Message);return false;}}HttpHandler.logger_0.Trace("[IsRessourceAviable] Request is null, returning false.");return false;}private string method_2(string string_14){return string.Format("{0}/req.php?req={1}&rnd={2}&c={3}", new object[]{this.string_11,string_14,this.method_4(0.0, 1.0),this.session_0.GetRequestCount()});}private string method_3(){return Hashing.GetSha1HashString(Hashing.GetSha1HashString(this.string_10, Security.PasswordSalt), this.session_0.GetLoginCount());}private string method_4(double double_0, double double_1){return (new Random().NextDouble() * (double_1 - double_0) + double_0).ToString(CultureInfo.CurrentCulture).Replace(",", ".");}private string method_5(int int_0){Random random = new Random(Environment.TickCount);string text = "0123456789abcdefghijklmnopqrstuvwxyz";StringBuilder stringBuilder = new StringBuilder(int_0);for (int i = 0; i < int_0; i++){stringBuilder.Append(text[random.Next(text.Length)]);}return stringBuilder.ToString();}private bool method_6(bool bool_0){Assembly assembly = Assembly.GetAssembly(typeof(SettingsSection));if (assembly != null){Type type = assembly.GetType("System.Net.Configuration.SettingsSectionInternal");if (type != null){object obj = type.InvokeMember("Section", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.GetProperty, null, null, new object[0]);if (obj != null){FieldInfo field = type.GetField("useUnsafeHeaderParsing", BindingFlags.Instance | BindingFlags.NonPublic);if (field != null){field.SetValue(obj, bool_0);return true;}}}}return false;}private static string string_0;private static string string_1;private static string string_2;private static string string_3;private static string string_4;private static string string_5;private static string string_6;private static string string_7;private static string string_8;private static readonly string string_9 = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);public static readonly string ImageFolder = Path.Combine(HttpHandler.string_9, "img");private static readonly Logger logger_0 = LogManager.GetCurrentClassLogger();private readonly string string_10;private readonly string string_11;private readonly string string_12;private readonly string string_13;private readonly WebProxy webProxy_0;private Cryptography cryptography_0;private PlayerHandler playerHandler_0;private RequestDecoder requestDecoder_0;private Security security_0;private Session session_0;public class HttpHandlerProgressReport{public HttpHandlerProgressReport(){}public int CurrentProgressAmount{[CompilerGenerated]get{return this.int_0;}[CompilerGenerated]set{this.int_0 = value;}}public int TotalProgressAmount{[CompilerGenerated]get{return this.int_1;}[CompilerGenerated]set{this.int_1 = value;}}public string ProgressType{[CompilerGenerated]get{return this.string_0;}[CompilerGenerated]set{this.string_0 = value;}}public string CurrentProgressMessage{[CompilerGenerated]get{return this.string_1;}[CompilerGenerated]set{this.string_1 = value;}}[CompilerGenerated]private int int_0;[CompilerGenerated]private int int_1;[CompilerGenerated]private string string_0;[CompilerGenerated]private string string_1;}[CompilerGenerated][Serializable]private sealed class <>c{// Note: this type is marked as 'beforefieldinit'.static <>c(){}public <>c(){}internal bool method_0(string string_0){return string_0.StartsWith("Ranklistplayer");}internal long method_1(string string_0){return Convert.ToInt64(string_0.Split(new char[] { ',' })[3]);}internal bool method_2(string string_0){return string_0.StartsWith("Ranklistplayer");}internal int method_3(KeyValuePair<int, Player> keyValuePair_0){return keyValuePair_0.Key;}internal Player method_4(KeyValuePair<int, Player> keyValuePair_0){return keyValuePair_0.Value;}internal string method_5(string string_0){return string_0.Split(new char[] { ',' })[1];}internal string method_6(string string_0){return string_0.Split(new char[] { ',' })[0];}internal string method_7(string string_0){return string_0.Split(new char[] { ',' })[3];}internal bool method_8(string string_0){return !Regex.Match(string_0, "^w\\d{1,}.").Success;}internal string method_9(string string_0){return string_0;}internal string method_10(Country country_0){return country_0.CountryCode;}public static readonly HttpHandler.<>c <>c_0 = new HttpHandler.<>c();public static Func<string, bool> func_0;public static Func<string, long> func_1;public static Func<string, bool> func_2;public static Func<KeyValuePair<int, Player>, int> func_3;public static Func<KeyValuePair<int, Player>, Player> func_4;public static Func<string, string> func_5;public static Func<string, string> func_6;public static Func<string, string> func_7;public static Func<string, bool> func_8;public static Func<string, string> func_9;public static Func<Country, string> func_10;}[CompilerGenerated]private sealed class Class0{public Class0(){}internal bool method_0(KeyValuePair<int, Player> keyValuePair_0){return !this.dictionary_0.ContainsKey(keyValuePair_0.Key);}public Dictionary<int, Player> dictionary_0;public Func<KeyValuePair<int, Player>, bool> func_0;}[CompilerGenerated]private sealed class Class1{public Class1(){}internal void method_0(){object obj = JsonConvert.DeserializeObject(this.string_0);if (HttpHandler.Class2.callSite_0 == null){HttpHandler.Class2.callSite_0 = CallSite<Func<CallSite, object, string, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.GetIndex(CSharpBinderFlags.None, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null)}));}object obj2 = HttpHandler.Class2.callSite_0.Target(HttpHandler.Class2.callSite_0, obj, "countries");if (HttpHandler.Class2.callSite_13 == null){HttpHandler.Class2.callSite_13 = CallSite<Func<CallSite, object, IEnumerable>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(IEnumerable), typeof(HttpHandler)));}foreach (object obj3 in HttpHandler.Class2.callSite_13.Target(HttpHandler.Class2.callSite_13, obj2)){if (HttpHandler.Class2.callSite_1 == null){HttpHandler.Class2.callSite_1 = CallSite<Func<CallSite, string, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Add, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)}));}object obj4 = HttpHandler.Class2.callSite_1.Target(HttpHandler.Class2.callSite_1, "worlds_", obj3);if (HttpHandler.Class2.callSite_2 == null){HttpHandler.Class2.callSite_2 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.GetIndex(CSharpBinderFlags.None, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)}));}object obj5 = HttpHandler.Class2.callSite_2.Target(HttpHandler.Class2.callSite_2, obj, obj4);if (HttpHandler.Class2.callSite_5 == null){HttpHandler.Class2.callSite_5 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(HttpHandler), new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) }));}Func<CallSite, object, bool> target = HttpHandler.Class2.callSite_5.Target;CallSite callSite_ = HttpHandler.Class2.callSite_5;if (HttpHandler.Class2.callSite_4 == null){HttpHandler.Class2.callSite_4 = CallSite<Func<CallSite, Dictionary<string, string>, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ContainsKey", null, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)}));}Func<CallSite, Dictionary<string, string>, object, object> target2 = HttpHandler.Class2.callSite_4.Target;CallSite callSite_2 = HttpHandler.Class2.callSite_4;Dictionary<string, string> fulleCountryNames = Country.FulleCountryNames;if (HttpHandler.Class2.callSite_3 == null){HttpHandler.Class2.callSite_3 = CallSite<Func<CallSite, Type, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)}));}if (target(callSite_, target2(callSite_2, fulleCountryNames, HttpHandler.Class2.callSite_3.Target(HttpHandler.Class2.callSite_3, typeof(Convert), obj3)))){if (HttpHandler.Class2.callSite_7 == null){HttpHandler.Class2.callSite_7 = CallSite<Func<CallSite, object, List<string>>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(List<string>), typeof(HttpHandler)));}Func<CallSite, object, List<string>> target3 = HttpHandler.Class2.callSite_7.Target;CallSite callSite_3 = HttpHandler.Class2.callSite_7;if (HttpHandler.Class2.callSite_6 == null){HttpHandler.Class2.callSite_6 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToObject", new Type[] { typeof(List<string>) }, typeof(HttpHandler), new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) }));}List<string> list = target3(callSite_3, HttpHandler.Class2.callSite_6.Target(HttpHandler.Class2.callSite_6, obj5));if (HttpHandler.Class2.callSite_9 == null){HttpHandler.Class2.callSite_9 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(HttpHandler), new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) }));}Func<CallSite, object, bool> target4 = HttpHandler.Class2.callSite_9.Target;CallSite callSite_4 = HttpHandler.Class2.callSite_9;if (HttpHandler.Class2.callSite_8 == null){HttpHandler.Class2.callSite_8 = CallSite<Func<CallSite, object, string, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.NotEqual, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null)}));}List<string> list2;if (!target4(callSite_4, HttpHandler.Class2.callSite_8.Target(HttpHandler.Class2.callSite_8, obj3, "00"))){list2 = list;}else{list2 = list.Where(new Func<string, bool>(HttpHandler.<>c.<>c_0.method_8)).ToList<string>();}List<string> list3 = list2;if (HttpHandler.Class2.callSite_12 == null){HttpHandler.Class2.callSite_12 = CallSite<Func<CallSite, Type, object, List<string>, Country>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeConstructor(CSharpBinderFlags.None, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null)}));}Func<CallSite, Type, object, List<string>, Country> target5 = HttpHandler.Class2.callSite_12.Target;CallSite callSite_5 = HttpHandler.Class2.callSite_12;Type typeFromHandle = typeof(Country);if (HttpHandler.Class2.callSite_11 == null){HttpHandler.Class2.callSite_11 = CallSite<Func<CallSite, Dictionary<string, string>, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.GetIndex(CSharpBinderFlags.None, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)}));}Func<CallSite, Dictionary<string, string>, object, object> target6 = HttpHandler.Class2.callSite_11.Target;CallSite callSite_6 = HttpHandler.Class2.callSite_11;Dictionary<string, string> fulleCountryNames2 = Country.FulleCountryNames;if (HttpHandler.Class2.callSite_10 == null){HttpHandler.Class2.callSite_10 = CallSite<Func<CallSite, Type, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(HttpHandler), new CSharpArgumentInfo[]{CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)}));}Country country = target5(callSite_5, typeFromHandle, target6(callSite_6, fulleCountryNames2, HttpHandler.Class2.callSite_10.Target(HttpHandler.Class2.callSite_10, typeof(Convert), obj3)), list3.OrderBy(new Func<string, string>(HttpHandler.<>c.<>c_0.method_9)).ToList<string>());this.list_0.Add(country);}}}public string string_0;public List<Country> list_0;}[CompilerGenerated]private static class Class2{public static CallSite<Func<CallSite, object, string, object>> callSite_0;public static CallSite<Func<CallSite, string, object, object>> callSite_1;public static CallSite<Func<CallSite, object, object, object>> callSite_2;public static CallSite<Func<CallSite, Type, object, object>> callSite_3;public static CallSite<Func<CallSite, Dictionary<string, string>, object, object>> callSite_4;public static CallSite<Func<CallSite, object, bool>> callSite_5;public static CallSite<Func<CallSite, object, object>> callSite_6;public static CallSite<Func<CallSite, object, List<string>>> callSite_7;public static CallSite<Func<CallSite, object, string, object>> callSite_8;public static CallSite<Func<CallSite, object, bool>> callSite_9;public static CallSite<Func<CallSite, Type, object, object>> callSite_10;public static CallSite<Func<CallSite, Dictionary<string, string>, object, object>> callSite_11;public static CallSite<Func<CallSite, Type, object, List<string>, Country>> callSite_12;public static CallSite<Func<CallSite, object, IEnumerable>> callSite_13;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct0 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;Account account;try{TaskAwaiter<string> taskAwaiter;if (num == 0){taskAwaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;goto IL_284;}if (num != 1){HttpHandler.logger_0.Info("[CreateAnonAccount] Creating Anon account.");this.int_1 = 0;goto IL_AA;}taskAwaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;goto IL_24F;IL_83:this.string_0 = null;this.string_1 = null;this.string_2 = null;int num2 = this.int_1;this.int_1 = num2 + 1;IL_AA:if (this.int_1 >= 3){account = null;goto IL_347;}HttpHandler.logger_0.Debug("[CreateAnonAccount] Try to create anon account: {0}.", this.int_1);this.string_0 = httpHandler.method_5(12);HttpHandler.logger_0.Debug("[CreateAnonAccount] Login name: {0}.", this.string_0);this.string_1 = httpHandler.method_5(12);HttpHandler.logger_0.Debug("[CreateAnonAccount] Password: {0}.", this.string_1);this.string_2 = httpHandler.method_5(12) + "@gmail.com";HttpHandler.logger_0.Debug("[CreateAnonAccount] E-Mail: {0}.", this.string_2);string text = httpHandler.cryptography_0.Encryption("AccountCheck", new string[] { this.string_0 });HttpHandler.logger_0.Debug("[CreateAnonAccount] Request parameter: {0}.", text);taskAwaiter = httpHandler.method_0(httpHandler.method_2(text), false).GetAwaiter();if (!taskAwaiter.IsCompleted){this.int_0 = 0;this.taskAwaiter_0 = taskAwaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct0>(ref taskAwaiter, ref this);return;}goto IL_284;IL_24F:string text2 = taskAwaiter.GetResult();HttpHandler.logger_0.Debug("[CreateAnonAccount] Result: {0}.", text2);if (text2 != null && !text2.StartsWith("Error", StringComparison.OrdinalIgnoreCase)){HttpHandler.logger_0.Debug<string, string>("[CreateAnonAccount] Used anon account - Username: {0} Password: {1}.", this.string_0, this.string_1);account = new Account{Username = this.string_0,Password = this.string_1};goto IL_347;}goto IL_83;IL_284:text2 = taskAwaiter.GetResult();HttpHandler.logger_0.Debug("[CreateAnonAccount] Result: {0}.", text2);if (text2 == null || text2.StartsWith("Error", StringComparison.OrdinalIgnoreCase)){HttpHandler.logger_0.Info("[CreateAnonAccount] Unable to create anon account.");goto IL_83;}HttpHandler.logger_0.Info("[CreateAnonAccount] Successfully created anon account.");text = httpHandler.cryptography_0.Encryption("AccountCreate", new string[] { this.string_0, this.string_1, this.string_2, "1", "3", "3", "1, 309, 303, 6, 305, 2, 2, 5, 0", "0", "sfgame_new_flash", "de" });HttpHandler.logger_0.Debug("[CreateAnonAccount] Request parameter: {0}.", text);taskAwaiter = httpHandler.method_0(httpHandler.method_2(text), false).GetAwaiter();if (taskAwaiter.IsCompleted){goto IL_24F;}this.int_0 = 1;this.taskAwaiter_0 = taskAwaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct0>(ref taskAwaiter, ref this);return;}catch (Exception ex){this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetException(ex);return;}IL_347:this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetResult(account);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<Account> asyncTaskMethodBuilder_0;public HttpHandler httpHandler_0;private int int_1;private string string_0;private string string_1;private string string_2;private TaskAwaiter<string> taskAwaiter_0;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct1 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;bool flag2;try{bool flag;TaskAwaiter<bool> awaiter;if (num != 0){if (num == 1){goto IL_118;}HttpHandler.logger_0.Trace("[DownloadImageFile] Downloading image.");string[] array = this.string_0.Split(new char[] { '/' });string text = array[array.Length - 1];this.string_1 = Path.Combine(HttpHandler.ImageFolder, text);HttpHandler.logger_0.Trace("[DownloadImageFile] Download URL: {0}.", this.string_0);HttpHandler.logger_0.Trace("[DownloadImageFile] Download destination: {0}.", this.string_1);Directory.CreateDirectory(HttpHandler.ImageFolder);if (!(flag = !File.Exists(this.string_1))){goto IL_106;}awaiter = httpHandler.method_1(this.string_0).GetAwaiter();if (!awaiter.IsCompleted){num = (this.int_0 = 0);this.taskAwaiter_0 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<bool>, HttpHandler.Struct1>(ref awaiter, ref this);return;}}else{awaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<bool>);num = (this.int_0 = -1);}flag = awaiter.GetResult();IL_106:if (!flag){goto IL_1A8;}this.webClient_0 = new WebClient();IL_118:try{TaskAwaiter awaiter2;if (num != 1){awaiter2 = this.webClient_0.DownloadFileTaskAsync(this.string_0, this.string_1).GetAwaiter();if (!awaiter2.IsCompleted){num = (this.int_0 = 1);this.taskAwaiter_1 = awaiter2;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter, HttpHandler.Struct1>(ref awaiter2, ref this);return;}}else{awaiter2 = this.taskAwaiter_1;this.taskAwaiter_1 = default(TaskAwaiter);num = (this.int_0 = -1);}awaiter2.GetResult();flag2 = true;goto IL_1CC;}finally{if (num < 0 && this.webClient_0 != null){((IDisposable)this.webClient_0).Dispose();}}IL_1A8:flag2 = false;}catch (Exception ex){this.int_0 = -2;this.string_1 = null;this.asyncTaskMethodBuilder_0.SetException(ex);return;}IL_1CC:this.int_0 = -2;this.string_1 = null;this.asyncTaskMethodBuilder_0.SetResult(flag2);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<bool> asyncTaskMethodBuilder_0;public string string_0;public HttpHandler httpHandler_0;private string string_1;private TaskAwaiter<bool> taskAwaiter_0;private WebClient webClient_0;private TaskAwaiter taskAwaiter_1;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct2 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;Dictionary<string, string> dictionary;try{TaskAwaiter<string> awaiter;if (num != 0){HttpHandler.logger_0.Info("[GetClientTranslation] Getting client translation.");awaiter = httpHandler.method_0(string.Format("{0}/lang/sfgame_{1}.js?rnd={2}&client=flash%202.60.1072", httpHandler.string_11, this.string_0, httpHandler.method_4(0.0, 1.0)), false).GetAwaiter();if (!awaiter.IsCompleted){this.int_0 = 0;this.taskAwaiter_0 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct2>(ref awaiter, ref this);return;}}else{awaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;}dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(awaiter.GetResult());}catch (Exception ex){this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetException(ex);return;}this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetResult(dictionary);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<Dictionary<string, string>> asyncTaskMethodBuilder_0;public HttpHandler httpHandler_0;public string string_0;private TaskAwaiter<string> taskAwaiter_0;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct3 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;List<Country> list;try{TaskAwaiter awaiter;TaskAwaiter<string> awaiter2;if (num != 0){if (num == 1){awaiter = this.taskAwaiter_1;this.taskAwaiter_1 = default(TaskAwaiter);this.int_0 = -1;goto IL_169;}this.class1_0 = new HttpHandler.Class1();HttpHandler.logger_0.Debug("[GetCountriesAndServer] Getting countries aqnd server.");this.class1_0.list_0 = new List<Country>();awaiter2 = httpHandler.method_0(string.Format("https://s1.sfgame.de/sfgame_cfg.php?rnd={0}&client=flash%202.60.1072&version=1bffceeb0a9e5a4df46e5cd2d4250308", httpHandler.method_4(0.0, 1.0)), false).GetAwaiter();if (!awaiter2.IsCompleted){this.int_0 = 0;this.taskAwaiter_0 = awaiter2;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct3>(ref awaiter2, ref this);return;}}else{awaiter2 = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;}string result = awaiter2.GetResult();this.class1_0.string_0 = result;HttpHandler.logger_0.Debug("[GetCountriesAndServer] Result: {0}.", this.class1_0.string_0);if (this.class1_0.string_0 == null){HttpHandler.logger_0.Debug("[GetCountriesAndServer] Result is null, aborting.");list = null;goto IL_1E9;}awaiter = Task.Run(new Action(this.class1_0.method_0)).GetAwaiter();if (!awaiter.IsCompleted){this.int_0 = 1;this.taskAwaiter_1 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter, HttpHandler.Struct3>(ref awaiter, ref this);return;}IL_169:awaiter.GetResult();HttpHandler.logger_0.Debug("[GetCountriesAndServer] Returning countries ordered by country code.");list = this.class1_0.list_0.OrderBy(new Func<Country, string>(HttpHandler.<>c.<>c_0.method_10)).ToList<Country>();}catch (Exception ex){this.int_0 = -2;this.class1_0 = null;this.asyncTaskMethodBuilder_0.SetException(ex);return;}IL_1E9:this.int_0 = -2;this.class1_0 = null;this.asyncTaskMethodBuilder_0.SetResult(list);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<List<Country>> asyncTaskMethodBuilder_0;public HttpHandler httpHandler_0;private HttpHandler.Class1 class1_0;private TaskAwaiter<string> taskAwaiter_0;private TaskAwaiter taskAwaiter_1;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct4 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;Dictionary<int, Player> dictionary;try{if (num != 0){HttpHandler.logger_0.Info("[GetHoFListPlayers] Getting Hall of Fame playerlist.");HttpHandler.logger_0.Debug("[GetHoFListPlayers] Parsing result: {0}", this.string_0);this.dictionary_0 = new Dictionary<int, Player>();string[] array = this.string_0.Trim(new char[] { ';' }).Split(new char[] { ';' });Array.Resize<string>(ref array, array.Length - 1);this.list_0 = array.Select(new Func<string, string>(HttpHandler.<>c.<>c_0.method_5)).ToList<string>();HttpHandler.logger_0.Debug("[GetHoFListPlayers] Player Names: {0}", string.Join(",", this.list_0.ToArray()));this.list_1 = array.Select(new Func<string, string>(HttpHandler.<>c.<>c_0.method_6)).ToList<string>();HttpHandler.logger_0.Debug("[GetHoFListPlayers] Player Ranks: {0}", string.Join(",", this.list_1.ToArray()));this.list_2 = array.Select(new Func<string, string>(HttpHandler.<>c.<>c_0.method_7)).ToList<string>();HttpHandler.logger_0.Debug("[GetHoFListPlayers] Player Level: {0}", string.Join(",", this.list_2.ToArray()));this.int_2 = 0;if (this.list_0.Count > 30){this.int_2 = 1;goto IL_37C;}goto IL_37C;}IL_197:try{TaskAwaiter<Player> awaiter;Player player;if (num != 0){if (this.bool_0){if (this.int_1 != null){IProgress<HttpHandler.HttpHandlerProgressReport> progress = this.iprogress_0;if (progress != null){progress.Report(new HttpHandler.HttpHandlerProgressReport{CurrentProgressAmount = 30 * (this.int_1[0] - this.int_1[1]) + this.int_2,ProgressType = "PLAYER",TotalProgressAmount = 30 * this.int_1[2],CurrentProgressMessage = this.list_0[this.int_2]});}}awaiter = httpHandler.GetPlayer(this.list_0[this.int_2]).GetAwaiter();if (!awaiter.IsCompleted){num = (this.int_0 = 0);this.taskAwaiter_0 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<Player>, HttpHandler.Struct4>(ref awaiter, ref this);return;}}else{int num2;int num3;if (int.TryParse(this.list_1[this.int_2], out num2) & int.TryParse(this.list_2[this.int_2], out num3)){player = new Player{Name = this.list_0[this.int_2],Rank = num2,Level = num3,LoadingTime = DateTime.MinValue};goto IL_341;}player = null;HttpHandler.logger_0.Error<string, string, string>("[GetHoFListPlayers] Unable to parse Name: {0} Ranke: {1} Level: {2}", this.list_0[this.int_2], this.list_1[this.int_2], this.list_2[this.int_2]);goto IL_341;}}else{awaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<Player>);num = (this.int_0 = -1);}player = awaiter.GetResult();IL_341:if (player != null){this.dictionary_0.Add(int.Parse(this.list_1[this.int_2]), player);}goto IL_394;}catch (Exception){HttpHandler.logger_0.Error("[GetHoFListPlayers] Exception occured");goto IL_394;}goto IL_37C;IL_394:int num4 = this.int_2;this.int_2 = num4 + 1;IL_37C:if (this.int_2 < this.list_0.Count){goto IL_197;}dictionary = this.dictionary_0;}catch (Exception ex){this.int_0 = -2;this.dictionary_0 = null;this.list_0 = null;this.list_1 = null;this.list_2 = null;this.asyncTaskMethodBuilder_0.SetException(ex);return;}this.int_0 = -2;this.dictionary_0 = null;this.list_0 = null;this.list_1 = null;this.list_2 = null;this.asyncTaskMethodBuilder_0.SetResult(dictionary);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<Dictionary<int, Player>> asyncTaskMethodBuilder_0;public string string_0;public bool bool_0;public int[] int_1;public IProgress<HttpHandler.HttpHandlerProgressReport> iprogress_0;public HttpHandler httpHandler_0;private Dictionary<int, Player> dictionary_0;private List<string> list_0;private List<string> list_1;private List<string> list_2;private int int_2;private TaskAwaiter<Player> taskAwaiter_0;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct5 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;Player player;try{TaskAwaiter<string> awaiter;if (num != 0){HttpHandler.logger_0.Trace("[GetPlayer] Getting player info.");string text = httpHandler.cryptography_0.Encryption("PlayerLookAt", new string[] { this.string_0 });HttpHandler.logger_0.Trace("[GetPlayer] Request paramter: {0}.", text);awaiter = httpHandler.method_0(httpHandler.method_2(text), false).GetAwaiter();if (!awaiter.IsCompleted){this.int_0 = 0;this.taskAwaiter_0 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct5>(ref awaiter, ref this);return;}}else{awaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;}string result = awaiter.GetResult();HttpHandler.logger_0.Trace("[GetPlayer] Result: {0}.", result);if (result == null){HttpHandler.logger_0.Debug("[GetPlayer] Result is null, aborting.");player = null;}else if (result.Split(new char[] { '&' })[1].StartsWith("otherplayer.playerlookat:")){PlayerHandler playerHandler = new PlayerHandler(result.Split(new char[] { '&' })[1].Replace("otherplayer.playerlookat:", ""), this.string_0);HttpHandler.logger_0.Trace("[GetPlayer] Player processed: {0}", this.string_0);player = playerHandler.GetPlayerData();}else{HttpHandler.logger_0.Debug("[GetPlayer] Result contains no success keyword, aborting.");player = null;}}catch (Exception ex){this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetException(ex);return;}this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetResult(player);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<Player> asyncTaskMethodBuilder_0;public HttpHandler httpHandler_0;public string string_0;private TaskAwaiter<string> taskAwaiter_0;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct6 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;Dictionary<int, Player> dictionary;try{TaskAwaiter<string> taskAwaiter;TaskAwaiter<Dictionary<int, Player>> awaiter;switch (num){case 0:taskAwaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;goto IL_2B7;case 1:taskAwaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;goto IL_510;case 2:awaiter = this.taskAwaiter_1;this.taskAwaiter_1 = default(TaskAwaiter<Dictionary<int, Player>>);this.int_0 = -1;goto IL_395;default:this.class0_0 = new HttpHandler.Class0();this.class0_0.dictionary_0 = new Dictionary<int, Player>();this.bool_0 = false;this.int_4 = this.int_1 - 1;HttpHandler.logger_0.Info("[GetPlayerList] Getting playerlist.");break;}IL_1E5:if (this.bool_0){goto IL_310;}HttpHandler.logger_0.Trace("[GetPlayerList] Page: {0}", this.int_4 + 1);Cryptography cryptography_ = httpHandler.cryptography_0;string text = "PlayerGetHallOfFame";string[] array2;if (this.int_4 != 0){string[] array = new string[4];array[0] = (30 * this.int_4 + 15).ToString();array[1] = "";array[2] = "15";array2 = array;array[3] = "15";}else{string[] array3 = new string[4];array3[0] = "15";array3[1] = "";array3[2] = "15";array2 = array3;array3[3] = "15";}string text2 = cryptography_.Encryption(text, array2);HttpHandler.logger_0.Trace("[GetPlayerList] Request paramter: {0}", text2);taskAwaiter = httpHandler.method_0(httpHandler.method_2(text2), false).GetAwaiter();if (!taskAwaiter.IsCompleted){this.int_0 = 0;this.taskAwaiter_0 = taskAwaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct6>(ref taskAwaiter, ref this);return;}IL_2B7:string text3 = taskAwaiter.GetResult();string[] array4 = ((text3 != null) ? text3.Split(new char[] { '&' }) : null);if (array4 == null){HttpHandler.logger_0.Debug("[GetPlayerList] Result or data is null, aborting.");dictionary = null;goto IL_6F0;}text3 = text3.Replace("Ranklistplayer.r:", "").Trim(new char[] { ';' });HttpHandler.logger_0.Trace("[GetPlayerList] Result: {0}", text3);int num2;if (!string.IsNullOrWhiteSpace(text3)){string text4 = array4.Where(new Func<string, bool>(HttpHandler.<>c.<>c_0.method_0)).FirstOrDefault<string>();if (((text4 != null) ? text4.Replace("Ranklistplayer.r:", "").Trim(new char[] { ';' }).Split(new char[] { ';' }) : null).Select(new Func<string, long>(HttpHandler.<>c.<>c_0.method_1)).ToArray<long>().Max() <= (long)this.int_2){this.bool_0 = true;}this.iprogress_0.Report(new HttpHandler.HttpHandlerProgressReport{ProgressType = "TARGETPAGE",CurrentProgressMessage = string.Format("Scanning Pages for Level {0} (Current Page {1})", this.int_2, this.int_4 + 1)});if (!this.cancellationToken_0.IsCancellationRequested){num2 = this.int_4;this.int_4 = num2 + 1;goto IL_1E5;}HttpHandler.logger_0.Debug("[GetPlayerList] Cancelled, returning current playerlist.");dictionary = this.class0_0.dictionary_0;goto IL_6F0;}else{HttpHandler.logger_0.Error("[GetPlayerList] Server returned empty list, not searching further.");}IL_310:HttpHandler.logger_0.Debug("[GetPlayerList] Progress evaluated playerlist.");this.int_5 = this.int_4 - 1;goto IL_436;IL_395:Dictionary<int, Player> result = awaiter.GetResult();HttpHandler.Class0 @class = this.class0_0;IEnumerable<KeyValuePair<int, Player>> dictionary_ = this.class0_0.dictionary_0;IEnumerable<KeyValuePair<int, Player>> enumerable = result;Func<KeyValuePair<int, Player>, bool> func;if ((func = this.class0_0.func_0) == null){func = (this.class0_0.func_0 = new Func<KeyValuePair<int, Player>, bool>(this.class0_0.method_0));}@class.dictionary_0 = dictionary_.Concat(enumerable.Where(func)).ToDictionary(new Func<KeyValuePair<int, Player>, int>(HttpHandler.<>c.<>c_0.method_3), new Func<KeyValuePair<int, Player>, Player>(HttpHandler.<>c.<>c_0.method_4));if (this.cancellationToken_0.IsCancellationRequested){HttpHandler.logger_0.Debug("[GetPlayerList] Cancelled, returning current playerlist.");dictionary = this.class0_0.dictionary_0;goto IL_6F0;}num2 = this.int_5;this.int_5 = num2 + 1;IL_436:if (this.int_5 >= this.int_4 - 1 + this.int_3){HttpHandler.logger_0.Debug("[GetPlayerList] Returning playerlist.");dictionary = this.class0_0.dictionary_0;goto IL_6F0;}HttpHandler.logger_0.Trace("[GetPlayerList] Page: {0}", this.int_4);Cryptography cryptography_2 = httpHandler.cryptography_0;string text5 = "PlayerGetHallOfFame";string[] array6;if (this.int_5 != 0){string[] array5 = new string[4];array5[0] = (30 * this.int_5 + 15).ToString();array5[1] = "";array5[2] = "15";array6 = array5;array5[3] = "15";}else{string[] array7 = new string[4];array7[0] = "15";array7[1] = "";array7[2] = "15";array6 = array7;array7[3] = "15";}string text6 = cryptography_2.Encryption(text5, array6);HttpHandler.logger_0.Trace("[GetPlayerList] Request paramter: {0}", text6);taskAwaiter = httpHandler.method_0(httpHandler.method_2(text6), false).GetAwaiter();if (!taskAwaiter.IsCompleted){this.int_0 = 1;this.taskAwaiter_0 = taskAwaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct6>(ref taskAwaiter, ref this);return;}IL_510:string text7 = taskAwaiter.GetResult();if (text7 != null){this.iprogress_0.Report(new HttpHandler.HttpHandlerProgressReport{CurrentProgressAmount = this.int_5 - (this.int_4 - 1),ProgressType = "PAGE",TotalProgressAmount = this.int_3});string text8 = ((text7 != null) ? text7.Split(new char[] { '&' }) : null).Where(new Func<string, bool>(HttpHandler.<>c.<>c_0.method_2)).FirstOrDefault<string>();text7 = ((text8 != null) ? text8.Replace("Ranklistplayer.r:", "") : null);HttpHandler.logger_0.Trace("[GetPlayerList] Result: {0}", text7);awaiter = httpHandler.GetHoFListPlayers(text7, true, this.iprogress_0, this.cancellationToken_0, new int[]{this.int_5,this.int_4 - 1,this.int_3}).GetAwaiter();if (!awaiter.IsCompleted){this.int_0 = 2;this.taskAwaiter_1 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<Dictionary<int, Player>>, HttpHandler.Struct6>(ref awaiter, ref this);return;}goto IL_395;}else{HttpHandler.logger_0.Debug("[GetPlayerList] Result is null, aborting.");dictionary = null;}}catch (Exception ex){this.int_0 = -2;this.class0_0 = null;this.asyncTaskMethodBuilder_0.SetException(ex);return;}IL_6F0:this.int_0 = -2;this.class0_0 = null;this.asyncTaskMethodBuilder_0.SetResult(dictionary);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<Dictionary<int, Player>> asyncTaskMethodBuilder_0;public int int_1;public HttpHandler httpHandler_0;public int int_2;public IProgress<HttpHandler.HttpHandlerProgressReport> iprogress_0;public CancellationToken cancellationToken_0;private HttpHandler.Class0 class0_0;public int int_3;private bool bool_0;private int int_4;private TaskAwaiter<string> taskAwaiter_0;private int int_5;private TaskAwaiter<Dictionary<int, Player>> taskAwaiter_1;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct7 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;List<ScrapbookEntry> list;try{TaskAwaiter<string> awaiter;if (num != 0){HttpHandler.logger_0.Debug("[GetScrapbookEntries] Reading scrapbook entries.");string text = httpHandler.cryptography_0.Encryption("PlayerPollScrapbook", new string[] { "" });HttpHandler.logger_0.Trace("[GetScrapbookEntries] Request paramter: {0}.", text);awaiter = httpHandler.method_0(httpHandler.method_2(text), false).GetAwaiter();if (!awaiter.IsCompleted){this.int_0 = 0;this.taskAwaiter_0 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct7>(ref awaiter, ref this);return;}}else{awaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;}string result = awaiter.GetResult();HttpHandler.logger_0.Trace("[GetScrapbookEntries] Result: {0}.", result);if (result == null){HttpHandler.logger_0.Debug("[GetScrapbookEntries] Result is null, aborting.");list = null;}else{List<ScrapbookEntry> list2 = new Class3(this.dictionary_0, result).method_0();HttpHandler.logger_0.Debug("[GetScrapbookEntries] Progressing scrapbook entries.");HttpHandler.logger_0.Debug("[GetScrapbookEntries] Returning scrapbook entries.");list = list2;}}catch (Exception ex){this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetException(ex);return;}this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetResult(list);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<List<ScrapbookEntry>> asyncTaskMethodBuilder_0;public HttpHandler httpHandler_0;public Dictionary<string, string> dictionary_0;private TaskAwaiter<string> taskAwaiter_0;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct8 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;string text;try{HttpWebRequest httpWebRequest;if (num != 0){HttpHandler.logger_0.Trace("[HttpRequest] Execute http request.");HttpHandler.logger_0.Trace("[HttpRequest] URL: {0}.", this.string_0);try{httpWebRequest = WebRequest.Create(this.string_0) as HttpWebRequest;}catch (Exception ex){HttpHandler.logger_0.Error("[HttpRequest] {0}.", ex.Message);text = null;goto IL_210;}if (httpWebRequest == null){goto IL_1E4;}if (httpHandler.webProxy_0 != null){httpWebRequest.Proxy = httpHandler.webProxy_0;}httpWebRequest.MaximumAutomaticRedirections = 100;httpWebRequest.AllowAutoRedirect = true;httpWebRequest.Method = "GET";httpWebRequest.UserAgent = httpHandler.string_12;}try{TaskAwaiter<WebResponse> awaiter;if (num != 0){awaiter = httpWebRequest.GetResponseAsync().GetAwaiter();if (!awaiter.IsCompleted){num = (this.int_0 = 0);this.taskAwaiter_0 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<WebResponse>, HttpHandler.Struct8>(ref awaiter, ref this);return;}}else{awaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<WebResponse>);num = (this.int_0 = -1);}HttpWebResponse httpWebResponse = awaiter.GetResult() as HttpWebResponse;if (httpWebResponse != null && httpWebResponse.StatusCode == HttpStatusCode.OK){Stream responseStream = httpWebResponse.GetResponseStream();if (responseStream != null){StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);string text2 = streamReader.ReadToEnd();streamReader.Close();httpWebResponse.Close();try{if (this.bool_0){text = ((httpHandler.cryptography_0.Decryption(text2, "") == "Error:sessionid invalid") ? null : httpHandler.cryptography_0.Decryption(text2, ""));goto IL_210;}}catch (Exception){HttpHandler.logger_0.Warn("[HttpRequest] requested string seems not be encrypted.");}text = ((text2 == "Error:sessionid invalid") ? null : text2);goto IL_210;}}}catch (Exception ex2){HttpHandler.logger_0.Error("[HttpRequest] {0}.", ex2.Message);text = null;goto IL_210;}IL_1E4:HttpHandler.logger_0.Trace("[HttpRequest] Result is null, aborting.");text = null;}catch (Exception ex3){this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetException(ex3);return;}IL_210:this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetResult(text);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<string> asyncTaskMethodBuilder_0;public string string_0;public HttpHandler httpHandler_0;public bool bool_0;private TaskAwaiter<WebResponse> taskAwaiter_0;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct9 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;bool flag;try{TaskAwaiter<string> taskAwaiter;string text;if (num != 0){if (num == 1){taskAwaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;goto IL_2B0;}if (httpHandler.method_6(true)){HttpHandler.logger_0.Debug("[InitializeSession] Enabled ToggleAllowUnsafeHeaderParsing.");}HttpHandler.logger_0.Info("[InitializeSession] Initialize a new session.");httpHandler.security_0 = new Security();HttpHandler.logger_0.Debug<string, string>("[InitializeSession] Security - Key: {0} ID: {1}.", Encoding.UTF8.GetString(httpHandler.security_0.GetKey()), httpHandler.security_0.Id);httpHandler.session_0 = new Session();HttpHandler.logger_0.Debug("[InitializeSession] Session - ID: {0}.", httpHandler.session_0.SessionId);httpHandler.requestDecoder_0 = new RequestDecoder(httpHandler.security_0, httpHandler.session_0);HttpHandler.logger_0.Info("[InitializeSession] RequestDecoder initialized.");httpHandler.cryptography_0 = new Cryptography(httpHandler.security_0, httpHandler.session_0);HttpHandler.logger_0.Info("[InitializeSession] Cryptography initialized.");text = httpHandler.cryptography_0.Encryption("AccountLogin", new string[]{httpHandler.string_13,httpHandler.method_3(),httpHandler.session_0.GetLoginCount(),"unity3d_webglplayer","","130000000000"});HttpHandler.logger_0.Debug("[InitializeSession] Request paramter: {0}", text);taskAwaiter = httpHandler.method_0(httpHandler.method_2(text), false).GetAwaiter();if (!taskAwaiter.IsCompleted){this.int_0 = 0;this.taskAwaiter_0 = taskAwaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct9>(ref taskAwaiter, ref this);return;}}else{taskAwaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<string>);this.int_0 = -1;}string text2 = taskAwaiter.GetResult();HttpHandler.logger_0.Debug("[InitializeSession] HttpRequest: {0}", text2);if (text2 == null || !httpHandler.requestDecoder_0.Accountlogin(text2)){HttpHandler.logger_0.Info("[InitializeSession] Unable to initialize a session.");flag = false;goto IL_330;}HttpHandler.logger_0.Info("[InitializeSession] Session successfully initialized.");text = httpHandler.cryptography_0.Encryption("AccountLogin", new string[]{httpHandler.string_13,httpHandler.method_3(),httpHandler.session_0.GetLoginCount(),"unity3d_webglplayer","","130000000000"});HttpHandler.logger_0.Debug("[InitializeSession] Request paramter: {0}", text);taskAwaiter = httpHandler.method_0(httpHandler.method_2(text), false).GetAwaiter();if (!taskAwaiter.IsCompleted){this.int_0 = 1;this.taskAwaiter_0 = taskAwaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<string>, HttpHandler.Struct9>(ref taskAwaiter, ref this);return;}IL_2B0:text2 = taskAwaiter.GetResult();HttpHandler.logger_0.Debug("[InitializeSession] Result: {0}", text2);if (text2 != null && httpHandler.requestDecoder_0.Accountlogin(text2)){httpHandler.playerHandler_0 = new PlayerHandler(text2, httpHandler.string_13);flag = httpHandler.requestDecoder_0.Accountlogin(text2);}else{flag = false;}}catch (Exception ex){this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetException(ex);return;}IL_330:this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetResult(flag);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<bool> asyncTaskMethodBuilder_0;public HttpHandler httpHandler_0;private TaskAwaiter<string> taskAwaiter_0;}[CompilerGenerated][StructLayout(LayoutKind.Auto)]private struct Struct10 : IAsyncStateMachine{void IAsyncStateMachine.MoveNext(){int num = this.int_0;HttpHandler httpHandler = this.httpHandler_0;bool flag;try{HttpWebRequest httpWebRequest;if (num != 0){HttpHandler.logger_0.Trace("[IsRessourceAviable] Checking ressource aviability.");httpWebRequest = WebRequest.Create(this.string_0) as HttpWebRequest;if (httpWebRequest == null){goto IL_134;}httpWebRequest.MaximumAutomaticRedirections = 100;httpWebRequest.AllowAutoRedirect = true;httpWebRequest.Method = "GET";httpWebRequest.UserAgent = httpHandler.string_12;}try{TaskAwaiter<WebResponse> awaiter;if (num != 0){awaiter = httpWebRequest.GetResponseAsync().GetAwaiter();if (!awaiter.IsCompleted){this.int_0 = 0;this.taskAwaiter_0 = awaiter;this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted<TaskAwaiter<WebResponse>, HttpHandler.Struct10>(ref awaiter, ref this);return;}}else{awaiter = this.taskAwaiter_0;this.taskAwaiter_0 = default(TaskAwaiter<WebResponse>);this.int_0 = -1;}HttpWebResponse httpWebResponse = awaiter.GetResult() as HttpWebResponse;if (httpWebResponse != null){httpWebResponse.Close();if (httpWebResponse.StatusCode == HttpStatusCode.OK){HttpHandler.logger_0.Trace("[IsRessourceAviable] StatusCode OK, returning true.");flag = true;goto IL_160;}}}catch (Exception ex){HttpHandler.logger_0.Error("[IsRessourceAviable] Unable to progress request.");HttpHandler.logger_0.Error("[IsRessourceAviable] {0}", this.string_0);HttpHandler.logger_0.Error("[IsRessourceAviable] {0}", ex.Message);flag = false;goto IL_160;}IL_134:HttpHandler.logger_0.Trace("[IsRessourceAviable] Request is null, returning false.");flag = false;}catch (Exception ex2){this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetException(ex2);return;}IL_160:this.int_0 = -2;this.asyncTaskMethodBuilder_0.SetResult(flag);}[DebuggerHidden]void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine){this.asyncTaskMethodBuilder_0.SetStateMachine(stateMachine);}public int int_0;public AsyncTaskMethodBuilder<bool> asyncTaskMethodBuilder_0;public string string_0;public HttpHandler httpHandler_0;private TaskAwaiter<WebResponse> taskAwaiter_0;}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment