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 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
index 0aff8781..b5a3622b 100644
--- a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
+++ b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
@@ -579,6 +579,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -621,7 +658,7 @@
-
+
@@ -645,7 +682,7 @@
-
+
diff --git a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
index 75b35541..6c0a866b 100644
--- a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
+++ b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
@@ -289,6 +289,16 @@ namespace ServerManagerTool
}
}
+ private void DiscordBotApply_Click(object sender, RoutedEventArgs e)
+ {
+ Process.Start(Config.Default.DiscordBotApplyUrl);
+ }
+
+ private void DiscordBotHelp_Click(object sender, RoutedEventArgs e)
+ {
+ Process.Start(Config.Default.DiscordBotHelpUrl);
+ }
+
private void ComboBox_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
var comboBox = sender as ComboBox;
@@ -326,6 +336,8 @@ namespace ServerManagerTool
textBox = SteamAPIKeyTextBox;
if (Equals(hideTextBox, HideEmailPasswordTextBox))
textBox = EmailPasswordTextBox;
+ if (Equals(hideTextBox, HideDiscordBotTokenTextBox))
+ textBox = DiscordBotTokenTextBox;
if (textBox != null)
{
@@ -349,6 +361,8 @@ namespace ServerManagerTool
hideTextBox = HideSteamAPIKeyTextBox;
if (textBox == EmailPasswordTextBox)
hideTextBox = HideEmailPasswordTextBox;
+ if (textBox == DiscordBotTokenTextBox)
+ hideTextBox = HideDiscordBotTokenTextBox;
if (hideTextBox != null)
{
diff --git a/src/ARKServerManager/Windows/ServerSettingsControl.xaml b/src/ARKServerManager/Windows/ServerSettingsControl.xaml
index 1ec4b3da..9916a9c7 100644
--- a/src/ARKServerManager/Windows/ServerSettingsControl.xaml
+++ b/src/ARKServerManager/Windows/ServerSettingsControl.xaml
@@ -1579,6 +1579,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/ConanServerManager/App.config b/src/ConanServerManager/App.config
index 3239cf16..4edbd09f 100644
--- a/src/ConanServerManager/App.config
+++ b/src/ConanServerManager/App.config
@@ -257,6 +257,12 @@
csmdata
+
+ https://discord.com/developers/applications
+
+
+ https://servermanagers.freeforums.net/thread/99/get-own-discord-bot
+
@@ -579,6 +585,12 @@
+
+
+
+
+ False
+
\ No newline at end of file
diff --git a/src/ConanServerManager/App.xaml.cs b/src/ConanServerManager/App.xaml.cs
index 9e6c6391..cd645870 100644
--- a/src/ConanServerManager/App.xaml.cs
+++ b/src/ConanServerManager/App.xaml.cs
@@ -230,9 +230,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 null;
+ return new List() { $"{commandType}; {serverId}; {channelId}; {profileId ?? "no profile"}" };
}
private static void MigrateSettings()
@@ -462,7 +462,7 @@ namespace ServerManagerTool
Task discordTask = Task.Run(async () =>
{
- await ServerManagerBot.StartAsync(Config.Default.DiscordBotPrefix, Config.Default.DiscordBotToken, Config.Default.DataPath, HandleDiscordCommand, _tokenSource.Token);
+ await ServerManagerBot.StartAsync(Config.Default.DiscordBotToken,Config.Default.DiscordBotPrefix, Config.Default.DataPath, 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/ConanServerManager/Config.Designer.cs b/src/ConanServerManager/Config.Designer.cs
index 924bbc88..7a1fa204 100644
--- a/src/ConanServerManager/Config.Designer.cs
+++ b/src/ConanServerManager/Config.Designer.cs
@@ -2001,5 +2001,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://servermanagers.freeforums.net/thread/99/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/ConanServerManager/Config.settings b/src/ConanServerManager/Config.settings
index ed28a58a..b766c119 100644
--- a/src/ConanServerManager/Config.settings
+++ b/src/ConanServerManager/Config.settings
@@ -554,5 +554,17 @@
+
+
+
+
+ https://discord.com/developers/applications
+
+
+ https://servermanagers.freeforums.net/thread/99/get-own-discord-bot
+
+
+ False
+
\ No newline at end of file
diff --git a/src/ConanServerManager/Globalization/en-US/en-US.xaml b/src/ConanServerManager/Globalization/en-US/en-US.xaml
index 60916cec..706f59bb 100644
--- a/src/ConanServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ConanServerManager/Globalization/en-US/en-US.xaml
@@ -768,6 +768,17 @@
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.
@@ -1121,6 +1132,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.
+
+
Server File Details
NOTE: Any changes will require a server restart to take effect.
diff --git a/src/ConanServerManager/Lib/ServerProfile.cs b/src/ConanServerManager/Lib/ServerProfile.cs
index ed673611..25368472 100644
--- a/src/ConanServerManager/Lib/ServerProfile.cs
+++ b/src/ConanServerManager/Lib/ServerProfile.cs
@@ -567,6 +567,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 Server Files
public static readonly DependencyProperty ServerFilesBlacklistedProperty = DependencyProperty.Register(nameof(ServerFilesBlacklisted), typeof(PlayerUserList), typeof(ServerProfile), new PropertyMetadata(null));
[DataMember]
diff --git a/src/ConanServerManager/Styles/Default.xaml b/src/ConanServerManager/Styles/Default.xaml
index 59ac044d..75585067 100644
--- a/src/ConanServerManager/Styles/Default.xaml
+++ b/src/ConanServerManager/Styles/Default.xaml
@@ -671,5 +671,15 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ConanServerManager/Windows/GlobalSettingsControl.xaml b/src/ConanServerManager/Windows/GlobalSettingsControl.xaml
index 1b02776d..4ad0b19a 100644
--- a/src/ConanServerManager/Windows/GlobalSettingsControl.xaml
+++ b/src/ConanServerManager/Windows/GlobalSettingsControl.xaml
@@ -527,6 +527,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -569,7 +606,7 @@
-
+
@@ -593,7 +630,7 @@
-
+
diff --git a/src/ConanServerManager/Windows/GlobalSettingsControl.xaml.cs b/src/ConanServerManager/Windows/GlobalSettingsControl.xaml.cs
index df398ec8..2b59e598 100644
--- a/src/ConanServerManager/Windows/GlobalSettingsControl.xaml.cs
+++ b/src/ConanServerManager/Windows/GlobalSettingsControl.xaml.cs
@@ -257,6 +257,16 @@ namespace ServerManagerTool
Process.Start(Config.Default.SteamWebAPIKeyHelpUrl);
}
+ private void DiscordBotApply_Click(object sender, RoutedEventArgs e)
+ {
+ Process.Start(Config.Default.DiscordBotApplyUrl);
+ }
+
+ private void DiscordBotHelp_Click(object sender, RoutedEventArgs e)
+ {
+ Process.Start(Config.Default.DiscordBotHelpUrl);
+ }
+
private async void SteamCMDAuthenticate_Click(object sender, RoutedEventArgs e)
{
var cursor = this.Cursor;
@@ -335,6 +345,8 @@ namespace ServerManagerTool
textBox = SteamAPIKeyTextBox;
if (Equals(hideTextBox, HideEmailPasswordTextBox))
textBox = EmailPasswordTextBox;
+ if (Equals(hideTextBox, HideDiscordBotTokenTextBox))
+ textBox = DiscordBotTokenTextBox;
if (textBox != null)
{
@@ -358,6 +370,8 @@ namespace ServerManagerTool
hideTextBox = HideSteamAPIKeyTextBox;
if (textBox == EmailPasswordTextBox)
hideTextBox = HideEmailPasswordTextBox;
+ if (textBox == DiscordBotTokenTextBox)
+ hideTextBox = HideDiscordBotTokenTextBox;
if (hideTextBox != null)
{
diff --git a/src/ConanServerManager/Windows/ServerSettingsControl.xaml b/src/ConanServerManager/Windows/ServerSettingsControl.xaml
index b636e8b1..7388d096 100644
--- a/src/ConanServerManager/Windows/ServerSettingsControl.xaml
+++ b/src/ConanServerManager/Windows/ServerSettingsControl.xaml
@@ -1062,6 +1062,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+