diff --git a/TGServerService/ChatProviders/IRCChatProvider.cs b/TGServerService/ChatProviders/IRCChatProvider.cs index b5cb084687..2fdc9084d1 100644 --- a/TGServerService/ChatProviders/IRCChatProvider.cs +++ b/TGServerService/ChatProviders/IRCChatProvider.cs @@ -307,15 +307,18 @@ namespace TGServerService.ChatProviders return; lock (IRCLock) { - foreach (var cid in irc.JoinedChannels) + string cids = ""; + for (var I = 0; I < irc.JoinedChannels.Count; ++I) { + var cid = irc.JoinedChannels[I]; bool SendToThisChannel = (mt.HasFlag(MessageType.AdminInfo) && IRCConfig.AdminChannels.Contains(cid)) || (mt.HasFlag(MessageType.DeveloperInfo) && IRCConfig.DevChannels.Contains(cid)) || (mt.HasFlag(MessageType.GameInfo) && IRCConfig.GameChannels.Contains(cid)) || (mt.HasFlag(MessageType.WatchdogInfo) && IRCConfig.WatchdogChannels.Contains(cid)); if (SendToThisChannel) - irc.SendMessage(SendType.Message, cid, message); + cids += I > 0 ? ',' + cid : cid; } + irc.SendMessage(SendType.Message, cids, message); } } diff --git a/TGServerService/EventID.cs b/TGServerService/EventID.cs index 79bd18456b..114173498d 100644 --- a/TGServerService/EventID.cs +++ b/TGServerService/EventID.cs @@ -242,8 +242,16 @@ namespace TGServerService /// Warning: An error occurred during a operation /// RepoChangelogFail = 5700, + /// + /// Info: When the dll is updated for the + /// + InterfaceDLLUpdated = 5800, + /// + /// Error: An error occurred while updating the dll for the + /// + InterfaceDLLUpdateFail = 5900, - //YO THERE'S SPACE FOR 3 IDS HERE, USE EM!!! + //YO THERE'S SPACE FOR 1 MORE ID HERE, USE IT!!! /// /// Error: When an exception occurs while the is stopping diff --git a/TGServerService/ServerInstance/DreamDaemon.cs b/TGServerService/ServerInstance/DreamDaemon.cs index d84400edc1..36a4e9c703 100644 --- a/TGServerService/ServerInstance/DreamDaemon.cs +++ b/TGServerService/ServerInstance/DreamDaemon.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection; using System.Threading; using System.Timers; @@ -516,11 +517,37 @@ namespace TGServerService /// If , overwrites the 's current interface .dll if it exists void UpdateInterfaceDll(bool overwrite) { - if (File.Exists(InterfaceDLLName) && !overwrite) + var FileExists = File.Exists(InterfaceDLLName); + if (FileExists && !overwrite) return; //Copy the interface dll to the static dir var InterfacePath = Assembly.GetAssembly(typeof(DreamDaemonBridge)).Location; - File.Copy(InterfacePath, InterfaceDLLName, overwrite); + try + { + if (FileExists) + { + var Old = File.ReadAllBytes(InterfaceDLLName); + var New = File.ReadAllBytes(InterfacePath); + if (Old.SequenceEqual(New)) + return; //no need + } + File.Copy(InterfacePath, InterfaceDLLName, overwrite); + Service.WriteInfo("Updated interface DLL", TGServerService.EventID.InterfaceDLLUpdated); + } + catch + { + try + { + //ok the things being stupid and hasn't released the dll yet, try ONCE more + Thread.Sleep(1000); + File.Copy(InterfacePath, InterfaceDLLName, overwrite); + } + catch (Exception e) + { + //intentionally using the fi + Service.WriteError("Failed to update interface DLL! Error: " + e.ToString(), TGServerService.EventID.InterfaceDLLUpdateFail); + } + } } /// diff --git a/Version.cs b/Version.cs index 4ee176030a..87f3405212 100644 --- a/Version.cs +++ b/Version.cs @@ -12,6 +12,6 @@ using System.Reflection; // [assembly: AssemblyVersion("1.0.*")] //It's impossible to make these a define, don't say I didn't warn you -[assembly: AssemblyVersion("3.1.5.0")] -[assembly: AssemblyFileVersion("3.1.5.0")] -[assembly: AssemblyInformationalVersion("3.1.5.0")] +[assembly: AssemblyVersion("3.1.5.1")] +[assembly: AssemblyFileVersion("3.1.5.1")] +[assembly: AssemblyInformationalVersion("3.1.5.1")]