Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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));
     }
 }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
 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);
     }
 }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
        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>();
        }
Ejemplo n.º 9
0
 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);
     }
 }
Ejemplo n.º 10
0
 public static bool CheckPlayerName(string PlayerName, HHotels Hotel)
 {
     return(GetPlayerID(PlayerName, Hotel) == -1);
 }
Ejemplo n.º 11
0
 public static string ToURL(this HHotels Hotel, bool HTTPS = false)
 {
     return((HTTPS ? "https://www.Habbo." : "http://www.Habbo.") + Hotel.ToDomain());
 }
Ejemplo n.º 12
0
 public static string ToDomain(this HHotels Hotel)
 {
     return(Hotel.ToString().Replace('_', '.'));
 }
Ejemplo n.º 13
0
 public HSession(string Email, string Password, HHotels Hotel)
     : this(SKore.GetIPCookie(), Hotel)
 {
     this.Email    = Email;
     this.Password = Password;
 }