internal void SerializeOpenTickets(ref QueuedServerMessage serverMessages, uint userID) { foreach (SupportTicket ticket in Tickets) { if (ticket.Status == TicketStatus.OPEN || (ticket.Status == TicketStatus.PICKED && ticket.ModeratorId == userID) || (ticket.Status == TicketStatus.PICKED && ticket.ModeratorId == null)) { serverMessages.appendResponse(ticket.Serialize()); } } }
internal void SerializeOpenTickets(ref QueuedServerMessage serverMessages, uint userID) { ServerMessage message = new ServerMessage(Outgoing.ModerationToolIssueMessageComposer); foreach (SupportTicket current in this.Tickets) { if (current.Status == TicketStatus.OPEN || (current.Status == TicketStatus.PICKED && current.ModeratorId == userID) || (current.Status == TicketStatus.PICKED && current.ModeratorId == 0u)) { message = current.Serialize(message); serverMessages.appendResponse(message); } } }
internal bool tryLogin(string AuthTicket) { int loginProgress = 0; try { string ip = GetConnection().getIp(); byte errorCode = 0; UserData userData = UserDataFactory.GetUserData(AuthTicket, ip, out errorCode); if (errorCode == 1) { SendNotifWithScroll(LanguageLocale.GetValue("login.invalidsso")); return(false); } else if (errorCode == 2) { SendNotifWithScroll(LanguageLocale.GetValue("login.loggedin")); return(false); } loginProgress++; FirewindEnvironment.GetGame().GetClientManager().RegisterClient(this, userData.userID, userData.user.Username); this.Habbo = userData.user; userData.user.LoadData(userData); loginProgress++; if (userData.user.Username == null) { SendBanMessage("You have no username."); return(false); } string banReason = FirewindEnvironment.GetGame().GetBanManager().GetBanReason(userData.user.Username, ip); loginProgress++; if (!string.IsNullOrEmpty(banReason)) { SendBanMessage(banReason); return(false); } userData.user.Init(this, userData); QueuedServerMessage response = new QueuedServerMessage(Connection); ServerMessage UniqueId = new ServerMessage(Outgoing.UniqueID); UniqueId.AppendString(this.MachineId); response.appendResponse(UniqueId); ServerMessage authok = new ServerMessage(Outgoing.AuthenticationOK); response.appendResponse(authok); ServerMessage HomeRoom = new ServerMessage(Outgoing.HomeRoom); HomeRoom.AppendUInt(this.GetHabbo().HomeRoom); // first home HomeRoom.AppendUInt(this.GetHabbo().HomeRoom); // first home SendMessage(HomeRoom); loginProgress++; ServerMessage FavouriteRooms = new ServerMessage(Outgoing.FavouriteRooms); FavouriteRooms.AppendInt32(30); // max rooms FavouriteRooms.AppendInt32(userData.user.FavoriteRooms.Count); foreach (uint Id in userData.user.FavoriteRooms.ToArray()) { FavouriteRooms.AppendUInt(Id); } response.appendResponse(FavouriteRooms); loginProgress++; ServerMessage fuserights = new ServerMessage(Outgoing.Fuserights); if (GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip")) // VIP { fuserights.AppendInt32(2); } else if (GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club")) // HC { fuserights.AppendInt32(1); } else { fuserights.AppendInt32(0); } fuserights.AppendUInt(this.GetHabbo().Rank); response.appendResponse(fuserights); loginProgress++; ServerMessage bools1 = new ServerMessage(Outgoing.AvailabilityStatus); bools1.AppendBoolean(true); bools1.AppendBoolean(false); response.appendResponse(bools1); ServerMessage bools2 = new ServerMessage(Outgoing.InfoFeedEnable); bools2.AppendBoolean(false); response.appendResponse(bools2); loginProgress++; ServerMessage setRanking = new ServerMessage(Outgoing.SerializeCompetitionWinners); setRanking.AppendString("hlatCompetitions"); // competition type setRanking.AppendInt32(Ranking.getCompetitionForInfo("hlatCompetitions").Count); loginProgress++; int i = 0; foreach (Ranking r in Ranking.getCompetitionForInfo("hlatCompetitions")) { i++; setRanking.AppendUInt(r.UserId); Habbo data = FirewindEnvironment.getHabboForId(r.UserId); setRanking.AppendString((data != null) ? data.Username : "******"); setRanking.AppendString((data != null) ? data.Look : "sh-907-96.hd-3096-3.he-3082-91.lg-3018-81.ch-660-95.hr-9534-34"); setRanking.AppendInt32(i); // position setRanking.AppendInt32(r.Score); } response.appendResponse(setRanking); loginProgress++; if (userData.user.HasFuse("fuse_mod")) { this.SendMessage(FirewindEnvironment.GetGame().GetModerationTool().SerializeTool()); FirewindEnvironment.GetGame().GetModerationTool().SerializeOpenTickets(ref response, userData.userID); } if (LanguageLocale.welcomeAlertEnabled) { this.SendMOTD(LanguageLocale.welcomeAlert); } loginProgress++; using (IQueryAdapter db = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { db.setQuery("UPDATE users SET online = '1' WHERE id = @id"); db.addParameter("id", this.GetHabbo().Id); db.runQuery(); } loginProgress++; // Send the big chunk response.sendResponse(); // fire the event! FirewindEnvironment.GetGame().GetClientManager().ClientLoggedIn(this); return(true); } catch (UserDataNotFoundException e) { SendNotifWithScroll(LanguageLocale.GetValue("login.invalidsso") + "extra data: " + e.ToString()); } catch (Exception e) { Logging.LogCriticalException(String.Format("Invalid Dario bug duing user login (progress = {0}): ", loginProgress) + e.ToString()); SendNotifWithScroll("Login error: " + e.ToString()); } return(false); }
internal bool tryLogin(string AuthTicket) { try { if (GetConnection() == null) { return(false); } var userData = UserDataFactory.GetUserData(AuthTicket); if (userData == null) { this.Disconnect(); return(false); } OtanixEnvironment.GetGame().GetClientManager().RegisterClient(this, userData.user.Id, userData.user.Username); Habbo = userData.user; if (userData.user.Username == null || GetHabbo() == null) { SendBanMessage("Você não possui um nome."); return(false); } userData.user.Init(userData); Habbo.MachineId = MachineId; var response = new QueuedServerMessage(Connection); var authok = new ServerMessage(Outgoing.AuthenticationOK); response.appendResponse(authok); var HomeRoom = new ServerMessage(Outgoing.HomeRoom); HomeRoom.AppendUInt((OtanixEnvironment.GetGame().GetPrisaoManager().estaPreso(GetHabbo().Id)) ? OtanixEnvironment.prisaoId() : GetHabbo().HomeRoom); // first home HomeRoom.AppendUInt((OtanixEnvironment.GetGame().GetPrisaoManager().estaPreso(GetHabbo().Id)) ? OtanixEnvironment.prisaoId() : GetHabbo().HomeRoom); // current home response.appendResponse(HomeRoom); var FavouriteRooms = new ServerMessage(Outgoing.FavouriteRooms); FavouriteRooms.AppendInt32(30); // max rooms FavouriteRooms.AppendInt32(userData.user.FavoriteRooms.Count); foreach (var Id in userData.user.FavoriteRooms.ToArray()) { FavouriteRooms.AppendUInt(Id); } response.appendResponse(FavouriteRooms); var sendClub = new ServerMessage(Outgoing.SerializeClub); sendClub.AppendString("club_habbo"); sendClub.AppendInt32(0); // days left sendClub.AppendInt32(0); // days multiplier sendClub.AppendInt32(0); // months left sendClub.AppendInt32(0); // ??? sendClub.AppendBoolean(true); // HC PRIVILEGE sendClub.AppendBoolean(true); // VIP PRIVILEGE sendClub.AppendInt32(0); // days i have on hc sendClub.AppendInt32(0); // days i've purchased sendClub.AppendInt32(495); // value 4 groups response.appendResponse(sendClub); var roomAccessConfig = new ServerMessage(Outgoing.RoomAccessConfig); roomAccessConfig.AppendBoolean(true); // isOpen roomAccessConfig.AppendBoolean(false); roomAccessConfig.AppendBoolean(true); response.appendResponse(roomAccessConfig); var fuserights = new ServerMessage(Outgoing.Fuserights); fuserights.AppendInt32(2); // normal|hc|vip fuserights.AppendUInt(GetHabbo().Rank); fuserights.AppendBoolean(GetHabbo().HasFuse("fuse_ambassador")); // embajador ? // fuserights.AppendInt32(0); // New Identity (1 == 1 min and Alert!) response.appendResponse(fuserights); var newidentity = new ServerMessage(Outgoing.SendNewIdentityState); newidentity.AppendInt32(GetHabbo().NewIdentity); response.appendResponse(newidentity); var HabboInformation = new ServerMessage(Outgoing.HabboInfomation); HabboInformation.AppendUInt(GetHabbo().Id); HabboInformation.AppendString(GetHabbo().Username); HabboInformation.AppendString(GetHabbo().Look); HabboInformation.AppendString(GetHabbo().Gender.ToUpper()); HabboInformation.AppendString(GetHabbo().Motto); HabboInformation.AppendString(GetHabbo().RealName); HabboInformation.AppendBoolean(false); HabboInformation.AppendUInt(GetHabbo().Respect); HabboInformation.AppendUInt(GetHabbo().DailyRespectPoints); // respect to give away HabboInformation.AppendUInt(GetHabbo().DailyPetRespectPoints); HabboInformation.AppendBoolean(true); HabboInformation.AppendString(OtanixEnvironment.UnixTimeStampToDateTime(GetHabbo().LastOnline).ToString()); HabboInformation.AppendBoolean(GetHabbo().NameChanges < EmuSettings.MAX_NAME_CHANGES); // CHANGENAME - HabboInformation.AppendBoolean((this.GetHabbo().Diamonds<=0||this.GetHabbo().NameChanges>=ButterflyEnvironment.maxNameChanges)?false:true); HabboInformation.AppendBoolean(false); response.appendResponse(HabboInformation); var IsGuide = (Habbo.Rank > 1) ? true : false; var VoteInCompetitions = false; var Trade = true; var Citizien = (Habbo.CitizenshipLevel >= 4) ? true : false; var JudgeChat = (Habbo.Rank > 2) ? true : false; var NavigatorThumbailCamera = false; var navigatorphaseTwo = true; var Camera = true; var CallHelpers = true; var BuilderAtWork = true; var MouseZoom = false; var Allows = new ServerMessage(Outgoing.PerkAllowancesMessageParser); Allows.AppendInt32(11); // count Allows.AppendString("TRADE"); Allows.AppendString((!Trade) ? "requirement.unfulfilled.citizenship_level_3" : ""); Allows.AppendBoolean(Trade); Allows.AppendString("NAVIGATOR_ROOM_THUMBNAIL_CAMERA"); Allows.AppendString((!NavigatorThumbailCamera) ? "" : ""); Allows.AppendBoolean(NavigatorThumbailCamera); Allows.AppendString("NAVIGATOR_PHASE_TWO_2014"); Allows.AppendString((!navigatorphaseTwo) ? "requirement.unfulfilled.feature_disabled" : ""); Allows.AppendBoolean(navigatorphaseTwo); Allows.AppendString("VOTE_IN_COMPETITIONS"); Allows.AppendString((!VoteInCompetitions) ? "requirement.unfulfilled.helper_level_2" : ""); Allows.AppendBoolean(VoteInCompetitions); Allows.AppendString("BUILDER_AT_WORK"); Allows.AppendString((!BuilderAtWork) ? "requirement.unfulfilled.group_membership" : ""); Allows.AppendBoolean(BuilderAtWork); Allows.AppendString("MOUSE_ZOOM"); Allows.AppendString((!MouseZoom) ? "requirement.unfulfilled.feature_disabled" : ""); Allows.AppendBoolean(MouseZoom); Allows.AppendString("CAMERA"); Allows.AppendString((!Camera) ? "requirement.unfulfilled.feature_disabled" : ""); Allows.AppendBoolean(Camera); Allows.AppendString("CALL_ON_HELPERS"); Allows.AppendString((!CallHelpers) ? "requirement.unfulfilled.citizenship_level_1" : ""); Allows.AppendBoolean(CallHelpers); Allows.AppendString("CITIZEN"); Allows.AppendString((!Citizien) ? "requirement.unfulfilled.citizenship_level_3" : ""); Allows.AppendBoolean(Citizien); Allows.AppendString("USE_GUIDE_TOOL"); Allows.AppendString((!IsGuide) ? "requirement.unfulfilled.helper_level_4" : ""); Allows.AppendBoolean(IsGuide); Allows.AppendString("JUDGE_CHAT_REVIEWS"); Allows.AppendString((!JudgeChat) ? "requirement.unfulfilled.citizenship_level_6" : ""); Allows.AppendBoolean(JudgeChat); response.appendResponse(Allows); var enabledBuilderClub = new ServerMessage(Outgoing.EnableBuilderClub); enabledBuilderClub.AppendInt32(GetHabbo().IsPremium() ? GetHabbo().GetPremiumManager().GetRemainingTime() : 0); // Tiempo restante de Constructor (2678400 = 1 mes entero (s)) enabledBuilderClub.AppendUInt(GetHabbo().IsPremium() ? GetHabbo().GetPremiumManager().GetMaxItems() : 50); // Furnis que puedo alquilar enabledBuilderClub.AppendInt32(20000); // Se puede ampliar la alquilación hasta.. enabledBuilderClub.AppendInt32(0); response.appendResponse(enabledBuilderClub); response.appendResponse(GetHabbo().GetUserClothingManager().SerializeClothes()); var achivPoints = new ServerMessage(Outgoing.AchievementPoints); achivPoints.AppendUInt(GetHabbo().AchievementPoints); response.appendResponse(achivPoints); var loadVolumen = new ServerMessage(Outgoing.LoadVolumen); loadVolumen.AppendInt32(int.Parse(GetHabbo().volumenSystem.Split(';')[0])); loadVolumen.AppendInt32(int.Parse(GetHabbo().volumenSystem.Split(';')[1])); loadVolumen.AppendInt32(int.Parse(GetHabbo().volumenSystem.Split(';')[2])); loadVolumen.AppendBoolean(GetHabbo().preferOldChat); loadVolumen.AppendBoolean(GetHabbo().IgnoreRoomInvitations); loadVolumen.AppendBoolean(GetHabbo().DontFocusUser); // fcus user loadVolumen.AppendInt32(0); // loadVolumen.AppendInt32(0); // freeFlowChat response.appendResponse(loadVolumen); var muteUsers = new ServerMessage(Outgoing.SerializeMuteUsers); muteUsers.AppendInt32(GetHabbo().MutedUsers.Count); foreach (string IgnoreName in GetHabbo().MutedUsers) { muteUsers.AppendString(IgnoreName); } response.appendResponse(muteUsers); TargetedOffer to = OtanixEnvironment.GetGame().GetTargetedOfferManager().GetRandomStaticTargetedOffer(); if (to != null) { if (!GetHabbo().TargetedOffers.ContainsKey(to.Id) || GetHabbo().TargetedOffers[to.Id] < to.PurchaseLimit) { response.appendResponse(OtanixEnvironment.GetGame().GetTargetedOfferManager().SerializeTargetedOffer(to)); } } /*var giftOptions = new ServerMessage(Outgoing.NewUserExperienceGiftOfferParser); * giftOptions.AppendInt32(1); // foreach * { * giftOptions.AppendInt32(0); * giftOptions.AppendInt32(0); * giftOptions.AppendInt32(1); // foreach (items?) * { * giftOptions.AppendString("Testeando"); // itemName ?? * giftOptions.AppendInt32(1); // foreach * { * giftOptions.AppendString("a1_kumiankka"); // item 1 * giftOptions.AppendString(""); // item 2 (if is empty == null) * } * } * } * response.appendResponse(giftOptions);*/ response.appendResponse(OtanixEnvironment.GetGame().GetAchievementManager().AchievementPrede); if (GetHabbo().HomeRoom <= 0) { var homeRoom = new ServerMessage(Outgoing.OutOfRoom); response.appendResponse(homeRoom); } else { Room room = OtanixEnvironment.GetGame().GetRoomManager().GetRoom(GetHabbo().HomeRoom); if (room != null) { this.GetMessageHandler().enterOnRoom3(room); } } response.sendResponse(); // Verifica a conta staff if (GetHabbo().Rank > 5) { ServerMessage VerificaSenha = new ServerMessage(Outgoing.MobilePhoneNumero); VerificaSenha.AppendInt32(1); VerificaSenha.AppendInt32(1); SendMessage(VerificaSenha); } // Termina de verificar a conta staff Ban BanReason = OtanixEnvironment.GetGame().GetBanManager().GetBanReason(Habbo.Username, Habbo.MachineId); if (BanReason != null) { SendScrollNotif("Você tem um banimento do tipo: " + BanReason.Type + "\r\nMotivo: " + BanReason.ReasonMessage); Disconnect(); return(false); } GetHabbo().InitMessenger(); if (GetHabbo().GetAvatarEffectsInventoryComponent() != null) { SendMessage(GetHabbo().GetAvatarEffectsInventoryComponent().Serialize()); } SendMessage(OtanixEnvironment.GetGame().GetModerationTool().SerializeCfhTopics()); if (LanguageLocale.welcomeAlertEnabled) { string strAlert = BlackWordsManager.SpecialReplace(LanguageLocale.welcomeAlert, this); if (LanguageLocale.welcomeAlertType == 0) { SendScrollNotif(strAlert); } else if (LanguageLocale.welcomeAlertType == 1) { SendNotif(strAlert); } else if (LanguageLocale.welcomeAlertType == 2) { SendNotifWithImage(strAlert, LanguageLocale.welcomeAlertImage); } } OtanixEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Habbo.Id, "ACH_EmailVerification", 1); GetHabbo().UpdateCreditsBalance(); GetHabbo().UpdateExtraMoneyBalance(); GetHabbo().setMeOnline(); GetHabbo().InitExtra(); UsersCache.enterProvisionalRoom(this); return(true); } catch (UserDataNotFoundException e) { SendScrollNotif(LanguageLocale.GetValue("login.invalidsso") + "extra data: " + e); } catch (Exception e) { Logging.LogCriticalException("Invalid Dario bug duing user login: "******"Login error: " + e); } return(false); }
internal bool tryLogin(string AuthTicket) { try { string ip = GetConnection().getIp(); byte errorCode = 0; UserData userData = UserDataFactory.GetUserData(AuthTicket, ip, out errorCode); if (errorCode == 1) { SendNotifWithScroll(LanguageLocale.GetValue("login.invalidsso")); return(false); } else if (errorCode == 2) { SendNotifWithScroll(LanguageLocale.GetValue("login.loggedin")); return(false); } if (Program.LicHandeler != null && ButterflyEnvironment.GetGame().GetClientManager().ClientCount > Program.LicHandeler.AmountOfSlots) { Program.LicHandeler.ReportFullServer(); SendBanMessage(LanguageLocale.GetValue("server.full")); return(false); } ButterflyEnvironment.GetGame().GetClientManager().RegisterClient(this, userData.userID, userData.user.Username); this.Habbo = userData.user; userData.user.LoadData(userData); if (userData.user.Username == null) { SendBanMessage("You have no username."); return(false); } string banReason = ButterflyEnvironment.GetGame().GetBanManager().GetBanReason(userData.user.Username, ip); if (!string.IsNullOrEmpty(banReason)) { SendBanMessage(banReason); return(false); } userData.user.Init(this, userData); QueuedServerMessage response = new QueuedServerMessage(Connection); userData.user.SerializeQuests(ref response); List <string> Rights = ButterflyEnvironment.GetGame().GetRoleManager().GetRightsForHabbo(userData.user); ServerMessage appendingResponse = new ServerMessage(2); appendingResponse.Init(2); appendingResponse.AppendInt32(Rights.Count); foreach (string Right in Rights) { appendingResponse.AppendStringWithBreak(Right); } response.appendResponse(appendingResponse); if (userData.user.HasFuse("fuse_mod")) { response.appendResponse(ButterflyEnvironment.GetGame().GetModerationTool().SerializeTool()); ButterflyEnvironment.GetGame().GetModerationTool().SerializeOpenTickets(ref response, userData.userID); } response.appendResponse(userData.user.GetAvatarEffectsInventoryComponent().Serialize()); appendingResponse.Init(290); appendingResponse.AppendBoolean(true); appendingResponse.AppendBoolean(false); response.appendResponse(appendingResponse); appendingResponse.Init(3); response.appendResponse(appendingResponse); appendingResponse.Init(517); appendingResponse.AppendBoolean(true); response.appendResponse(appendingResponse); //if (PixelManager.NeedsUpdate(this)) // PixelManager.GivePixels(this); if (ButterflyEnvironment.GetGame().GetClientManager().pixelsOnLogin > 0) { PixelManager.GivePixels(this, ButterflyEnvironment.GetGame().GetClientManager().pixelsOnLogin); } if (ButterflyEnvironment.GetGame().GetClientManager().creditsOnLogin > 0) { userData.user.Credits += ButterflyEnvironment.GetGame().GetClientManager().creditsOnLogin; userData.user.UpdateCreditsBalance(); } if (userData.user.HomeRoom > 0) { appendingResponse.Init(455); appendingResponse.AppendUInt(userData.user.HomeRoom); response.appendResponse(appendingResponse); } appendingResponse.Init(458); appendingResponse.AppendInt32(30); appendingResponse.AppendInt32(userData.user.FavoriteRooms.Count); foreach (uint Id in userData.user.FavoriteRooms.ToArray()) { appendingResponse.AppendUInt(Id); } response.appendResponse(appendingResponse); if (userData.user.HasFuse("fuse_use_club_badge") && !userData.user.GetBadgeComponent().HasBadge("ACH_BasicClub1")) { userData.user.GetBadgeComponent().GiveBadge("ACH_BasicClub1", true); } else if (!userData.user.HasFuse("fuse_use_club_badge") && userData.user.GetBadgeComponent().HasBadge("ACH_BasicClub1")) { userData.user.GetBadgeComponent().RemoveBadge("ACH_BasicClub1"); } if (!userData.user.GetBadgeComponent().HasBadge("Z63")) { userData.user.GetBadgeComponent().GiveBadge("Z63", true); } appendingResponse.Init(2); appendingResponse.AppendInt32(0); if (userData.user.HasFuse("fuse_use_vip_outfits")) // VIP { appendingResponse.AppendInt32(2); } else if (userData.user.HasFuse("fuse_furni_chooser")) // HC { appendingResponse.AppendInt32(1); } else { appendingResponse.AppendInt32(0); } appendingResponse.AppendInt32(0); response.appendResponse(appendingResponse); appendingResponse.Init(2); appendingResponse.AppendInt32(Rights.Count); foreach (string Right in Rights) { appendingResponse.AppendStringWithBreak(Right); } response.appendResponse(appendingResponse); if (LanguageLocale.welcomeAlertEnabled) { ServerMessage alert = new ServerMessage(810); alert.AppendUInt(1); alert.AppendStringWithBreak(LanguageLocale.welcomeAlert); response.appendResponse(alert); } response.sendResponse(); Logging.WriteLine("[" + Habbo.Username + "] logged in"); return(true); } catch (UserDataNotFoundException e) { SendNotifWithScroll(LanguageLocale.GetValue("login.invalidsso") + "extra data: " + e.ToString()); } catch (Exception e) { //Logging.LogCriticalException("Invalid Dario bug duing user login: "******"Login error: " + e.ToString()); SendNotifWithScroll("Login error: " + e.ToString()); } return(false); }
internal bool tryLogin(string AuthTicket) { try { string ip = this.GetConnection().getIp(); byte b = 0; UserData userData = UserDataFactory.GetUserData(AuthTicket, ip, out b); bool result; if (b == 1) { result = false; return(result); } if (b == 2) { result = false; return(result); } CyberEnvironment.GetGame().GetClientManager().RegisterClient(this, userData.userID, userData.user.Username); this.Habbo = userData.user; userData.user.LoadData(userData); string banReason = CyberEnvironment.GetGame().GetBanManager().GetBanReason(userData.user.Username, ip, this.MachineId); if (!string.IsNullOrEmpty(banReason) || userData.user.Username == null) { this.SendNotifWithScroll(banReason); using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT ip_last FROM users WHERE id=" + this.GetHabbo().Id + " LIMIT 1"); string @string = queryreactor.getString(); queryreactor.setQuery("SELECT COUNT(0) FROM bans_access WHERE user_id=" + this.Habbo.Id + " LIMIT 1"); int integer = queryreactor.getInteger(); if (integer > 0) { queryreactor.runFastQuery(string.Concat(new object[] { "UPDATE bans_access SET attempts = attempts + 1, ip='", @string, "' WHERE user_id=", this.GetHabbo().Id, " LIMIT 1" })); } else { queryreactor.runFastQuery(string.Concat(new object[] { "INSERT INTO bans_access (user_id, ip) VALUES (", this.GetHabbo().Id, ", '", @string, "')" })); } } result = false; return(result); } userData.user.Init(this, userData); QueuedServerMessage queuedServerMessage = new QueuedServerMessage(this.Connection); ServerMessage serverMessage = new ServerMessage(Outgoing.UniqueMachineIDMessageComposer); serverMessage.AppendString(this.MachineId); queuedServerMessage.appendResponse(serverMessage); queuedServerMessage.appendResponse(new ServerMessage(Outgoing.AuthenticationOKMessageComposer)); if (this.Habbo != null) { ServerMessage serverMessage2 = new ServerMessage(Outgoing.HomeRoomMessageComposer); serverMessage2.AppendUInt(this.Habbo.HomeRoom); serverMessage2.AppendUInt(this.Habbo.HomeRoom); queuedServerMessage.appendResponse(serverMessage2); } ServerMessage serverMessage3 = new ServerMessage(Outgoing.MinimailCountMessageComposer); serverMessage3.AppendInt32(this.Habbo.MinimailUnreadMessages); queuedServerMessage.appendResponse(serverMessage3); ServerMessage serverMessage4 = new ServerMessage(Outgoing.FavouriteRoomsMessageComposer); serverMessage4.AppendInt32(30); serverMessage4.AppendInt32(userData.user.FavoriteRooms.Count); object[] array = userData.user.FavoriteRooms.ToArray(); for (int i = 0; i < array.Length; i++) { uint i2 = (uint)array[i]; serverMessage4.AppendUInt(i2); } queuedServerMessage.appendResponse(serverMessage4); ServerMessage rightsMessage = new ServerMessage(Outgoing.UserClubRightsMessageComposer); rightsMessage.AppendInt32(userData.user.GetSubscriptionManager().HasSubscription ? 2 : 0); rightsMessage.AppendUInt(userData.user.Rank); rightsMessage.AppendInt32(0); queuedServerMessage.appendResponse(rightsMessage); ServerMessage serverMessage5 = new ServerMessage(Outgoing.EnableNotificationsMessageComposer); serverMessage5.AppendBoolean(true); serverMessage5.AppendBoolean(false); queuedServerMessage.appendResponse(serverMessage5); ServerMessage serverMessage6 = new ServerMessage(Outgoing.EnableTradingMessageComposer); serverMessage6.AppendBoolean(true); queuedServerMessage.appendResponse(serverMessage6); userData.user.UpdateCreditsBalance(); ServerMessage serverMessage7 = new ServerMessage(Outgoing.ActivityPointsMessageComposer); serverMessage7.AppendInt32(2); serverMessage7.AppendInt32(0); serverMessage7.AppendInt32(userData.user.ActivityPoints); serverMessage7.AppendInt32(5); serverMessage7.AppendInt32(userData.user.BelCredits); queuedServerMessage.appendResponse(serverMessage7); if (userData.user.HasFuse("fuse_mod")) { queuedServerMessage.appendResponse(CyberEnvironment.GetGame().GetModerationTool().SerializeTool()); } if (!string.IsNullOrWhiteSpace(CyberEnvironment.GetDBConfig().DBData["welcome_message"])) { this.SendBroadcastMessage(CyberEnvironment.GetDBConfig().DBData["welcome_message"]); } ServerMessage AchievementData = new ServerMessage(Outgoing.SendAchievementsRequirementsMessageComposer); AchievementData.AppendInt32(CyberEnvironment.GetGame().GetAchievementManager().Achievements.Count); foreach (Achievement Ach in CyberEnvironment.GetGame().GetAchievementManager().Achievements.Values) { AchievementData.AppendString(Ach.GroupName.Replace("ACH_", "")); AchievementData.AppendInt32(Ach.Levels.Count); for (int i = 1; i < Ach.Levels.Count + 1; i++) { AchievementData.AppendInt32(i); AchievementData.AppendInt32(Ach.Levels[i].Requirement); } } AchievementData.AppendInt32(0); queuedServerMessage.appendResponse(AchievementData); if (!GetHabbo().NUXPassed&& ExtraSettings.NEW_USER_GIFTS_ENABLED) { queuedServerMessage.appendResponse(new ServerMessage(Outgoing.NuxSuggestFreeGiftsMessageComposer)); } queuedServerMessage.appendResponse(this.GetHabbo().GetAvatarEffectsInventoryComponent().GetPacket()); queuedServerMessage.sendResponse(); result = true; return(result); } catch (Exception ex) { Logging.LogCriticalException("Bug during user login: " + ex.Message); } return(false); }