コード例 #1
0
        public async Task QueueSongAsync(QueueSong song)
        {
            this.SongQueue.Enqueue(song);

            if (SongQueue.Count() == 1)
            {
                await NextSongAsync();
            }
            await server.sendRoomUpdate(this);
        }
コード例 #2
0
        public override async Task NextSongAsync()
        {
            await server.sendRoomUpdate(this);

            if (SongQueue.Count() <= 0)
            {
                await server.BroadcastRoomAsync(this, new Packet(PacketType.PauseMusic, null));

                return;
            }

            var song = SongQueue.Peek();

            await server.BroadcastRoomAsync(this, new Packet(PacketType.StartPlaying, new StartPlayingData()
            {
                SongToPlay = song
            }));
        }