Exemplo n.º 1
0
        private static void RemoveFromPlaylist(Session Session, ClientMessage Message)
        {
            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null || Instance.MusicController == null || !Instance.CheckUserRights(Session, true))
            {
                return;
            }

            Item TakenItem = Instance.MusicController.RemoveDisk(Message.PopWiredInt32());

            // playlist will skip to the next item automatically if it has to

            if (TakenItem == null)
            {
                return;
            }

            Session.InventoryCache.Add(TakenItem);

            using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
            {
                TakenItem.MoveToUserInventory(MySqlClient, Session.CharacterId);
            }

            Session.SendData(InventoryItemAddedComposer.Compose(TakenItem));
            Session.SendData(JukeboxDisksComposer.Compose(Session));
            Session.SendData(JukeboxPlaylistComposer.Compose(Instance.MusicController.PlaylistCapacity,
                                                             Instance.MusicController.Playlist.Values.ToList()));
        }
Exemplo n.º 2
0
 private static void GetDisks(Session Session, ClientMessage Message)
 {
     Session.SendData(JukeboxDisksComposer.Compose(Session));
 }