using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using DuckEmulator.HabboHotel.Inside.Storage.MySql.Database.Interfaces; namespace DuckEmulator.HabboHotel.Outside.Habbos { sealed class HabboManager { internal static HabboData GenerateFromTicket(string Ticket) { if (Ticket == "") return null; HabboData dotDat = null; DataRow Row = null; using (IQueryAdapter Adapter = DuckEnvironment.GetAdapter()) { Adapter.setQuery("SELECT * FROM users WHERE sso_ticket = '" + Ticket.ToLower() + "' LIMIT 1"); Row = Adapter.getRow(); } if (Row != null) { dotDat = new HabboData( uint.Parse(Row["id"].ToString()), Row["username"].ToString(), Row["email"].ToString(), int.Parse(Row["rank"].ToString()), Row["motto"].ToString(), Row["look"].ToString(), Row["gender"].ToString().ToUpper(), int.Parse(Row["credits"].ToString()), int.Parse(Row["pixels"].ToString()), int.Parse(Row["score"].ToString()), int.Parse(Row["respect"].ToString()), int.Parse(Row["daily_respect"].ToString()), int.Parse(Row["daily_respect_pet"].ToString()), uint.Parse(Row["home_room"].ToString()), int.Parse(Row["timeonline"].ToString()), int.Parse(Row["room_visits"].ToString()), Row["respect_update"].ToString(), int.Parse(Row["respect_given"].ToString()), int.Parse(Row["following_logins"].ToString()), int.Parse(Row["login_day"].ToString()), int.Parse(Row["time_inroom"].ToString()), int.Parse(Row["furni_count"].ToString()), int.Parse(Row["furni_count_unsigned"].ToString()), int.Parse(Row["icetag_time"].ToString()), int.Parse(Row["icetag_perks"].ToString()), uint.Parse(Row["current_quest_id"].ToString()), int.Parse(Row["current_quest_progress"].ToString())); } else { DuckEnvironment.WriteLine("INVALID SSOTICKET", ConsoleColor.Red); } return dotDat; } } }