Esempio n. 1
0
        private void LoadSongTriggered(object sender, LoadSongData data)
        {
            LogMessage("Received LoadSong:\nName: " + data.name +
                       "\nFilename: " + data.file +
                       "\nSoundcloud ID: " + data.soundcloud, Color.SlateGray);

            //Create music controller (should be created already when we joined, but just to be on the safe side)
            CreatePlayback();

            HasGameEnded = false;
        }
        private void event_loadsong(SocketIOClient.Messages.IMessage message)
        {
            Debug.WriteLine("\nevent_loadsong:\n" + message.MessageText);
            EventJson <LoadSongData> received = JsonConvert.DeserializeObject <EventJson <LoadSongData> >(message.Json.ToJsonString());

            //Validate
            if (!received.Validate())
            {
                return;
            }

            LoadSongData data = received.args[0].data;

            LoadSongTriggered?.Invoke(this, data);
        }