public static string GetPlayerFigure(string PlayerName, HHotels Hotel) { using (WebClient WC = new WebClient()) { WC.Headers["Cookie"] = GetIPCookie(); WC.Headers["User-Agent"] = ChromeAgent; string Body = WC.DownloadString(Hotel.ToURL() + "/habblet/habbosearchcontent?searchString=" + PlayerName); return(string.Empty); } }
public static Bitmap GetPlayerAvatar(string PlayerName, HHotels Hotel) { using (WebClient WC = new WebClient()) { WC.Headers["Cookie"] = GetIPCookie(); WC.Headers["User-Agent"] = ChromeAgent; byte[] AvatarData = WC.DownloadData(Hotel.ToURL() + "/habbo-imaging/avatarimage?user="******"&action=&direction=&head_direction=&gesture=&size="); using (MemoryStream MS = new MemoryStream(AvatarData)) return(new Bitmap(MS)); } }
public static string GetPlayerMotto(string PlayerName, HHotels Hotel) { using (WebClient WC = new WebClient()) { WC.Headers["Cookie"] = GetIPCookie(); WC.Headers["User-Agent"] = ChromeAgent; string Body = WC.DownloadString(Hotel.ToURL() + "/habblet/habbosearchcontent?searchString=" + PlayerName); if (Body.IndexOf(PlayerName, StringComparison.OrdinalIgnoreCase) != -1) { return(Body.GetChild("<b>" + PlayerName + "</b><br />", '<')); } return(string.Empty); } }
public static string GetPlayerName(int PlayerID, HHotels Hotel) { using (WebClient WC = new WebClient()) { WC.Headers["Cookie"] = GetIPCookie(); WC.Headers["User-Agent"] = ChromeAgent; string Body = WC.DownloadString(string.Format("{0}/rd/{1}", Hotel.ToURL(), PlayerID)); if (Body.Contains("/home/")) { return(Body.GetChild("<input type=\"hidden\" name=\"page\" value=\"/home/", '?')); } return(string.Empty); } }
public static int GetPlayerID(string PlayerName, HHotels Hotel) { using (WebClient WC = new WebClient()) { WC.Headers["Cookie"] = GetIPCookie(); WC.Headers["User-Agent"] = ChromeAgent; string Body = WC.DownloadString(Hotel.ToURL() + "/habblet/ajax/new_habboid?habboIdName=" + PlayerName); if (!Body.Contains("rounded rounded-red")) { return(int.Parse(Body.GetChild("<em>", '<').Replace(" ", string.Empty))); } return(-1); } }
public static int GetPlayersOnline(HHotels Hotel) { using (WebClient WC = new WebClient()) { WC.Headers["Cookie"] = GetIPCookie(); WC.Headers["User-Agent"] = ChromeAgent; string Body = WC.DownloadString(Hotel.ToURL() + "/login_popup"); if (Body.Contains("stats-fig")) { return(int.Parse(Body.GetChild("<span class=\"stats-fig\">", '<'))); } return(-1); } }
public HSession(string Cookies, HHotels Hotel) { this.Hotel = Hotel; DisconnectLock = new object(); this.Cookies = new CookieContainer(); this.Cookies.SetCookies(new Uri(Hotel.ToURL()), Cookies); _Login = Login; _AddFriend = AddFriend; _RemoveFriend = RemoveFriend; _UpdateProfile = UpdateProfile; LoginCallbacks = new Dictionary <IAsyncResult, LoginCallback>(); AddFriendCallbacks = new Dictionary <IAsyncResult, AddFriendCallback>(); RemoveFriendCallbacks = new Dictionary <IAsyncResult, RemoveFriendCallback>(); UpdateProfileCallbacks = new Dictionary <IAsyncResult, UpdateProfileCallback>(); }
public static string GetPlayerLastOnline(string PlayerName, HHotels Hotel, bool Exact = true) { using (WebClient WC = new WebClient()) { WC.Headers["Cookie"] = GetIPCookie(); WC.Headers["User-Agent"] = ChromeAgent; string Body = WC.DownloadString(Hotel.ToURL() + "/habblet/habbosearchcontent?searchString=" + PlayerName); if (Body.Contains("lastlogin")) { Body = Body.GetChild("<div class=\"lastlogin\">").GetChild("span title="); if (Exact) { return(Body.Split('"')[1]); } else { return(Body.Split('>')[1].Split('<')[0]); } } return(string.Empty); } }
public static string Juice(this HPages Page, HHotels Hotel) { switch (Page) { case HPages.Client: return(Hotel.ToURL() + "/client"); case HPages.Home: return(Hotel.ToURL() + "/home/"); case HPages.IDAvatars: return(Hotel.ToURL() + "/identity/avatars"); case HPages.IDSettings: return(Hotel.ToURL() + "/identity/settings"); case HPages.Me: return(Hotel.ToURL() + "/me"); case HPages.Profile: return(Hotel.ToURL() + "/profile"); default: return(string.Empty); } }