Exemple #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);
        }
Exemple #2
0
 public SongItem(UserItem item)
 {
     this.itemID    = item.Id;
     this.songID    = SongManager.GetSongId(item.SongCode);
     this.baseItem  = item.GetBaseItem();
     this.extraData = item.ExtraData;
     this.songCode  = item.SongCode;
 }
Exemple #3
0
        internal static void Initialize()
        {
            SongManager.songs      = new Dictionary <uint, SongData>();
            SongManager.cacheTimer = new Dictionary <uint, double>();
            DataTable table;

            SongManager.songs.Clear();
            using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
            {
                queryreactor.setQuery("SELECT * FROM songs ORDER BY id");
                table = queryreactor.getTable();
            }
            foreach (DataRow dRow in table.Rows)
            {
                SongData songFromDataRow = SongManager.GetSongFromDataRow(dRow);
                SongManager.songs.Add(songFromDataRow.Id, songFromDataRow);
            }
        }
Exemple #4
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));
            }
        }