public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool")) { return; } int RoomId = Packet.PopInt(); RoomData Data = RocketEmulador.GetGame().GetRoomManager().GenerateRoomData(RoomId); if (Data == null) { return; } Room Room; if (!RocketEmulador.GetGame().GetRoomManager().TryGetRoom(RoomId, out Room)) { return; } Session.SendMessage(new ModeratorRoomInfoComposer(Data, (Room.GetRoomUserManager().GetRoomUserByHabbo(Data.OwnerName) != null))); }
public ProfileInformationComposer(Habbo Data, GameClient Session, List <Group> Groups, int friendCount) : base(ServerPacketHeader.ProfileInformationMessageComposer) { DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Data.AccountCreated); base.WriteInteger(Data.Id); base.WriteString(Data.Username); base.WriteString(Data.Look); base.WriteString(Data.Motto); base.WriteString(origin.ToString("dd/MM/yyyy")); base.WriteInteger(Data.GetStats().AchievementPoints); base.WriteInteger(friendCount); // Friend Count base.WriteBoolean(Data.Id != Session.GetHabbo().Id&& Session.GetHabbo().GetMessenger().FriendshipExists(Data.Id)); // Is friend base.WriteBoolean(Data.Id != Session.GetHabbo().Id&& !Session.GetHabbo().GetMessenger().FriendshipExists(Data.Id) && Session.GetHabbo().GetMessenger().RequestExists(Data.Id)); // Sent friend request base.WriteBoolean((RocketEmulador.GetGame().GetClientManager().GetClientByUserID(Data.Id)) != null); base.WriteInteger(Groups.Count); foreach (Group Group in Groups) { base.WriteInteger(Group.Id); base.WriteString(Group.Name); base.WriteString(Group.Badge); base.WriteString(RocketEmulador.GetGame().GetGroupManager().GetGroupColour(Group.Colour1, true)); base.WriteString(RocketEmulador.GetGame().GetGroupManager().GetGroupColour(Group.Colour2, false)); base.WriteBoolean(Data.GetStats().FavouriteGroupId == Group.Id); // todo favs base.WriteInteger(0); //what the f**k base.WriteBoolean(Group != null ? Group.ForumEnabled : true); //HabboTalk } base.WriteInteger(Convert.ToInt32(RocketEmulador.GetUnixTimestamp() - Data.LastOnline)); // Last online base.WriteBoolean(true); // Show the profile }
public HabboSearchResultComposer(List <SearchResult> Friends, List <SearchResult> OtherUsers) : base(ServerPacketHeader.HabboSearchResultMessageComposer) { base.WriteInteger(Friends.Count); foreach (SearchResult Friend in Friends.ToList()) { bool Online = (RocketEmulador.GetGame().GetClientManager().GetClientByUserID(Friend.UserId) != null); base.WriteInteger(Friend.UserId); base.WriteString(Friend.Username); base.WriteString(Friend.Motto); base.WriteBoolean(Online); base.WriteBoolean(false); base.WriteString(string.Empty); base.WriteInteger(0); base.WriteString(Online ? Friend.Figure : ""); base.WriteString(Friend.LastOnline); } base.WriteInteger(OtherUsers.Count); foreach (SearchResult OtherUser in OtherUsers.ToList()) { bool Online = (RocketEmulador.GetGame().GetClientManager().GetClientByUserID(OtherUser.UserId) != null); base.WriteInteger(OtherUser.UserId); base.WriteString(OtherUser.Username); base.WriteString(OtherUser.Motto); base.WriteBoolean(Online); base.WriteBoolean(false); base.WriteString(string.Empty); base.WriteInteger(0); base.WriteString(Online ? OtherUser.Figure : ""); base.WriteString(OtherUser.LastOnline); } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int GroupId = Packet.PopInt(); int UserId = Packet.PopInt(); Group Group = null; if (!RocketEmulador.GetGame().GetGroupManager().TryGetGroup(GroupId, out Group)) { return; } if ((Session.GetHabbo().Id != Group.CreatorId && !Group.IsAdmin(Session.GetHabbo().Id)) && !Session.GetHabbo().GetPermissions().HasRight("fuse_group_accept_any")) { return; } if (!Group.HasRequest(UserId)) { return; } Habbo Habbo = RocketEmulador.GetHabboById(UserId); if (Habbo == null) { Session.SendNotification("Oops, an error occurred whilst finding this user."); return; } Group.HandleRequest(UserId, true); Session.SendMessage(new GroupMemberUpdatedComposer(GroupId, Habbo, 4)); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int GroupId = Packet.PopInt(); string Name = RocketEmulador.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString()); string Desc = RocketEmulador.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString()); Group Group = null; if (!RocketEmulador.GetGame().GetGroupManager().TryGetGroup(GroupId, out Group)) { return; } if (Group.CreatorId != Session.GetHabbo().Id) { return; } using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("UPDATE `groups` SET `name`= @name, `desc` = @desc WHERE `id` = '" + GroupId + "' LIMIT 1"); dbClient.AddParameter("name", Name); dbClient.AddParameter("desc", Desc); dbClient.RunQuery(); } Group.Name = Name; Group.Description = Desc; Session.SendMessage(new GroupInfoComposer(Group, Session)); }
public void Parse(GameClient Session, ClientPacket Packet) { if (!Session.GetHabbo().InRoom) return; int Action = Packet.PopInt(); Room Room = null; if (!RocketEmulador.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room)) return; RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) return; if (User.DanceId > 0) User.DanceId = 0; if (Session.GetHabbo().Effects().CurrentEffect > 0) Room.SendMessage(new AvatarEffectComposer(User.VirtualId, 0)); User.UnIdle(); Room.SendMessage(new ActionComposer(User.VirtualId, Action)); if (Action == 5) // idle { User.IsAsleep = true; Room.SendMessage(new SleepComposer(User, true)); } RocketEmulador.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SOCIAL_WAVE); }
private void UpdateOnlineUsers() { TimeSpan Uptime = DateTime.Now - RocketEmulador.ServerStarted; int UsersOnline = Convert.ToInt32(RocketEmulador.GetGame().GetClientManager().Count); int RoomCount = RocketEmulador.GetGame().GetRoomManager().Count; Console.Title = "Rocket Emulador - " + UsersOnline + " usuários online - " + RoomCount + " quartos online - " + Uptime.Days + " dia(s) " + Uptime.Hours + " hora(s) ligado"; using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("UPDATE `server_status` SET `users_online` = @users, `loaded_rooms` = @loadedRooms LIMIT 1;"); dbClient.AddParameter("users", UsersOnline); dbClient.AddParameter("loadedRooms", RoomCount); dbClient.RunQuery(); } int userPeak; using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT `userpeak` FROM `server_status` LIMIT 1"); userPeak = dbClient.getInteger(); } if (UsersOnline > userPeak) { using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("UPDATE `server_status` SET `userpeak` = @userpeak LIMIT 1;"); dbClient.AddParameter("userpeak", UsersOnline); dbClient.RunQuery(); } } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (!Session.GetHabbo().InRoom) { return; } Room Room = null; if (!RocketEmulador.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room)) { return; } if (!Room.CheckRights(Session)) { return; } Item Item = Room.GetRoomItemHandler().GetItem(Packet.PopInt()); if (Item == null) { return; } if (Item.GetBaseItem().InteractionType == InteractionType.POSTIT || Item.GetBaseItem().InteractionType == InteractionType.CAMERA_PICTURE) { Room.GetRoomItemHandler().RemoveFurniture(Session, Item.Id); using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Item.Id + "' LIMIT 1"); } } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { Room Room = null; if (!RocketEmulador.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room)) { return; } if (!Room.CheckRights(Session)) { return; } int itemID = Packet.PopInt(); string wallPositionData = Packet.PopString(); Item Item = Room.GetRoomItemHandler().GetItem(itemID); if (Item == null) { return; } try { string WallPos = Room.GetRoomItemHandler().WallPositionCheck(":" + wallPositionData.Split(':')[1]); Item.wallCoord = WallPos; } catch { return; } Room.GetRoomItemHandler().UpdateItem(Item); Room.SendMessage(new ItemUpdateComposer(Item, Room.OwnerId)); }
public void Parse(GameClient Session, ClientPacket Packet) { var ForumId = Packet.PopInt(); var WhoCanRead = Packet.PopInt(); var WhoCanReply = Packet.PopInt(); var WhoCanPost = Packet.PopInt(); var WhoCanMod = Packet.PopInt(); var forum = RocketEmulador.GetGame().GetGroupForumManager().GetForum(ForumId); if (forum == null) { Session.SendNotification("Forum not found 404!"); return; } if (forum.Settings.GetReasonForNot(Session, forum.Settings.WhoCanModerate) != "") { Session.SendNotification("Can't update thread, you don't have the correct rights!"); return; } forum.Settings.WhoCanRead = WhoCanRead; forum.Settings.WhoCanModerate = WhoCanMod; forum.Settings.WhoCanPost = WhoCanReply; forum.Settings.WhoCanInitDiscussions = WhoCanPost; forum.Settings.Save(); RocketEmulador.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_SelfModRoomFilterSeen", 1); Session.SendMessage(new ForumDataComposer(forum, Session)); Session.SendMessage(new ThreadsListDataComposer(forum, Session)); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int GroupId = Packet.PopInt(); int UserId = Packet.PopInt(); Group Group = null; if (!RocketEmulador.GetGame().GetGroupManager().TryGetGroup(GroupId, out Group)) { return; } if (Session.GetHabbo().Id != Group.CreatorId && !Group.IsAdmin(Session.GetHabbo().Id)) { return; } if (!Group.HasRequest(UserId)) { return; } Group.HandleRequest(UserId, false); Session.SendMessage(new UnknownGroupComposer(Group.Id, UserId)); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { Room Room = null; if (!RocketEmulador.GetGame().GetRoomManager().TryGetRoom(Packet.PopInt(), out Room)) { return; } if (!Room.CheckRights(Session, true)) { return; } int CategoryId = Packet.PopInt(); int TradeSettings = Packet.PopInt(); if (TradeSettings < 0 || TradeSettings > 2) { TradeSettings = 0; } SearchResultList SearchResultList = null; if (!RocketEmulador.GetGame().GetNavigator().TryGetSearchResultList(CategoryId, out SearchResultList)) { CategoryId = 36; } if (SearchResultList.CategoryType != NavigatorCategoryType.CATEGORY || SearchResultList.RequiredRank > Session.GetHabbo().Rank) { CategoryId = 36; } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (!Session.GetHabbo().InRoom) { return; } int ItemId = Packet.PopInt(); ICollection <TelevisionItem> Videos = RocketEmulador.GetGame().GetTelevisionManager().TelevisionList; if (Videos.Count == 0) { Session.SendNotification("Oh, it looks like the hotel manager haven't added any videos for you to watch! :("); return; } Dictionary <int, TelevisionItem> dict = RocketEmulador.GetGame().GetTelevisionManager()._televisions; foreach (TelevisionItem value in RandomValues(dict).Take(1)) { Session.SendMessage(new GetYouTubeVideoComposer(ItemId, value.YouTubeId)); } Session.SendMessage(new GetYouTubePlaylistComposer(ItemId, Videos)); }
public void Parse(GameClient Session, ClientPacket Packet) { var ForumId = Packet.PopInt(); //Maybe Forum ID var ThreadId = Packet.PopInt(); //Maybe Thread ID var StartIndex = Packet.PopInt(); //Start index var length = Packet.PopInt(); //List Length var Forum = RocketEmulador.GetGame().GetGroupForumManager().GetForum(ForumId); if (Forum == null) { // Session.SendNotification("Forum introuvable!"); return; } var Thread = Forum.GetThread(ThreadId); if (Thread == null) { Session.SendNotification("Forum discussion introuvable!"); return; } Session.SendMessage(new ThreadDataComposer(Thread, StartIndex, length)); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int SlotId = Packet.PopInt(); string Look = RocketEmulador.GetGame().GetAntiMutant().RunLook(Packet.PopString()); string Gender = Packet.PopString(); using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT null FROM `user_wardrobe` WHERE `user_id` = " + Session.GetHabbo().Id + " AND `slot_id` = @slot"); dbClient.AddParameter("slot", SlotId); if (dbClient.getRow() != null) { dbClient.SetQuery("UPDATE `user_wardrobe` SET `look` = @look, `gender` = @gender WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `slot_id` = @slot LIMIT 1"); dbClient.AddParameter("slot", SlotId); dbClient.AddParameter("look", Look); dbClient.AddParameter("gender", Gender.ToUpper()); dbClient.RunQuery(); } else { dbClient.SetQuery("INSERT INTO `user_wardrobe` (`user_id`,`slot_id`,`look`,`gender`) VALUES ('" + Session.GetHabbo().Id + "',@slot,@look,@gender)"); dbClient.AddParameter("slot", SlotId); dbClient.AddParameter("look", Look); dbClient.AddParameter("gender", Gender.ToUpper()); dbClient.RunQuery(); } } }
public MarketPlaceOffersComposer(int MinCost, int MaxCost, Dictionary <int, MarketOffer> dictionary, Dictionary <int, int> dictionary2) : base(ServerPacketHeader.MarketPlaceOffersMessageComposer) { base.WriteInteger(dictionary.Count); if (dictionary.Count > 0) { foreach (KeyValuePair <int, MarketOffer> pair in dictionary) { base.WriteInteger(pair.Value.OfferID); base.WriteInteger(1);//State base.WriteInteger(1); base.WriteInteger(pair.Value.SpriteId); base.WriteInteger(256); base.WriteString(""); base.WriteInteger(pair.Value.LimitedNumber); base.WriteInteger(pair.Value.LimitedStack); base.WriteInteger(pair.Value.TotalPrice); base.WriteInteger(0); base.WriteInteger(RocketEmulador.GetGame().GetCatalog().GetMarketplace().AvgPriceForSprite(pair.Value.SpriteId)); base.WriteInteger(dictionary2[pair.Value.SpriteId]); } } base.WriteInteger(dictionary.Count);//Item count to show how many were found. }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom) { return; } Room Room; if (!RocketEmulador.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room)) { return; } if (!Room.CanTradeInRoom) { return; } Trade Trade = Room.GetUserTrade(Session.GetHabbo().Id); if (Trade == null) { return; } Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(Packet.PopInt()); if (Item == null) { return; } Trade.TakeBackItem(Session.GetHabbo().Id, Item); }
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights) { int Modes = Item.GetBaseItem().Modes - 1; if (Session == null || !HasRights || Modes <= 0) { return; } RocketEmulador.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.FURNI_SWITCH); int CurrentMode = 0; int NewMode = 0; if (!int.TryParse(Item.ExtraData, out CurrentMode)) { } if (CurrentMode <= 0) { NewMode = 1; } else if (CurrentMode >= Modes) { NewMode = 0; } else { NewMode = CurrentMode + 1; } Item.ExtraData = NewMode.ToString(); Item.UpdateState(); }
private void SerializeQuest(ServerPacket Message, GameClient Session, Quest Quest, string Category) { if (Message == null || Session == null) { return; } int AmountInCat = RocketEmulador.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Category); int Number = Quest == null ? AmountInCat : Quest.Number - 1; int UserProgress = Quest == null ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id); if (Quest != null && Quest.IsCompleted(UserProgress)) { Number++; } Message.WriteString(Category); Message.WriteInteger(Quest == null ? 0 : ((Quest.Category.Contains("xmas2012")) ? 0 : Number)); // Quest progress in this cat Message.WriteInteger(Quest == null ? 0 : (Quest.Category.Contains("xmas2012")) ? 0 : AmountInCat); // Total quests in this cat Message.WriteInteger(Quest == null ? 2 : Quest.RewardType); // Reward type (1 = Snowflakes, 2 = Love hearts, 3 = Pixels, 4 = Seashells, everything else is pixels Message.WriteInteger(Quest == null ? 0 : Quest.Id); // Quest id Message.WriteBoolean(Quest == null ? true : Session.GetHabbo().GetStats().QuestID == Quest.Id); // Quest started Message.WriteString(Quest == null ? string.Empty : Quest.ActionName); Message.WriteString(Quest == null ? string.Empty : Quest.DataBit); Message.WriteInteger(Quest == null ? 0 : Quest.Reward); Message.WriteString(Quest == null ? string.Empty : Quest.Name); Message.WriteInteger(UserProgress); // Current progress Message.WriteInteger(Quest == null ? 10 : Quest.GoalData); // Target progress Message.WriteInteger(Quest == null ? 1110 : Quest.TimeUnlock); // "Next quest available countdown" in seconds Message.WriteString(""); Message.WriteString(""); Message.WriteBoolean(true); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int userID = Packet.PopInt(); Boolean IsMe = Packet.PopBoolean(); Habbo targetData = RocketEmulador.GetHabboById(userID); if (targetData == null) { Session.SendNotification("An error occured whilst finding that user's profile."); return; } List <Group> Groups = RocketEmulador.GetGame().GetGroupManager().GetGroupsForUser(targetData.Id); int friendCount = 0; using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT COUNT(0) FROM `messenger_friendships` WHERE (`user_one_id` = @userid OR `user_two_id` = @userid)"); dbClient.AddParameter("userid", userID); friendCount = dbClient.getInteger(); } Session.SendMessage(new ProfileInformationComposer(targetData, Session, Groups, friendCount)); }
public GetRelationshipsComposer(Habbo Habbo, int Loves, int Likes, int Hates) : base(ServerPacketHeader.GetRelationshipsMessageComposer) { base.WriteInteger(Habbo.Id); base.WriteInteger(Habbo.Relationships.Count); // Count foreach (Relationship Rel in Habbo.Relationships.Values) { UserCache HHab = RocketEmulador.GetGame().GetCacheManager().GenerateUser(Rel.UserId); if (HHab == null) { base.WriteInteger(0); base.WriteInteger(0); base.WriteInteger(0); // Their ID base.WriteString("Placeholder"); base.WriteString("hr-115-42.hd-190-1.ch-215-62.lg-285-91.sh-290-62"); } else { base.WriteInteger(Rel.Type); base.WriteInteger(Rel.Type == 1 ? Loves : Rel.Type == 2 ? Likes : Hates); base.WriteInteger(Rel.UserId); // Their ID base.WriteString(HHab.Username); base.WriteString(HHab.Look); } } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null) { return; } // if (RocketEmulador.GetGame().GetModerationManager().UsersHasPendingTicket(Session.GetHabbo().Id)) { Session.SendMessage(new BroadcastMessageAlertComposer("You currently already have a pending ticket, please wait for a response from a moderator.")); return; } int photoId; if (!int.TryParse(Packet.PopString(), out photoId)) { return; } int roomId = Packet.PopInt(); int creatorId = Packet.PopInt(); int categoryId = Packet.PopInt(); //RocketEmulador.GetGame().GetModerationManager().SendNewTicket(Session, categoryId, creatorId, "", new List<string>(), (int) ModerationSupportTicketType.PHOTO, photoId); RocketEmulador.GetGame().GetClientManager().ModAlert("A new support ticket has been submitted!"); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom) { return; } Room Room; if (!RocketEmulador.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room)) { return; } if (!Room.CanTradeInRoom) { return; } Trade Trade = Room.GetUserTrade(Session.GetHabbo().Id); if (Trade == null) { return; } Trade.CompleteTrade(Session.GetHabbo().Id); }
public void Parse(GameClient Session, ClientPacket Packet) { string PetName = Packet.PopString(); if (PetName.Length < 2) { Session.SendMessage(new CheckPetNameComposer(2, "2")); return; } else if (PetName.Length > 15) { Session.SendMessage(new CheckPetNameComposer(1, "15")); return; } else if (!RocketEmulador.IsValidAlphaNumeric(PetName)) { Session.SendMessage(new CheckPetNameComposer(3, "")); return; } else if (RocketEmulador.GetGame().GetChatManager().GetFilter().IsFiltered(PetName)) { Session.SendMessage(new CheckPetNameComposer(4, "")); return; } Session.SendMessage(new CheckPetNameComposer(0, "")); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (!Session.GetHabbo().InRoom) { return; } Room Room; if (!RocketEmulador.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room)) { return; } RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) { return; } if (User.CarryItemID > 0 && User.CarryTimer > 0) { User.CarryItem(0); } }
public QuestCompletedComposer(GameClient Session, Quest Quest) : base(ServerPacketHeader.QuestCompletedMessageComposer) { int AmountInCat = RocketEmulador.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Quest.Category); int Number = Quest == null ? AmountInCat : Quest.Number; int UserProgress = Quest == null ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id); base.WriteString(Quest.Category); base.WriteInteger(1); // Quest progress in this cat base.WriteInteger((Quest.Name.Contains("xmas2012")) ? 1 : AmountInCat); // Total quests in this cat base.WriteInteger(Quest == null ? 3 : Quest.RewardType); // Reward type (1 = Snowflakes, 2 = Love hearts, 3 = Pixels, 4 = Seashells, everything else is pixels base.WriteInteger(Quest == null ? 0 : Quest.Id); // Quest id base.WriteBoolean(Quest == null ? true : Session.GetHabbo().GetStats().QuestID == Quest.Id); // Quest started base.WriteString(Quest == null ? string.Empty : Quest.ActionName); base.WriteString(Quest == null ? string.Empty : Quest.DataBit); base.WriteInteger(Quest == null ? 0 : Quest.Reward); base.WriteString(Quest == null ? string.Empty : Quest.Name); base.WriteInteger(UserProgress); // Current progress base.WriteInteger(Quest == null ? 10 : Quest.GoalData); // Target progress base.WriteInteger(Quest == null ? 11110 : Quest.TimeUnlock); // "Next quest available countdown" in seconds base.WriteString(""); base.WriteString(""); base.WriteBoolean(true); // ? base.WriteBoolean(true); // Activate next quest.. }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { string Category = Packet.PopString(); string Unknown = Packet.PopString(); if (!string.IsNullOrEmpty(Unknown)) { Category = "hotel_view"; ICollection <SearchResultList> Test = new List <SearchResultList>(); SearchResultList Null = null; if (RocketEmulador.GetGame().GetNavigator().TryGetSearchResultList(0, out Null)) { Test.Add(Null); Session.SendMessage(new NavigatorSearchResultSetComposer(Category, Unknown, Test, Session)); } } else { //Fetch the categorys. ICollection <SearchResultList> Test = RocketEmulador.GetGame().GetNavigator().GetCategorysForSearch(Category); if (Test.Count == 0) { ICollection <SearchResultList> SecondTest = RocketEmulador.GetGame().GetNavigator().GetResultByIdentifier(Category); if (SecondTest.Count > 0) { Session.SendMessage(new NavigatorSearchResultSetComposer(Category, Unknown, SecondTest, Session, 2, 100)); return; } } Session.SendMessage(new NavigatorSearchResultSetComposer(Category, Unknown, Test, Session)); } }
public static List <Item> GetItemsForUser(int UserId) { DataTable Items = null; List <Item> I = new List <Item>(); using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT `items`.*, COALESCE(`items_groups`.`group_id`, 0) AS `group_id` FROM `items` LEFT OUTER JOIN `items_groups` ON `items`.`id` = `items_groups`.`id` WHERE `items`.`room_id` = 0 AND `items`.`user_id` = @uid;"); dbClient.AddParameter("uid", UserId); Items = dbClient.getTable(); if (Items != null) { foreach (DataRow Row in Items.Rows) { ItemData Data = null; if (RocketEmulador.GetGame().GetItemManager().GetItem(Convert.ToInt32(Row["base_item"]), out Data)) { I.Add(new Item(Convert.ToInt32(Row["id"]), Convert.ToInt32(Row["room_id"]), Convert.ToInt32(Row["base_item"]), Convert.ToString(Row["extra_data"]), Convert.ToInt32(Row["x"]), Convert.ToInt32(Row["y"]), Convert.ToDouble(Row["z"]), Convert.ToInt32(Row["rot"]), Convert.ToInt32(Row["user_id"]), Convert.ToInt32(Row["group_id"]), Convert.ToInt32(Row["limited_number"]), Convert.ToInt32(Row["limited_stack"]), Convert.ToString(Row["wall_pos"]))); } else { // Item data does not exist anymore. } } } } return(I); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null) { return; } if (RocketEmulador.GetGame().GetModerationTool().UsersHasPendingTicket(Session.GetHabbo().Id)) { Session.SendMessage(new BroadcastMessageAlertComposer("You currently already have a pending ticket, please wait for a response from a moderator.")); return; } string Message = Packet.PopString(); int Type = Packet.PopInt(); int ReportedUser = Packet.PopInt(); int Room = Packet.PopInt(); int Messagecount = Packet.PopInt(); List <string> Chats = new List <string>(); for (int i = 0; i < Messagecount; i++) { Packet.PopInt(); Chats.Add(Packet.PopString()); } ModerationRoomChatLog Chat = new ModerationRoomChatLog(Packet.PopInt(), Chats); RocketEmulador.GetGame().GetModerationTool().SendNewTicket(Session, Type, ReportedUser, Message, Chats); RocketEmulador.GetGame().GetClientManager().ModAlert("A new support ticket has been submitted!"); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (!Session.GetHabbo().InRoom) { return; } Room Room = Session.GetHabbo().CurrentRoom; if (Room == null) { return; } String Username = Packet.PopString(); Habbo User = RocketEmulador.GetHabboByUsername(Username); if (User == null || Session.GetHabbo().MutedUsers.Contains(User.Id) || User.GetPermissions().HasRight("mod_tool")) { return; } Session.GetHabbo().MutedUsers.Add(User.Id); Session.SendMessage(new IgnoreStatusComposer(1, Username)); RocketEmulador.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_SelfModIgnoreSeen", 1); }