diff --git a/src/ARKServerManager/App.config b/src/ARKServerManager/App.config index f18196df..f75a4ea4 100644 --- a/src/ARKServerManager/App.config +++ b/src/ARKServerManager/App.config @@ -347,6 +347,12 @@ asmdata + + https://discord.com/developers/applications + + + https://arkservermanager.freeforums.net/thread/8764/get-own-discord-bot + @@ -813,6 +819,12 @@ + + + + + False + diff --git a/src/ARKServerManager/App.xaml.cs b/src/ARKServerManager/App.xaml.cs index db92093f..38c4ce70 100644 --- a/src/ARKServerManager/App.xaml.cs +++ b/src/ARKServerManager/App.xaml.cs @@ -231,9 +231,9 @@ namespace ServerManagerTool return LogManager.GetLogger(loggerName); } - private static IList HandleDiscordCommand(CommandType commandType, string channelId, string profileId) + private static IList HandleDiscordCommand(CommandType commandType, string serverId, string channelId, string profileId) { - return new List() { $"{commandType}; {channelId}; {profileId ?? "no profile"}" }; + return new List() { $"{commandType}; {serverId}; {channelId}; {profileId ?? "no profile"}" }; } private static void MigrateSettings() @@ -481,7 +481,7 @@ namespace ServerManagerTool Task discordTask = Task.Run(async () => { - await ServerManagerBot.StartAsync(Config.Default.DiscordBotPrefix, Config.Default.DiscordBotToken, Config.Default.DataDir, HandleDiscordCommand, _tokenSource.Token); + await ServerManagerBot.StartAsync(Config.Default.DiscordBotToken, Config.Default.DiscordBotPrefix, Config.Default.DataDir, HandleDiscordCommand, _tokenSource.Token); }, _tokenSource.Token) .ContinueWith(t => { var message = t.Exception.InnerException is null ? t.Exception.Message : t.Exception.InnerException.Message; diff --git a/src/ARKServerManager/Config.Designer.cs b/src/ARKServerManager/Config.Designer.cs index 2ef36e03..f3913c05 100644 --- a/src/ARKServerManager/Config.Designer.cs +++ b/src/ARKServerManager/Config.Designer.cs @@ -2848,5 +2848,47 @@ namespace ServerManagerTool { this["DiscordBotToken"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string DiscordBotServerId { + get { + return ((string)(this["DiscordBotServerId"])); + } + set { + this["DiscordBotServerId"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("https://discord.com/developers/applications")] + public string DiscordBotApplyUrl { + get { + return ((string)(this["DiscordBotApplyUrl"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("https://arkservermanager.freeforums.net/thread/8764/get-own-discord-bot")] + public string DiscordBotHelpUrl { + get { + return ((string)(this["DiscordBotHelpUrl"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SectionDiscordBotIsExpanded { + get { + return ((bool)(this["SectionDiscordBotIsExpanded"])); + } + set { + this["SectionDiscordBotIsExpanded"] = value; + } + } } } diff --git a/src/ARKServerManager/Config.settings b/src/ARKServerManager/Config.settings index e4710c8e..8aa116c6 100644 --- a/src/ARKServerManager/Config.settings +++ b/src/ARKServerManager/Config.settings @@ -788,5 +788,17 @@ + + + + + https://discord.com/developers/applications + + + https://arkservermanager.freeforums.net/thread/8764/get-own-discord-bot + + + False + \ No newline at end of file diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml index fe8119e6..97c957cf 100644 --- a/src/ARKServerManager/Globalization/en-US/en-US.xaml +++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml @@ -610,7 +610,18 @@ This message will be displayed when the server shutdown has been cancelled. Show shutdown reason with ALL shutdown messages If enabled, the shutdown reason will be shown with all shutdown message; otherwise it will only be shown at the start of the server shutdown. - + + Enable Discord Bot + You will need to restart the server manager if you change any settings for the Discord Bot. + Token: + The token associated with the discord bot. + Server Id: + The id of the discord server the bot will listen to. + Prefix: + The prefix that must be used when sending a command via discord. + Get Token... + Help... + SMTP Email Settings Host: The name or IP address of the host used for SMTP transmissions. @@ -1179,6 +1190,12 @@ If enabled, the server will be restarted even if shutdown for Auto-Restarts and Auto-Updates. + + Discord Bot Details + Channel Id: + The id of the discord server channel the bot will listen to. + + Rules Enable Hardcore Mode diff --git a/src/ARKServerManager/Lib/ServerProfile.cs b/src/ARKServerManager/Lib/ServerProfile.cs index dfac1b1a..d517acb4 100644 --- a/src/ARKServerManager/Lib/ServerProfile.cs +++ b/src/ARKServerManager/Lib/ServerProfile.cs @@ -957,6 +957,16 @@ namespace ServerManagerTool.Lib } #endregion + #region Discord Bot + public static readonly DependencyProperty DiscordChannelIdProperty = DependencyProperty.Register(nameof(DiscordChannelId), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty)); + [DataMember] + public string DiscordChannelId + { + get { return (string)GetValue(DiscordChannelIdProperty); } + set { SetValue(DiscordChannelIdProperty, value); } + } + #endregion + #region Rules public static readonly DependencyProperty EnableHardcoreProperty = DependencyProperty.Register(nameof(EnableHardcore), typeof(bool), typeof(ServerProfile), new PropertyMetadata(false)); [IniFileEntry(IniFiles.GameUserSettings, IniSections.GUS_ServerSettings, ServerProfileCategory.Rules, "ServerHardcore")] diff --git a/src/ARKServerManager/Styles/Default.xaml b/src/ARKServerManager/Styles/Default.xaml index e2b09de0..9fecf6e6 100644 --- a/src/ARKServerManager/Styles/Default.xaml +++ b/src/ARKServerManager/Styles/Default.xaml @@ -713,5 +713,15 @@