public void method_9() { if (!this.bool_9) { this.bool_9 = true; GoldTree.GetGame().GetClientManager().method_1(this.Id, this.Username); if (!this.bool_16) { this.bool_16 = true; this.Online = false; using (DatabaseClient @class = GoldTree.GetDatabase().GetClient()) { @class.ExecuteQuery(string.Concat(new object[] { "UPDATE users SET last_online = UNIX_TIMESTAMP(), users.online = '0', activity_points = '", this.ActivityPoints, "', activity_points_lastupdate = '", this.LastActivityPointsUpdate, "', credits = '", this.Credits, "' WHERE Id = '", this.Id, "' LIMIT 1;" })); int num = (int)GoldTree.GetUnixTimestamp() - this.int_16; @class.ExecuteQuery(string.Concat(new object[] { "UPDATE user_stats SET RoomVisits = '", this.RoomVisits, "', OnlineTime = OnlineTime + ", num, ", Respect = '", this.Respect, "', RespectGiven = '", this.RespectGiven, "', GiftsGiven = '", this.GiftsGiven, "', GiftsReceived = '", this.GiftsReceived, "', FootballGoalScorer = '", this.FootballGoalScorer, "', FootballGoalHost = '", this.FootballGoalHost, "', TilesLocked = '", this.TilesLocked, "', staff_picks = '", this.StaffPicks, "' WHERE Id = '", this.Id, "' LIMIT 1; " })); } } if (this.InRoom && this.CurrentRoom != null) { this.CurrentRoom.method_47(this.Session, false, false); } if (this.class105_0 != null) { this.class105_0.bool_0 = true; this.class105_0.method_5(true); this.class105_0 = null; } if (this.class53_0 != null) { this.class53_0.method_0(); this.class53_0 = null; } this.InventoryComponent.method_18(); } }
public Habbo(uint UserId, string Username, string Name, string SSO, uint Rank, string Motto, string Look, string Gender, int Credits, int Pixels, double Activity_Points_LastUpdate, string DataCadastro, bool Muted, uint HomeRoom, int NewbieStatus, bool BlockNewFriends, bool HideInRoom, bool HideOnline, bool Vip, int Volume, int Points, bool AcceptTrading, string LastIp, GameClient Session, UserDataFactory userDataFactory, string last_online, int daily_respect_points, int daily_pet_respect_points, double vipha_last, double viphal_last, bool FriendStream) { if (Session != null) { GoldTree.GetGame().GetClientManager().method_0(UserId, Username, Session); } this.Id = UserId; this.Username = Username; this.RealName = Name; this.isJuniori = false; this.isVisible = true; this.SSO = SSO; this.Rank = Rank; this.Motto = Motto; this.Figure = GoldTree.FilterString(Look.ToLower()); this.Gender = Gender.ToLower(); this.Credits = Credits; this.VipPoints = Points; this.ActivityPoints = Pixels; this.LastActivityPointsUpdate = Activity_Points_LastUpdate; this.bool_2 = AcceptTrading; this.bool_3 = Muted; this.uint_2 = 0u; this.bool_5 = false; this.bool_6 = false; this.CurrentRoomId = 0u; this.uint_4 = HomeRoom; this.list_1 = new List<uint>(); this.list_2 = new List<uint>(); this.list_3 = new List<string>(); this.dictionary_0 = new Dictionary<uint, int>(); this.list_4 = new List<uint>(); this.NewbieStatus = NewbieStatus; this.bool_10 = false; this.BlockNewFriends = BlockNewFriends; this.HideInRom = HideInRoom; this.HideOnline = HideOnline; this.Vip = Vip; this.Volume = Volume; this.int_1 = 0; this.int_24 = 1; this.LastIp = LastIp; this.bool_7 = false; this.uint_5 = 0u; this.Session = Session; this.UserDataFactory = userDataFactory; this.list_6 = new List<RoomData>(); this.list_0 = new List<int>(); this.DataCadastro = DataCadastro; this.last_loggedin = last_online; this.Online = true; this.daily_respect_points = daily_respect_points; this.daily_pet_respect_points = daily_pet_respect_points; this.vipha_last = vipha_last; this.viphal_last = viphal_last; this.FriendStreamEnabled = FriendStream; DataRow dataRow = null; using (DatabaseClient @class = GoldTree.GetDatabase().GetClient()) { @class.AddParamWithValue("user_id", UserId); dataRow = @class.ReadDataRow("SELECT * FROM user_stats WHERE Id = @user_id LIMIT 1"); if (dataRow == null) { @class.ExecuteQuery("INSERT INTO user_stats (Id) VALUES ('" + UserId + "')"); dataRow = @class.ReadDataRow("SELECT * FROM user_stats WHERE Id = @user_id LIMIT 1"); } this.dataTable_0 = @class.ReadDataTable("SELECT * FROM group_memberships WHERE userid = @user_id"); IEnumerator enumerator; if (this.dataTable_0 != null) { enumerator = this.dataTable_0.Rows.GetEnumerator(); try { while (enumerator.MoveNext()) { DataRow dataRow2 = (DataRow)enumerator.Current; GroupsManager class2 = Groups.smethod_2((int)dataRow2["groupid"]); if (class2 == null) { DataTable dataTable = @class.ReadDataTable("SELECT * FROM groups WHERE Id = " + (int)dataRow2["groupid"] + " LIMIT 1;"); IEnumerator enumerator2 = dataTable.Rows.GetEnumerator(); try { while (enumerator2.MoveNext()) { DataRow dataRow3 = (DataRow)enumerator2.Current; if (!Groups.GroupsManager.ContainsKey((int)dataRow3["Id"])) { Groups.GroupsManager.Add((int)dataRow3["Id"], new GroupsManager((int)dataRow3["Id"], dataRow3, @class)); } } continue; } finally { IDisposable disposable = enumerator2 as IDisposable; if (disposable != null) { disposable.Dispose(); } } } if (!class2.list_0.Contains((int)UserId)) { class2.method_0((int)UserId); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } int num = (int)dataRow["groupid"]; GroupsManager class3 = Groups.smethod_2(num); if (class3 != null) { this.int_0 = num; } else { this.int_0 = 0; } } else { this.int_0 = 0; } DataTable dataTable2 = @class.ReadDataTable("SELECT groupid FROM group_requests WHERE userid = '" + UserId + "';"); enumerator = dataTable2.Rows.GetEnumerator(); try { while (enumerator.MoveNext()) { DataRow dataRow2 = (DataRow)enumerator.Current; this.list_0.Add((int)dataRow2["groupid"]); } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } } this.RoomVisits = (int)dataRow["RoomVisits"]; this.int_16 = (int)GoldTree.GetUnixTimestamp(); this.int_15 = (int)dataRow["OnlineTime"]; this.Respect = (int)dataRow["Respect"]; this.RespectGiven = (int)dataRow["RespectGiven"]; this.GiftsGiven = (int)dataRow["GiftsGiven"]; this.FireworkPixelLoadedCount = (int)dataRow["fireworks"]; this.GiftsReceived = (int)dataRow["GiftsReceived"]; this.int_21 = (int)dataRow["DailyRespectPoints"]; this.int_22 = (int)dataRow["DailyPetRespectPoints"]; this.AchievementScore = (int)dataRow["AchievementScore"]; this.CompletedQuests = new List<uint>(); this.uint_7 = 0u; this.CurrentQuestId = (uint)dataRow["quest_id"]; this.CurrentQuestProgress = (int)dataRow["quest_progress"]; this.int_6 = (int)dataRow["lev_builder"]; this.int_8 = (int)dataRow["lev_identity"]; this.int_7 = (int)dataRow["lev_social"]; this.int_9 = (int)dataRow["lev_explore"]; this.RegularVisitor = (int)dataRow["RegularVisitor"]; this.FootballGoalScorer = (int)dataRow["FootballGoalScorer"]; this.FootballGoalHost = (int)dataRow["FootballGoalHost"]; this.TilesLocked = (int)dataRow["TilesLocked"]; this.StaffPicks = (int)dataRow["staff_picks"]; if (Session != null) { this.class53_0 = new SubscriptionManager(UserId, userDataFactory); this.class56_0 = new BadgeComponent(UserId, userDataFactory); this.InventoryComponent = new InventoryComponent(UserId, Session, userDataFactory); this.class50_0 = new AvatarEffectsInventoryComponent(UserId, Session, userDataFactory); this.bool_8 = false; this.bool_9 = false; foreach (DataRow dataRow3 in userDataFactory.DataTable_10.Rows) { this.list_6.Add(GoldTree.GetGame().GetRoomManager().method_17((uint)dataRow3["Id"], dataRow3)); } } }