Server Monitor Changes

- fixed the display of the map name.
- added the ports as a grid column.
- language file update
This commit is contained in:
Brett Hewitson 2022-06-22 22:53:41 +10:00
parent 09659d9ae2
commit f51e92c5a2
17 changed files with 175 additions and 51 deletions

View file

@ -452,6 +452,7 @@
<sys:String x:Key="ServerMonitor_SelectedColumnLabel">Selected</sys:String>
<sys:String x:Key="ServerMonitor_ProfileColumnLabel">Profile</sys:String>
<sys:String x:Key="ServerMonitor_ServerColumnLabel">Server</sys:String>
<sys:String x:Key="ServerMonitor_PortsColumnLabel">Ports</sys:String>
<sys:String x:Key="ServerMonitor_MapColumnLabel">Map</sys:String>
<sys:String x:Key="ServerMonitor_ModsColumnLabel">Mods</sys:String>
<sys:String x:Key="ServerMonitor_VersionColumnLabel">Version</sys:String>

View file

@ -9,7 +9,7 @@
<!--#region Generic -->
<sys:String x:Key="Generic_TranslatedByLabel">翻译:</sys:String>
<sys:String x:Key="Generic_TranslatedBy">2022.06.13(叶凡) --交流群:109949666反馈</sys:String>
<sys:String x:Key="Generic_TranslatedBy">2022.06.20(叶凡,龍柒) --交流群:109949666反馈</sys:String>
<sys:String x:Key="Generic_ErrorLabel">错误</sys:String>
<!--#endregion-->
@ -84,6 +84,15 @@
<!--#region 处理器亲和性-->
<sys:String x:Key="ProcessorAffinity_Invalid">无效</sys:String>
<sys:String x:Key="ProcessorAffinity_All">所有</sys:String>
<!--#endregion-->
<!--#region 任务优先级 -->
<sys:String x:Key="TaskPriority_Idle">闲置</sys:String>
<sys:String x:Key="TaskPriority_BelowNormal">低于正常</sys:String>
<sys:String x:Key="TaskPriority_Normal">正常</sys:String>
<sys:String x:Key="TaskPriority_AboveNormal">高于正常</sys:String>
<sys:String x:Key="TaskPriority_High">高</sys:String>
<sys:String x:Key="TaskPriority_RealTime">实时</sys:String>
<!--#endregion-->
<!--#region 窗口启动模式 -->
@ -684,6 +693,8 @@
<sys:String x:Key="GlobalSettings_DiscordBotLogLevelLabel">日志级别:</sys:String>
<sys:String x:Key="GlobalSettings_DiscordBotApplyButtonLabel">领取令牌...</sys:String>
<sys:String x:Key="GlobalSettings_DiscordBotHelpButtonLabel">帮助...</sys:String>
<sys:String x:Key="GlobalSettings_DiscordBotAllServersKeywordLabel">所有的配置文件别名:</sys:String>
<sys:String x:Key="GlobalSettings_DiscordBotAllServersKeywordTooltip">当通过discord向与discord频道相关的所有配置文件发送命令时要使用的别名。不要包括空格或特殊字符。要禁用所有配置文件的别名请清除该值。</sys:String>
<sys:String x:Key="ServerSettings_DiscordBotAllowAllBotsLabel">允许所有机器人</sys:String>
<sys:String x:Key="ServerSettings_DiscordBotAllowAllBotsTooltip">如果启用,服务器管理器机器人将响应所有其他机器人,否则将忽略它们,除非它们在白名单中.</sys:String>
<sys:String x:Key="GlobalSettings_DiscordBotWhitelistLabel">机器人白名单</sys:String>
@ -836,6 +847,7 @@
<sys:String x:Key="MainWindow_OpenPluginsTooltip">打开插件</sys:String>
<sys:String x:Key="MainWindow_OpenHelpTooltip">打开帮助</sys:String>
<sys:String x:Key="MainWindow_OpenServerMonitorTooltip">打开服务器监控器</sys:String>
<sys:String x:Key="MainWindow_JoinDiscordTooltip">加入不和谐Discord服务器</sys:String>
<sys:String x:Key="MainWindow_UpdateToLabelFormat">升级到 {0} 最新版!</sys:String>
<sys:String x:Key="MainWindow_TaskStatusLabel">任务状态</sys:String>
<sys:String x:Key="MainWindow_TaskAdminErrorTitle">需要管理权限</sys:String>
@ -972,7 +984,9 @@
<!--#endregion-->
<!--#region 服务器设置 - 一般按​​钮 -->
<sys:String x:Key="ServerSettings_SupportZipButtonLabel">创建支持Zip</sys:String>
<sys:String x:Key="ServerSettings_SettingFindButtonLabel">查找</sys:String>
<sys:String x:Key="ServerSettings_SettingFindButtonTooltip">查找设置</sys:String>
<sys:String x:Key="ServerSettings_SupportZipButtonLabel">创建支持Zip</sys:String>
<sys:String x:Key="ServerSettings_SupportZipButtonTooltip">创建一个zip文件其中包含服务器管理器支持团队用来诊断问题所需的所有文件。</sys:String>
<sys:String x:Key="ServerSettings_SyncProfileButtonLabel">同步</sys:String>
<sys:String x:Key="ServerSettings_SyncProfileButtonTooltip">将设置从此配置文件复制到一个或多个配置文件。</sys:String>
@ -1098,7 +1112,7 @@
<sys:String x:Key="ServerSettings_MapPathTooltip">标准地图名称 (例如. TheIsland,TheCenter,ScorchedEarth_P,Ragnarok).或本地MOD地图 例如:(/Game/Mods/504122600/Valhalla) 数字是MOD ID 后面是MOD地图名字记得更新你的服务器下载MOD地图。</sys:String>
<sys:String x:Key="ServerSettings_TotalConversionLabel">总转换MOD ID:</sys:String>
<sys:String x:Key="ServerSettings_TotalConversionTooltip">总转换MOD ID是方舟里的一个模式转换.</sys:String>
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameTooltip">读取总转换MOD ID找到地图名称</sys:String>
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameTooltip">读取总转换MOD ID找到地图名称</sys:String>
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameSuccessTitle">查找总转换地图名称</sys:String>
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameSuccessLabel">地图名称已更新。</sys:String>
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameErrorTitle">查找总转换地图名称错误</sys:String>
@ -1182,7 +1196,7 @@
<sys:String x:Key="ServerSettings_StasisKeepControllersTooltip">如果启用,服务器可以通过将人工智能保存在静态生物的内存中来获得性能。 注意:你的服务器必须有大量的内存,否则你的服务器会有很大的内存开销。</sys:String>
<sys:String x:Key="ServerSettings_UseNoHangDetectionLabel">无挂起检测</sys:String>
<sys:String x:Key="ServerSettings_UseNoHangDetectionTooltip">如果启用,可防止因挂起而导致的某些类型的崩溃(服务器挂起时,可能会出现服务器滞后的情况)。</sys:String>
<sys:String x:Key="ServerSettings_NoDinosLabel">没有恐龙</sys:String>
<sys:String x:Key="ServerSettings_NoDinosLabel">没有恐龙</sys:String>
<sys:String x:Key="ServerSettings_NoDinosTooltip">如果启用,则不会在地图上产生恐龙。</sys:String>
<sys:String x:Key="ServerSettings_ServerAllowAnselLabel">服务器允许NVIDIA Ansel技术</sys:String>
<sys:String x:Key="ServerSettings_ServerAllowAnselTooltip">如果启用在单个玩家中激活NVIDIA Ansel支持。 连接到服务器时,即使通电和点亮,这也会导致大多数灯(灯)不再起作用。</sys:String>
@ -3164,27 +3178,31 @@
<sys:String x:Key="Fenrir_Character_BP_C">芬里尔冰霜巨狼</sys:String>
<sys:String x:Key="Andrewsarchus_Character_BP_C">安氏兽</sys:String>
<sys:String x:Key="Desmodus_Character_BP_C">吸血蝙蝠</sys:String>
<sys:String x:Key="Direbear_Character_BP_SteinbjornMinion_C">碎石恐熊</sys:String>
<!--#endregion-->
<!--#region 恐龙/生物类名称 - 维京岛-BOSS-->
<sys:String x:Key="BeylaMinion_Character_BP_C">爪牙仆从</sys:String>
<sys:String x:Key="Beyla_Character_BP_C">爪牙</sys:String>
<sys:String x:Key="SpiderL_Character_BP_Easy_FJ_C">牧羊人 (简单)</sys:String>
<sys:String x:Key="SpiderL_Character_BP_Hard_FJ_C">牧羊人 (困难)</sys:String>
<sys:String x:Key="SpiderL_Character_BP_Medium_FJ_C">牧羊人 (中等)</sys:String>
<sys:String x:Key="Dragon_Character_BP_Boss_Easy_FJ_C">蜻蜓(简单)</sys:String>
<sys:String x:Key="Dragon_Character_BP_Boss_Hard_FJ_C">蜻蜓(困难)</sys:String>
<sys:String x:Key="Dragon_Character_BP_Boss_Medium_FJ_C">蜻蜓(中等)</sys:String>
<sys:String x:Key="BeylaMinion_Character_BP_C">贝拉仆从</sys:String>
<sys:String x:Key="Beyla_Character_BP_C">贝拉</sys:String>
<sys:String x:Key="SpiderL_Character_BP_Easy_FJ_C">育母蛛蛛菜斯立克斯(简单)</sys:String>
<sys:String x:Key="SpiderL_Character_BP_Hard_FJ_C">育母蛛蛛菜斯立克斯(困难)</sys:String>
<sys:String x:Key="SpiderL_Character_BP_Medium_FJ_C">育母蛛蛛菜斯立克斯(中等)</sys:String>
<sys:String x:Key="Dragon_Character_BP_Boss_Easy_FJ_C">喷火龙(简单)</sys:String>
<sys:String x:Key="Dragon_Character_BP_Boss_Hard_FJ_C">喷火龙(困难)</sys:String>
<sys:String x:Key="Dragon_Character_BP_Boss_Medium_FJ_C">喷火龙(中等)</sys:String>
<sys:String x:Key="Fenrir_Character_BP_MiniBoss_Hati_C">哈蒂</sys:String>
<sys:String x:Key="Fenrir_Character_BP_MiniBoss_Skoll_C">斯库尔</sys:String>
<sys:String x:Key="Fenrir_Character_BP_MiniBoss_C">召唤 芬里尔</sys:String>
<sys:String x:Key="Steinbjorn_Character_BP_C">斯坦比约恩</sys:String>
<sys:String x:Key="Fenrir_Character_BP_Minion_C">芬里厄的奴才</sys:String>
<sys:String x:Key="Fenrir_Character_BP_Boss_Easy_C">芬里尔巨狼(简单)</sys:String>
<sys:String x:Key="Fenrir_Character_BP_Boss_Medium_C">芬里尔巨狼(中等)</sys:String>
<sys:String x:Key="Fenrir_Character_BP_Boss_Hard_C">芬里尔巨狼(困难)</sys:String>
<sys:String x:Key="Gorilla_Character_BP_Easy_FJ_C">巨齿兽(简单)</sys:String>
<sys:String x:Key="Gorilla_Character_BP_Medium_FJ_C">巨齿兽(中等)</sys:String>
<sys:String x:Key="Gorilla_Character_BP_Hard_FJ_C">巨齿兽(困难)</sys:String>
<sys:String x:Key="Gorilla_Character_BP_Easy_FJ_C">大金刚(简单)</sys:String>
<sys:String x:Key="Gorilla_Character_BP_Medium_FJ_C">大金刚(中等)</sys:String>
<sys:String x:Key="Gorilla_Character_BP_Hard_FJ_C">大金刚(困难)</sys:String>
<sys:String x:Key="Fenrir_Character_BP_Boss_C">芬里尔巨狼大BOSS</sys:String>
<!--#endregion-->
<!--#endregion-->
@ -5971,11 +5989,11 @@
<sys:String x:Key="SupplyCrate_Space_07_ElementDust_C">空投_青色(创世2)</sys:String>
<sys:String x:Key="SupplyCrate_Space_08_BlackPearls_C">空投_橙色(创世2)</sys:String>
<sys:String x:Key="SupplyCrate_Level45_LostIsland_C">黄色灯塔(维京岛)</sys:String>
<sys:String x:Key="SupplyCrate_Level45_LostIsland_Double_C">黄色灯塔双份(维京岛)</sys:String>
<sys:String x:Key="SupplyCrate_Level60_LostIsland_C">红色灯塔(维京岛)</sys:String>
<sys:String x:Key="SupplyCrate_Level60_LostIsland_Double_C">红色灯塔双份(维京岛)</sys:String>
<sys:String x:Key="SupplyCrate_Ruins_LostIsland_C">废墟地牢箱子(维京岛)</sys:String>
<sys:String x:Key="SupplyCrate_Level45_LostIsland_C">黄色补给箱(迷失岛)</sys:String>
<sys:String x:Key="SupplyCrate_Level45_LostIsland_Double_C">黄色补给箱(双份)</sys:String>
<sys:String x:Key="SupplyCrate_Level60_LostIsland_C">红色补给箱</sys:String>
<sys:String x:Key="SupplyCrate_Level60_LostIsland_Double_C">红色补给箱(双份)</sys:String>
<sys:String x:Key="SupplyCrate_Ruins_LostIsland_C">废墟地牢箱子</sys:String>
<!--#endregion-->
@ -6030,6 +6048,14 @@
<sys:String x:Key="DinoDropInventoryComponent_BossManticore_Easy_Ragnarok_C">Boss 清单 - 狮身蝎尾 (简单)</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_BossManticore_Medium_Ragnarok_C">Boss 清单 - 狮身蝎尾 (中等)</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_BossManticore_Hard_Ragnarok_C">Boss 清单 - 狮身蝎尾 (困难)</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_Steinbjorn_C">Boss 清单 - 斯坦比约恩</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_Hati_C">Boss 清单 - 哈蒂</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_Skoll_C">Boss 清单 - 斯科尔</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_Beyla_C">Boss 清单 - 贝拉</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_FenrirBoss_Easy_C">Boss 清单 - 芬里尔巨狼(简单)</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_FenrirBoss_Medium_C">Boss 清单 - 芬里尔巨狼(中等)</sys:String>
<sys:String x:Key="DinoDropInventoryComponent_FenrirBoss_Hard_C">Boss 清单 - 芬里尔巨狼(困难)</sys:String>
<!--#endregion-->
<!--#endregion-->
@ -7106,5 +7132,14 @@
<sys:String x:Key="DiscordBot_CountLabel">总数:</sys:String>
<sys:String x:Key="DiscordBot_MapLabel">地图:</sys:String>
<!--#endregion-->
<!--#region 查找设置窗口 -->
<sys:String x:Key="FindSettingWindow_Title">查找设置</sys:String>
<sys:String x:Key="FindSettingWindow_NotFoundErrorLabel">没有找到该设置: {0}</sys:String>
<sys:String x:Key="FindSettingWindow_FindButtonLabel">查找</sys:String>
<!--#endregion-->
</Globalization:GlobalizationResourceDictionary>

View file

@ -253,6 +253,7 @@ namespace ServerManagerTool.Lib
{
SetValue(ServerPortProperty, value);
ServerPeerPort = value + 1;
UpdatePortsString();
}
}
@ -260,7 +261,11 @@ namespace ServerManagerTool.Lib
public int ServerPeerPort
{
get { return (int)GetValue(ServerPeerPortProperty); }
set { SetValue(ServerPeerPortProperty, value); }
set
{
SetValue(ServerPeerPortProperty, value);
UpdatePortsString();
}
}
public static readonly DependencyProperty QueryPortProperty = DependencyProperty.Register(nameof(QueryPort), typeof(int), typeof(ServerProfile), new PropertyMetadata(27015));
@ -269,7 +274,18 @@ namespace ServerManagerTool.Lib
public int QueryPort
{
get { return (int)GetValue(QueryPortProperty); }
set { SetValue(QueryPortProperty, value); }
set
{
SetValue(QueryPortProperty, value);
UpdatePortsString();
}
}
public static readonly DependencyProperty PortsStringProperty = DependencyProperty.Register(nameof(PortsString), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
public string PortsString
{
get { return (string)GetValue(PortsStringProperty); }
set { SetValue(PortsStringProperty, value); }
}
public static readonly DependencyProperty ServerIPProperty = DependencyProperty.Register(nameof(ServerIP), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
@ -4572,6 +4588,11 @@ namespace ServerManagerTool.Lib
return true;
}
public void UpdatePortsString()
{
this.PortsString = $"{this.ServerPort}, {this.ServerPeerPort}, {this.QueryPort}";
}
public bool UpdateSchedules()
{
SaveLauncher();
@ -5346,6 +5367,8 @@ namespace ServerManagerTool.Lib
this.ClearValue(QueryPortProperty);
this.ClearValue(ServerIPProperty);
UpdatePortsString();
this.ClearValue(EnableBanListURLProperty);
this.ClearValue(BanListURLProperty);
this.ClearValue(MaxPlayersProperty);

View file

@ -16,14 +16,14 @@ namespace ServerManagerTool.Lib.ViewModel
if (valueString == null)
return string.Empty;
var name = GlobalizedApplication.Instance.GetResourceString(valueString);
var name = GlobalizedApplication.Instance.GetResourceString($"Map_{valueString}");
if (!string.IsNullOrWhiteSpace(name))
return name;
var mapName = ModUtils.GetMapName(valueString);
// check if the name is stored in the globalization file
name = GlobalizedApplication.Instance.GetResourceString(mapName);
name = GlobalizedApplication.Instance.GetResourceString($"Map_{mapName}");
if (!string.IsNullOrWhiteSpace(name))
return name;

View file

@ -679,13 +679,13 @@
</Button>
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_ServerPortLabel}" ToolTip="{DynamicResource ServerSettings_ServerPortTooltip}" Foreground="{DynamicResource UnSyncedSetting}"/>
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding ServerPort, Mode=TwoWay, Converter={cc:IntRangeValueConverter 1, 65535}, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" SourceUpdated="ServerPort_SourceUpdated" ToolTip="{DynamicResource ServerSettings_ServerPortTooltip}"/>
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding ServerPort, Mode=TwoWay, Converter={cc:IntRangeValueConverter 1, 65535}, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" SourceUpdated="Ports_SourceUpdated" ToolTip="{DynamicResource ServerSettings_ServerPortTooltip}"/>
<Label Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_ServerPeerPortLabel}" ToolTip="{DynamicResource ServerSettings_ServerPeerPortTooltip}" Foreground="{DynamicResource UnSyncedSetting}"/>
<TextBox Grid.Row="1" Grid.Column="3" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding ServerPeerPort}" ToolTip="{DynamicResource ServerSettings_ServerPeerPortTooltip}" IsEnabled="False"/>
<Label Grid.Row="1" Grid.Column="4" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_QueryPortLabel}" ToolTip="{DynamicResource ServerSettings_QueryPortTooltip}" Foreground="{DynamicResource UnSyncedSetting}"/>
<TextBox Grid.Row="1" Grid.Column="5" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding QueryPort, Converter={cc:IntRangeValueConverter 1, 65535}}" ToolTip="{DynamicResource ServerSettings_QueryPortTooltip}"/>
<TextBox Grid.Row="1" Grid.Column="5" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding QueryPort, Converter={cc:IntRangeValueConverter 1, 65535}, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" SourceUpdated="Ports_SourceUpdated" ToolTip="{DynamicResource ServerSettings_QueryPortTooltip}"/>
</Grid>
</GroupBox>

View file

@ -1289,10 +1289,11 @@ namespace ServerManagerTool
Settings.ValidateServerName();
}
private void ServerPort_SourceUpdated(object sender, DataTransferEventArgs e)
private void Ports_SourceUpdated(object sender, DataTransferEventArgs e)
{
// force the porperty to be updated.
// force the property to be updated.
Settings.ServerPort = Settings.ServerPort;
Settings.UpdatePortsString();
}
private void MOTD_SourceUpdated(object sender, DataTransferEventArgs e)

View file

@ -20,9 +20,11 @@
<br/>
<ul>
<li>Availability Status - Changed the Waiting for Publication status into two new statuses, to clarify the issue.</li>
<li>Server Monitor - Added a Ports column that shows the main server ports.</li>
<li>Rules Section - Fjordur Settings - added checkbox to enable/disable settings.</li>
<li>Rules Section - Ragnarok Settings - added settings for Ragnarok, located at the bottom of the section.</li>
<li>3rd Party Libraries - updated all library to latest versions.</li>
<li>zh-CN Translation file updated.</li>
</ul>
</p>
</div>

View file

@ -20,6 +20,8 @@
<br/>
<ul>
<li>Availability Status - Changed the Waiting for Publication status into two new statuses, to clarify the issue.</li>
<li>Server Monitor - Added a Ports column that shows the main server ports.</li>
<li>zh-CN Translation file updated.</li>
</ul>
</p>
</div>

View file

@ -4,15 +4,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:sm="clr-namespace:ServerManagerTool"
xmlns:cctl="clr-namespace:ServerManagerTool.Common.Controls;assembly=ServerManager.Common"
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
xmlns:ce="clr-namespace:ServerManagerTool.Common.Enums;assembly=ServerManager.Common"
xmlns:com="clr-namespace:ServerManagerTool.Common;assembly=ServerManager.Common"
xmlns:controls="clr-namespace:ServerManagerTool.Common.Controls;assembly=ServerManager.Common"
xmlns:enum="clr-namespace:ServerManagerTool.Enums"
xmlns:ce="clr-namespace:ServerManagerTool.Common.Enums;assembly=ServerManager.Common"
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
xmlns:com="clr-namespace:ServerManagerTool.Common;assembly=ServerManager.Common"
xmlns:vm="clr-namespace:ServerManagerTool.Lib.ViewModel"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
mc:Ignorable="d"
MinWidth="600" MinHeight="500" Width="900" Height="500" Left="50" Top="50" ResizeMode="CanResize"
Loaded="ServerMonitorWindow_Loaded" SizeChanged="ServerMonitorWindow_SizeChanged" StateChanged="ServerMonitorWindow_StateChanged" LocationChanged="ServerMonitorWindow_LocationChanged"
@ -276,7 +275,7 @@
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="100">
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_MapColumnLabel}" />
</DataGridTemplateColumn.Header>
@ -293,6 +292,23 @@
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_PortsColumnLabel}" />
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Label Content="{Binding Profile.PortsString}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_ModsColumnLabel}" />
@ -310,7 +326,7 @@
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="80">
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_VersionColumnLabel}" />
</DataGridTemplateColumn.Header>
@ -327,7 +343,7 @@
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="80">
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_PlayersColumnLabel}" />
</DataGridTemplateColumn.Header>

View file

@ -412,6 +412,7 @@
<sys:String x:Key="ServerMonitor_SelectedColumnLabel">Selected</sys:String>
<sys:String x:Key="ServerMonitor_ProfileColumnLabel">Profile</sys:String>
<sys:String x:Key="ServerMonitor_ServerColumnLabel">Server</sys:String>
<sys:String x:Key="ServerMonitor_PortsColumnLabel">Ports</sys:String>
<sys:String x:Key="ServerMonitor_MapColumnLabel">Map</sys:String>
<sys:String x:Key="ServerMonitor_ModsColumnLabel">Mods</sys:String>
<sys:String x:Key="ServerMonitor_VersionColumnLabel">Version</sys:String>

View file

@ -193,6 +193,7 @@ namespace ServerManagerTool.Lib
{
SetValue(ServerPortProperty, value);
ServerPeerPort = value + 1;
UpdatePortsString();
}
}
@ -201,7 +202,11 @@ namespace ServerManagerTool.Lib
public int ServerPeerPort
{
get { return (int)GetValue(ServerPeerPortProperty); }
set { SetValue(ServerPeerPortProperty, value); }
set
{
SetValue(ServerPeerPortProperty, value);
UpdatePortsString();
}
}
public static readonly DependencyProperty QueryPortProperty = DependencyProperty.Register(nameof(QueryPort), typeof(int), typeof(ServerProfile), new PropertyMetadata(27015));
@ -210,7 +215,18 @@ namespace ServerManagerTool.Lib
public int QueryPort
{
get { return (int)GetValue(QueryPortProperty); }
set { SetValue(QueryPortProperty, value); }
set
{
SetValue(QueryPortProperty, value);
UpdatePortsString();
}
}
public static readonly DependencyProperty PortsStringProperty = DependencyProperty.Register(nameof(PortsString), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
public string PortsString
{
get { return (string)GetValue(PortsStringProperty); }
set { SetValue(PortsStringProperty, value); }
}
public static readonly DependencyProperty ServerMapProperty = DependencyProperty.Register(nameof(ServerMap), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
@ -1201,6 +1217,11 @@ namespace ServerManagerTool.Lib
return true;
}
public void UpdatePortsString()
{
this.PortsString = $"{this.ServerPort}, {this.ServerPeerPort}, {this.QueryPort}";
}
public bool UpdateSchedules()
{
SaveLauncher();
@ -1532,6 +1553,8 @@ namespace ServerManagerTool.Lib
this.ClearValue(ServerPeerPortProperty);
this.ClearValue(QueryPortProperty);
UpdatePortsString();
this.ClearValue(ServerMapProperty);
this.ClearValue(ServerMapSaveFileNameProperty);
this.ClearValue(ServerModIdsProperty);

View file

@ -16,7 +16,7 @@ namespace ServerManagerTool.Lib.ViewModel
if (valueString == null)
return string.Empty;
var name = GlobalizedApplication.Instance.GetResourceString(valueString);
var name = GlobalizedApplication.Instance.GetResourceString($"Map_{valueString}");
if (!string.IsNullOrWhiteSpace(name))
return name;
@ -27,7 +27,7 @@ namespace ServerManagerTool.Lib.ViewModel
var mapName = ModUtils.GetMapName(valueString);
// check if the name is stored in the globalization file
name = GlobalizedApplication.Instance.GetResourceString(mapName);
name = GlobalizedApplication.Instance.GetResourceString($"Map_{mapName}");
if (!string.IsNullOrWhiteSpace(name))
return name;

View file

@ -524,13 +524,13 @@
</Button>
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_ServerPortLabel}" ToolTip="{DynamicResource ServerSettings_ServerPortTooltip}" Foreground="{DynamicResource UnSyncedSetting}"/>
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding ServerPort, Mode=TwoWay, Converter={cc:IntRangeValueConverter 1, 65535}, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" SourceUpdated="ServerPort_SourceUpdated" ToolTip="{DynamicResource ServerSettings_ServerPortTooltip}"/>
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding ServerPort, Mode=TwoWay, Converter={cc:IntRangeValueConverter 1, 65535}, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" SourceUpdated="Ports_SourceUpdated" ToolTip="{DynamicResource ServerSettings_ServerPortTooltip}"/>
<Label Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_ServerPeerPortLabel}" ToolTip="{DynamicResource ServerSettings_ServerPeerPortTooltip}" Foreground="{DynamicResource UnSyncedSetting}"/>
<TextBox Grid.Row="1" Grid.Column="3" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding ServerPeerPort}" ToolTip="{DynamicResource ServerSettings_ServerPeerPortTooltip}" IsEnabled="False"/>
<Label Grid.Row="1" Grid.Column="4" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_QueryPortLabel}" ToolTip="{DynamicResource ServerSettings_QueryPortTooltip}" Foreground="{DynamicResource UnSyncedSetting}"/>
<TextBox Grid.Row="1" Grid.Column="5" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding QueryPort, Converter={cc:IntRangeValueConverter 1, 65535}}" ToolTip="{DynamicResource ServerSettings_QueryPortTooltip}"/>
<TextBox Grid.Row="1" Grid.Column="5" Margin="1" Width="100" VerticalContentAlignment="Center" HorizontalAlignment="Left" Text="{Binding QueryPort, Converter={cc:IntRangeValueConverter 1, 65535}, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" SourceUpdated="Ports_SourceUpdated" ToolTip="{DynamicResource ServerSettings_QueryPortTooltip}"/>
</Grid>
</GroupBox>

View file

@ -1026,10 +1026,11 @@ namespace ServerManagerTool
Settings.ValidateServerName();
}
private void ServerPort_SourceUpdated(object sender, DataTransferEventArgs e)
private void Ports_SourceUpdated(object sender, DataTransferEventArgs e)
{
// force the porperty to be updated.
// force the property to be updated.
Settings.ServerPort = Settings.ServerPort;
Settings.UpdatePortsString();
}
private void MapName_SourceUpdated(object sender, DataTransferEventArgs e)

View file

@ -20,6 +20,7 @@
<br/>
<ul>
<li>Availability Status - Changed the Waiting for Publication status into two new statuses, to clarify the issue.</li>
<li>Server Monitor - Added a Ports column that shows the main server ports.</li>
<li>3rd Party Libraries - updated all library to latest versions.</li>
</ul>
</p>

View file

@ -20,6 +20,7 @@
<br/>
<ul>
<li>Availability Status - Changed the Waiting for Publication status into two new statuses, to clarify the issue.</li>
<li>Server Monitor - Added a Ports column that shows the main server ports.</li>
</ul>
</p>
</div>

View file

@ -4,14 +4,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:sm="clr-namespace:ServerManagerTool"
xmlns:cctl="clr-namespace:ServerManagerTool.Common.Controls;assembly=ServerManager.Common"
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
xmlns:ce="clr-namespace:ServerManagerTool.Common.Enums;assembly=ServerManager.Common"
xmlns:com="clr-namespace:ServerManagerTool.Common;assembly=ServerManager.Common"
xmlns:controls="clr-namespace:ServerManagerTool.Common.Controls;assembly=ServerManager.Common"
xmlns:ce="clr-namespace:ServerManagerTool.Common.Enums;assembly=ServerManager.Common"
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
xmlns:com="clr-namespace:ServerManagerTool.Common;assembly=ServerManager.Common"
xmlns:vm="clr-namespace:ServerManagerTool.Lib.ViewModel"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
mc:Ignorable="d"
MinWidth="600" MinHeight="500" Width="900" Height="500" Left="50" Top="50" ResizeMode="CanResize"
Loaded="ServerMonitorWindow_Loaded" SizeChanged="ServerMonitorWindow_SizeChanged" StateChanged="ServerMonitorWindow_StateChanged" LocationChanged="ServerMonitorWindow_LocationChanged"
@ -275,7 +275,7 @@
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="100">
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_MapColumnLabel}" />
</DataGridTemplateColumn.Header>
@ -292,6 +292,23 @@
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_PortsColumnLabel}" />
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Label Content="{Binding Profile.PortsString}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_ModsColumnLabel}" />
@ -309,7 +326,7 @@
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="80">
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_VersionColumnLabel}" />
</DataGridTemplateColumn.Header>
@ -326,7 +343,7 @@
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto" MinWidth="80">
<DataGridTemplateColumn Width="Auto" MinWidth="50">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource ServerMonitor_PlayersColumnLabel}" />
</DataGridTemplateColumn.Header>