Ejemplo n.º 1
0
        public void HandleSounds(string message)
        {
            string newMessage = message.Remove(0, message.IndexOf("["));

            newMessage = newMessage.Substring(0, newMessage.LastIndexOf("]") + 1);

            List <ISound> sounds = JsonConvert.DeserializeObject <List <ISound> >(newMessage, JsonMudMessage.Settings);

            //engine.StopAllSounds();

            foreach (ISound sound in sounds)
            {
                string file = Path.Combine("Sounds", sound.SoundName);

                //request validation the file we have is the latest
                if (!ValidateAssets.AssetHashes.ContainsKey(file) &&
                    File.Exists(file))
                {
                    _telnetHandler.OutQueue.Enqueue($"VALIDATEASSET|{file}");
                }

                if (!File.Exists(file))
                {
                    RequestSound(file);
                }
            }

            SoundManager.PlaySounds(sounds);
        }
Ejemplo n.º 2
0
        public void HandleSounds(string message)
        {
            string newMessage = message.Remove(0, message.IndexOf("["));

            newMessage = newMessage.Substring(0, newMessage.LastIndexOf("]") + 1);

            List <ISound> sounds = JsonConvert.DeserializeObject <List <ISound> >(newMessage, JsonMudMessage.Settings);

            //engine.StopAllSounds();

            foreach (ISound sound in sounds)
            {
                string file = Path.Combine("Sounds", sound.SoundName);
                if (!File.Exists(file))
                {
                    RequestSound(file);
                }
            }

            SoundManager.PlaySounds(sounds);
        }
Ejemplo n.º 3
0
 internal void StopAll()
 {
     SoundManager.PlaySounds(new List <ISound>());
 }