mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
RCON Broadcast Mode
- Added RCON broadcast mode selection to ASM global settings. - Added new Mode selection method to ServerApp, so the correct command is used.
This commit is contained in:
parent
35d8153236
commit
dc830c602c
9 changed files with 149 additions and 107 deletions
|
|
@ -763,6 +763,9 @@
|
|||
<sys:String x:Key="GlobalSettings_Alerts_ModUpdateDetectedTooltip">This message will be displayed when the server manager detects one or more mods are out of date.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_Alerts_ForceRespawnDinosLabel">Force Respawn Dinos Warning:</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_Alerts_ForceRespawnDinosTooltip">This message will be displayed when the server is being started and a wild dino wipe is scheduled.</sys:String>
|
||||
|
||||
<sys:String x:Key="GlobalSettings_RCON_ModeLabel">RCON Broadcast Mode:</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_RCON_ModeTooltip">Select the method used by the server manager to send auto process messages to the game clients via RCON.</sys:String>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Main Window -->
|
||||
|
|
|
|||
|
|
@ -2319,6 +2319,23 @@ namespace ServerManagerTool.Lib
|
|||
return ModUtils.ValidateModList(modIdList);
|
||||
}
|
||||
|
||||
public static string GetMutexName(string directory)
|
||||
{
|
||||
using (var hashAlgo = MD5.Create())
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
var hashStr = Encoding.UTF8.GetBytes(directory ?? Assembly.GetExecutingAssembly().Location);
|
||||
var hash = hashAlgo.ComputeHash(hashStr);
|
||||
foreach (var b in hash)
|
||||
{
|
||||
builder.Append(b.ToString("x2"));
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetProfileBackupFolder(ServerProfileSnapshot profile)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Config.Default.BackupPath))
|
||||
|
|
@ -2335,20 +2352,15 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public static string GetProfileServerConfigDir(ServerProfileSnapshot profile) => Path.Combine(profile.InstallDirectory, Config.Default.ServerConfigRelativePath);
|
||||
|
||||
public static string GetMutexName(string directory)
|
||||
private static string GetRconMessageCommand(string commandValue)
|
||||
{
|
||||
using (var hashAlgo = MD5.Create())
|
||||
switch (commandValue.ToLower())
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
case "global":
|
||||
return ServerRCON.RCON_COMMAND_SERVERCHAT;
|
||||
|
||||
var hashStr = Encoding.UTF8.GetBytes(directory ?? Assembly.GetExecutingAssembly().Location);
|
||||
var hash = hashAlgo.ComputeHash(hashStr);
|
||||
foreach (var b in hash)
|
||||
{
|
||||
builder.Append(b.ToString("x2"));
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
default:
|
||||
return ServerRCON.RCON_COMMAND_BROADCAST;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2669,7 +2681,7 @@ namespace ServerManagerTool.Lib
|
|||
if (string.IsNullOrWhiteSpace(message) || !SendMessages)
|
||||
return false;
|
||||
|
||||
var sent = await SendCommandAsync($"{Config.Default.RCON_MessageCommand.ToLower()} {message}", false);
|
||||
var sent = await SendCommandAsync($"{GetRconMessageCommand(Config.Default.RCON_MessageCommand)} {message}", false);
|
||||
|
||||
if (sent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -798,6 +798,11 @@
|
|||
<cctl:AnnotatedSlider Grid.Row="6" Grid.Column="0" Margin="0" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysLabel}" Value="{Binding Config.LoggingMaxArchiveDays}" Minimum="1" Maximum="365" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Days}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
|
||||
<cctl:AnnotatedSlider Grid.Row="7" Grid.Column="0" Margin="0" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesLabel}" Value="{Binding Config.LoggingMaxArchiveFiles}" Minimum="1" Maximum="1000" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Files}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
|
||||
<StackPanel Grid.Row="7" Grid.Column="1" Margin="0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource GlobalSettings_RCON_ModeLabel}" VerticalAlignment="Center"/>
|
||||
<ComboBox Name="RconMessageModesComboBox" Margin="5" ItemsSource="{Binding ElementName=GlobalSettings, Path=RconMessageModes}" SelectedValue="{Binding Config.RCON_MessageCommand}" ToolTip="{DynamicResource GlobalSettings_RCON_ModeTooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ namespace ServerManagerTool
|
|||
public static readonly DependencyProperty WindowStatesServerMonitorProperty = DependencyProperty.Register(nameof(WindowStatesServerMonitor), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty DiscordBotLogLevelsProperty = DependencyProperty.Register(nameof(DiscordBotLogLevels), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty DiscordBotWhitelistProperty = DependencyProperty.Register(nameof(DiscordBotWhitelist), typeof(List<DiscordBotWhitelistItem>), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty RconMessageModesProperty = DependencyProperty.Register(nameof(RconMessageModes), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
|
||||
public GlobalSettingsControl()
|
||||
{
|
||||
|
|
@ -52,6 +53,7 @@ namespace ServerManagerTool
|
|||
PopulateWindowsStatesMainWindowComboBox();
|
||||
PopulateWindowsStatesServerMonitorWindowComboBox();
|
||||
PopulateDiscordBotLogLevelsComboBox();
|
||||
PopulateRconMessageModesComboBox();
|
||||
|
||||
DiscordBotWhitelist = new List<DiscordBotWhitelistItem>();
|
||||
if (Config.DiscordBotWhitelist != null)
|
||||
|
|
@ -116,6 +118,12 @@ namespace ServerManagerTool
|
|||
set { SetValue(DiscordBotWhitelistProperty, value); }
|
||||
}
|
||||
|
||||
public ComboBoxItemList RconMessageModes
|
||||
{
|
||||
get { return (ComboBoxItemList)GetValue(RconMessageModesProperty); }
|
||||
set { SetValue(RconMessageModesProperty, value); }
|
||||
}
|
||||
|
||||
public void ApplyChangesToConfig()
|
||||
{
|
||||
if (Config.DiscordBotWhitelist is null)
|
||||
|
|
@ -412,6 +420,7 @@ namespace ServerManagerTool
|
|||
|
||||
PopulateWindowsStatesMainWindowComboBox();
|
||||
PopulateWindowsStatesServerMonitorWindowComboBox();
|
||||
PopulateRconMessageModesComboBox();
|
||||
|
||||
App.Instance.OnResourceDictionaryChanged(Config.CultureName);
|
||||
}
|
||||
|
|
@ -552,6 +561,27 @@ namespace ServerManagerTool
|
|||
}
|
||||
}
|
||||
|
||||
private void PopulateRconMessageModesComboBox()
|
||||
{
|
||||
var selectedValue = this.RconMessageModesComboBox?.SelectedValue ?? Config.RCON_MessageCommand;
|
||||
var list = new ComboBoxItemList();
|
||||
|
||||
foreach (InputMode inputMode in Enum.GetValues(typeof(InputMode)))
|
||||
{
|
||||
if (inputMode == InputMode.Command)
|
||||
continue;
|
||||
|
||||
var displayMember = _globalizer.GetResourceString($"InputMode_{inputMode}") ?? inputMode.ToString();
|
||||
list.Add(new Common.Model.ComboBoxItem(inputMode.ToString(), displayMember));
|
||||
}
|
||||
|
||||
this.RconMessageModes = list;
|
||||
if (this.RconMessageModesComboBox != null)
|
||||
{
|
||||
this.RconMessageModesComboBox.SelectedValue = selectedValue;
|
||||
}
|
||||
}
|
||||
|
||||
#region Discord Bot Whitelist
|
||||
private void AddDiscordBotWhitelist_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,30 @@
|
|||
<link href="http://arkservermanager.freeforums.net/" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:2C48A585-72D2-43FB-8987-6B5F0B3E460F</id>
|
||||
<title>1.1.425 (1.1.425.1)</title>
|
||||
<summary>1.1.425.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-05-06T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Global Settings - added RCON broadcast mode droplist, so auto processes can send messages via RCON using this mode.</li>
|
||||
<li>Auto Processes - changed the message broadcast to use the new config setting, not a hardcoded value.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:018EF426-73B9-4BF6-9602-77EE2CFD864C</id>
|
||||
<title>1.1.424 (1.1.424.3)</title>
|
||||
|
|
|
|||
|
|
@ -5,68 +5,22 @@
|
|||
<title>Ark Server Manager Version Feed</title>
|
||||
<subtitle>This is the Ark Server Manager beta version feed.</subtitle>
|
||||
<link href="http://arkservermanager.freeforums.net/" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
<updated>2022-05-06T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:730AEAAD-1804-432C-8ABB-C0B970D86B23</id>
|
||||
<title>1.1.424 (1.1.424.3)</title>
|
||||
<summary>1.1.424.3</summary>
|
||||
<id>urn:uuid:2C48A585-72D2-43FB-8987-6B5F0B3E460F</id>
|
||||
<title>1.1.425 (1.1.425.1)</title>
|
||||
<summary>1.1.425.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Server Shutdown window - when shutting down a server, the Cancel Shutdown button is now displayed.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:9AC8F213-3411-475D-8E43-8AB67AF81BD8</id>
|
||||
<title>1.1.424 (1.1.424.2)</title>
|
||||
<summary>1.1.424.2</summary>
|
||||
<link href="" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
<updated>2022-05-06T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>pt-BR Translation file updated.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:018EF426-73B9-4BF6-9602-77EE2CFD864C</id>
|
||||
<title>1.1.424 (1.1.424.1)</title>
|
||||
<summary>1.1.424.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>World Save Backup - added the SaveGames folder to the to the backup zip file.</li>
|
||||
<li>World Save Restore - now restores the SaveGames folder.</li>
|
||||
<li>Global Settings - added RCON broadcast mode droplist, so auto processes can send messages via RCON using this mode.</li>
|
||||
<li>Auto Processes - changed the message broadcast to use the new config setting, not a hardcoded value.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2205,6 +2205,23 @@ namespace ServerManagerTool.Lib
|
|||
return ModUtils.ValidateModList(modIdList);
|
||||
}
|
||||
|
||||
public static string GetMutexName(string directory)
|
||||
{
|
||||
using (var hashAlgo = MD5.Create())
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
var hashStr = Encoding.UTF8.GetBytes(directory ?? Assembly.GetExecutingAssembly().Location);
|
||||
var hash = hashAlgo.ComputeHash(hashStr);
|
||||
foreach (var b in hash)
|
||||
{
|
||||
builder.Append(b.ToString("x2"));
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetProfileBackupFolder(ServerProfileSnapshot profile)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Config.Default.BackupPath))
|
||||
|
|
@ -2221,20 +2238,18 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public static string GetProfileServerConfigDir(ServerProfileSnapshot profile) => Path.Combine(profile.InstallDirectory, Config.Default.ServerConfigRelativePath);
|
||||
|
||||
public static string GetMutexName(string directory)
|
||||
private static string GetRconMessageCommand(string commandValue)
|
||||
{
|
||||
using (var hashAlgo = MD5.Create())
|
||||
switch (commandValue.ToLower())
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
case "alert":
|
||||
return ServerRcon.RCON_COMMAND_ALERT;
|
||||
|
||||
var hashStr = Encoding.UTF8.GetBytes(directory ?? Assembly.GetExecutingAssembly().Location);
|
||||
var hash = hashAlgo.ComputeHash(hashStr);
|
||||
foreach (var b in hash)
|
||||
{
|
||||
builder.Append(b.ToString("x2"));
|
||||
}
|
||||
case "server":
|
||||
return ServerRcon.RCON_COMMAND_SERVER;
|
||||
|
||||
return builder.ToString();
|
||||
default:
|
||||
return ServerRcon.RCON_COMMAND_BROADCAST;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2563,7 +2578,7 @@ namespace ServerManagerTool.Lib
|
|||
if (string.IsNullOrWhiteSpace(message) || !SendMessages)
|
||||
return false;
|
||||
|
||||
var sent = await SendCommandAsync($"{Config.Default.RCON_MessageCommand.ToLower()} {message}", false);
|
||||
var sent = await SendCommandAsync($"{GetRconMessageCommand(Config.Default.RCON_MessageCommand)} {message}", false);
|
||||
|
||||
if (sent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,30 @@
|
|||
<title>Conan Server Manager Version Feed</title>
|
||||
<subtitle>This is the Conan Server Manager release version feed.</subtitle>
|
||||
<link href="http://servermanagers.freeforums.net/" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
<updated>2022-05-06T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:AD8ABBB5-093A-4FDB-B473-FCED2DB46781</id>
|
||||
<title>1.1.69 (1.1.69.1)</title>
|
||||
<summary>1.1.69.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-05-06T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Fixed an issue that would not send through the auto process messages via RCON using the correct mode selected in the global settings.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:FF2C83B2-6D10-4217-A021-5B5F090FC480</id>
|
||||
|
|
|
|||
|
|
@ -5,45 +5,21 @@
|
|||
<title>Conan Server Manager Version Feed</title>
|
||||
<subtitle>This is the Conan Server Manager beta version feed.</subtitle>
|
||||
<link href="http://servermanagers.freeforums.net/" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
<updated>2022-05-06T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:FC1CF7D1-7CFC-41BD-A290-4F76EB6012E8</id>
|
||||
<title>1.1.68 (1.1.68.2)</title>
|
||||
<summary>1.1.68.2</summary>
|
||||
<id>urn:uuid:AD8ABBB5-093A-4FDB-B473-FCED2DB46781</id>
|
||||
<title>1.1.69 (1.1.69.1)</title>
|
||||
<summary>1.1.69.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
<updated>2022-05-06T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Server Shutdown window - when shutting down a server, the Cancel Shutdown button is now displayed.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:FF2C83B2-6D10-4217-A021-5B5F090FC480</id>
|
||||
<title>1.1.68 (1.1.68.1)</title>
|
||||
<summary>1.1.68.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-05-02T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>World Save Backup - added the SaveGames folder to the to the backup zip file.</li>
|
||||
<li>World Save Restore - now restores the SaveGames folder.</li>
|
||||
<li>Fixed an issue that would not send through the auto process messages via RCON using the correct mode selected in the global settings.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue