From efd995390f8fcc1ca49b08e8d07f82a6eba30a0e Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 27 Oct 2017 19:25:56 +1100 Subject: [PATCH] Allow using custom nickserv for IRC bot (Thanks aezarkones) --- MCGalaxy/Network/IRCPlugin/IRCHandlers.cs | 7 +++++-- MCGalaxy/Server/ServerConfig.cs | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs b/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs index 5096ef6d8..7c56b1243 100644 --- a/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs +++ b/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs @@ -297,9 +297,12 @@ namespace MCGalaxy.Network { } void Authenticate() { + string nickServ = ServerConfig.IRCNickServName; + if (nickServ.Length == 0) return; + if (ServerConfig.IRCIdentify && ServerConfig.IRCPassword.Length > 0) { - Logger.Log(LogType.IRCCActivity, "Identifying with NickServ"); - bot.connection.Sender.PrivateMessage("NickServ", "IDENTIFY " + ServerConfig.IRCPassword); + Logger.Log(LogType.IRCCActivity, "Identifying with " + nickServ); + bot.connection.Sender.PrivateMessage(nickServ, "IDENTIFY " + ServerConfig.IRCPassword); } } diff --git a/MCGalaxy/Server/ServerConfig.cs b/MCGalaxy/Server/ServerConfig.cs index bfdb5baf2..7c060a1ee 100644 --- a/MCGalaxy/Server/ServerConfig.cs +++ b/MCGalaxy/Server/ServerConfig.cs @@ -154,6 +154,8 @@ namespace MCGalaxy { public static string IRCOpChannels = "#changethistoo"; [ConfigBool("irc-identify", "IRC bot", false)] public static bool IRCIdentify = false; + [ConfigString("irc-nickserv-name", "IRC bot", "NickServ", true)] + public static string IRCNickServName = "NickServ"; [ConfigString("irc-password", "IRC bot", "", true)] public static string IRCPassword = "";