Пример #1
0
        public int AddDisk(SongItem DiskItem)
        {
            uint songID = DiskItem.songID;

            if (songID == 0u)
            {
                return(-1);
            }
            SongData song = SongManager.GetSong(songID);

            if (song == null)
            {
                return(-1);
            }
            if (this.mLoadedDisks.ContainsKey(DiskItem.itemID))
            {
                return(-1);
            }
            this.mLoadedDisks.Add(DiskItem.itemID, DiskItem);
            int count = this.mPlaylist.Count;

            lock (this.mPlaylist)
            {
                this.mPlaylist.Add(count, new SongInstance(DiskItem, song));
            }
            return(count);
        }
Пример #2
0
        private static void GetSongData(GameClient Session, ClientMessage Message)
        {
            int             num  = Message.PopWiredInt32();
            List <SongData> list = new List <SongData>();

            checked
            {
                for (int i = 0; i < num; i++)
                {
                    SongData song = SongManager.GetSong(Message.PopWiredUInt());
                    if (song != null)
                    {
                        list.Add(song);
                    }
                }
                Session.SendMessage(JukeboxComposer.Compose(list));
            }
        }