Exemplo n.º 1
0
        internal void RemovePlaylistItem()
        {
            if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentRoom == null)
            {
                return;
            }

            Room currentRoom = Session.GetHabbo().CurrentRoom;

            if (!currentRoom.CheckRights(Session, true) || !currentRoom.GotMusicController())
            {
                return;
            }

            RoomMusicController musicController = currentRoom.GetRoomMusicController();

            SongItem item = musicController.RemoveDisk(Request.ReadInt32());

            if (item == null)
            {
                return;
            }

            item.RemoveFromDatabase();
            Session.GetHabbo().GetInventoryComponent().AddNewItem(item.itemID, item.baseItem.ItemId, new StringData(item.songID.ToString()), 0, true, true);
            Session.GetHabbo().GetInventoryComponent().UpdateItems(false);

            Session.SendMessage(JukeboxComposer.SerializeSongInventory(Session.GetHabbo().GetInventoryComponent().songDisks));
            Session.SendMessage(JukeboxComposer.Compose(musicController.PlaylistCapacity, musicController.Playlist.Values.ToList()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Removes the playlist item.
        /// </summary>
        internal void RemovePlaylistItem()
        {
            if (this.Session == null || this.Session.GetHabbo() == null || this.Session.GetHabbo().CurrentRoom == null)
            {
                return;
            }
            Room currentRoom = this.Session.GetHabbo().CurrentRoom;

            if (!currentRoom.GotMusicController())
            {
                return;
            }
            RoomMusicController roomMusicController = currentRoom.GetRoomMusicController();
            SongItem            songItem            = roomMusicController.RemoveDisk(this.Request.GetInteger());

            if (songItem == null)
            {
                return;
            }
            songItem.RemoveFromDatabase();
            this.Session.GetHabbo().GetInventoryComponent().AddNewItem(songItem.ItemId, songItem.BaseItem.ItemId, songItem.ExtraData, 0u, false, true, 0, 0, songItem.SongCode);
            this.Session.GetHabbo().GetInventoryComponent().UpdateItems(false);
            using (IQueryAdapter queryReactor = global::Plus.Plus.GetDatabaseManager().GetQueryReactor())
            {
                queryReactor.RunFastQuery(string.Format("UPDATE items_rooms SET user_id='{0}' WHERE id='{1}' LIMIT 1;", Session.GetHabbo().Id, songItem.ItemId));
            }
            this.Session.SendMessage(JukeboxComposer.SerializeSongInventory(this.Session.GetHabbo().GetInventoryComponent().SongDisks));
            this.Session.SendMessage(JukeboxComposer.Compose(roomMusicController.PlaylistCapacity, roomMusicController.Playlist.Values.ToList <SongInstance>()));
        }
Exemplo n.º 3
0
        internal void GetDisks()
        {
            if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetInventoryComponent() == null)
            {
                return;
            }

            Session.SendMessage(JukeboxComposer.SerializeSongInventory(Session.GetHabbo().GetInventoryComponent().songDisks));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Gets the disks.
 /// </summary>
 internal void GetDisks()
 {
     if (this.Session == null || this.Session.GetHabbo() == null || this.Session.GetHabbo().GetInventoryComponent() == null)
     {
         return;
     }
     if (this.Session.GetHabbo().GetInventoryComponent().SongDisks.Count == 0)
     {
         return;
     }
     this.Session.SendMessage(JukeboxComposer.SerializeSongInventory(this.Session.GetHabbo().GetInventoryComponent().SongDisks));
 }