From 9ccc01c4a69c0e36392a49b3f8de50f77eba48cc Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Thu, 28 Jan 2016 12:04:25 +0100 Subject: [PATCH] maybe this was causing stutters? --- NadekoBot/Modules/Music.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/NadekoBot/Modules/Music.cs b/NadekoBot/Modules/Music.cs index fcd3ca5e..de2f9cfd 100644 --- a/NadekoBot/Modules/Music.cs +++ b/NadekoBot/Modules/Music.cs @@ -18,7 +18,7 @@ namespace NadekoBot.Modules { .Where(kvp => kvp.Value.CurrentSong == null && kvp.Value.SongQueue.Count == 0)) { var val = mp.Value; - musicPlayers.TryRemove(mp.Key, out val); + (musicPlayers as System.Collections.IDictionary).Remove(mp.Key); } } @@ -37,9 +37,10 @@ namespace NadekoBot.Modules { public Music() : base() { Timer cleaner = new Timer(); - cleaner.Elapsed += (s, e) => CleanMusicPlayers(); + cleaner.Elapsed += (s, e) => System.Threading.Tasks.Task.Run(() => CleanMusicPlayers()); cleaner.Interval = 10000; cleaner.Start(); + /* Timer statPrinter = new Timer(); NadekoBot.client.Connected += (s, e) => { if (statPrinter.Enabled) return; @@ -47,7 +48,7 @@ namespace NadekoBot.Modules { statPrinter.Interval = 5000; statPrinter.Start(); }; - + */ } public override void Install(ModuleManager manager) { @@ -82,7 +83,7 @@ namespace NadekoBot.Modules { .Description("Pauses the song") .Do(async e => { if (musicPlayers.ContainsKey(e.Server) == false) return; - await e.Send("This feature is coming VERY soon."); + await e.Send("This feature is coming tomorrow."); /* if (musicPlayers[e.Server].Pause()) if (musicPlayers[e.Server].IsPaused)