private static void GetSongData(GameClient Session, ClientMessage Message) { int Amount = Message.ReadInt(); List<SongData> Songs = new List<SongData>(); for (int i = 0; i < Amount; i++) { SongData Song = GetSong(Message.ReadUInt()); if (Song == null) continue; Songs.Add(Song); } //Session.SendMessage(JukeboxComposer.Compose(Songs)); }
internal void ActivateQuest(GameClient Session, ClientMessage Message) { Quest Quest = GetQuest(Message.ReadUInt()); if (Quest == null) return; using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.runFastQuery("REPLACE INTO user_quests VALUES (" + Session.GetHabbo().Id + ", " + Quest.Id + ", 0)"); dbClient.runFastQuery("UPDATE users SET currentquestid = " + Quest.Id + " WHERE id = " + Session.GetHabbo().Id); } Session.GetHabbo().CurrentQuestId = Quest.Id; GetList(Session, null); Session.SendMessage(QuestStartedComposer.Compose(Session, Quest)); }
private static List<RoomItem> GetItems(ClientMessage message, Room room) { List<RoomItem> items = new List<RoomItem>(); int itemCount = message.ReadInt(); if (itemCount > BaseWiredInteractor.MAX_FURNI_SELECTION) { return items; } uint itemID; RoomItem item; for (int i = 0; i < itemCount; i++) { itemID = message.ReadUInt(); item = room.GetRoomItemHandler().GetItem(itemID); if (item != null /*&& !WiredUtillity.TypeIsWired(item.GetBaseItem().InteractionType)*/) items.Add(item); } return items; }
private static void AddToPlaylist(GameClient Session, ClientMessage Message) { Room Instance = Session.GetHabbo().CurrentRoom; if (Instance == null || !Instance.CheckRights(Session, true) || !Instance.GotMusicController() || Instance.GetRoomMusicController().PlaylistSize >= Instance.GetRoomMusicController().PlaylistCapacity) { return; } UserItem DiskUserItem = Session.GetHabboDataContainer().GetInventoryComponent().GetItem(Message.ReadUInt()); if (DiskUserItem == null || DiskUserItem.GetBaseItem().InteractionType != InteractionType.musicdisc) { return; } SongItem item = new SongItem(DiskUserItem); int NewOrder = Instance.GetRoomMusicController().AddDisk(item); if (NewOrder < 0) { return; } Session.GetHabboDataContainer().GetInventoryComponent().RemoveItem(item.itemID, true); //Session.SendMessage(JukeboxComposer.Compose(Instance.GetRoomMusicController().PlaylistCapacity, // Instance.GetRoomMusicController().Playlist.Values.ToList())); }