Branch and Event Details moved to new Server Details section, easier to perform profile sync.

This commit is contained in:
Brett Hewitson 2022-03-02 12:58:54 +10:00
parent 5a30f57b0b
commit cc84a85850
26 changed files with 464 additions and 343 deletions

View file

@ -396,22 +396,6 @@ namespace ServerManagerTool.Lib
set { SetValue(CanImportDirectlyFromSameServerProperty, value); }
}
public static readonly DependencyProperty BranchNameProperty = DependencyProperty.Register(nameof(BranchName), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
[DataMember]
public string BranchName
{
get { return (string)GetValue(BranchNameProperty); }
set { SetValue(BranchNameProperty, value); }
}
public static readonly DependencyProperty BranchPasswordProperty = DependencyProperty.Register(nameof(BranchPassword), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
[DataMember]
public string BranchPassword
{
get { return (string)GetValue(BranchPasswordProperty); }
set { SetValue(BranchPasswordProperty, value); }
}
public static readonly DependencyProperty ProcessPriorityProperty = DependencyProperty.Register(nameof(ProcessPriority), typeof(string), typeof(ServerProfile), new PropertyMetadata("normal"));
[DataMember]
public string ProcessPriority
@ -641,6 +625,24 @@ namespace ServerManagerTool.Lib
}
#endregion
#region Server Details
public static readonly DependencyProperty BranchNameProperty = DependencyProperty.Register(nameof(BranchName), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
[DataMember]
public string BranchName
{
get { return (string)GetValue(BranchNameProperty); }
set { SetValue(BranchNameProperty, value); }
}
public static readonly DependencyProperty BranchPasswordProperty = DependencyProperty.Register(nameof(BranchPassword), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
[DataMember]
public string BranchPassword
{
get { return (string)GetValue(BranchPasswordProperty); }
set { SetValue(BranchPasswordProperty, value); }
}
#endregion
#region Server Files
public static readonly DependencyProperty ServerFilesBlacklistedProperty = DependencyProperty.Register(nameof(ServerFilesBlacklisted), typeof(PlayerUserList), typeof(ServerProfile), new PropertyMetadata(null));
[DataMember]
@ -1470,9 +1472,6 @@ namespace ServerManagerTool.Lib
ResetServerOptions();
this.ClearValue(BranchNameProperty);
this.ClearValue(BranchPasswordProperty);
this.ClearValue(ProcessPriorityProperty);
this.ClearValue(ProcessAffinityProperty);
@ -1493,6 +1492,12 @@ namespace ServerManagerTool.Lib
this.ClearValue(AllowDiscordStopProperty);
this.ClearValue(AllowDiscordUpdateProperty);
}
public void ResetServerDetailsSection()
{
this.ClearValue(BranchNameProperty);
this.ClearValue(BranchPasswordProperty);
}
#endregion
#region Sync Methods
@ -1512,6 +1517,9 @@ namespace ServerManagerTool.Lib
case ServerProfileCategory.DiscordBot:
SyncDiscordBot(sourceProfile);
break;
case ServerProfileCategory.ServerDetails:
SyncServerDetails(sourceProfile);
break;
case ServerProfileCategory.ServerFiles:
SyncServerFiles(sourceProfile);
break;
@ -1535,9 +1543,6 @@ namespace ServerManagerTool.Lib
this.SetValue(KickIdlePlayersPercentageProperty, sourceProfile.KickIdlePlayersPercentage);
this.SetValue(KickIdlePlayersPeriodProperty, sourceProfile.KickIdlePlayersPeriod);
this.SetValue(BranchNameProperty, sourceProfile.BranchName);
this.SetValue(BranchPasswordProperty, sourceProfile.BranchPassword);
this.SetValue(LauncherArgsOverrideProperty, sourceProfile.LauncherArgsOverride);
this.SetValue(LauncherArgsProperty, sourceProfile.LauncherArgs);
this.SetValue(AdditionalArgsProperty, sourceProfile.AdditionalArgs);
@ -1574,6 +1579,12 @@ namespace ServerManagerTool.Lib
this.SetValue(AllowDiscordUpdateProperty, sourceProfile.AllowDiscordUpdate);
}
private void SyncServerDetails(ServerProfile sourceProfile)
{
this.SetValue(BranchNameProperty, sourceProfile.BranchName);
this.SetValue(BranchPasswordProperty, sourceProfile.BranchPassword);
}
private void SyncServerFiles(ServerProfile sourceProfile)
{
this.SetValue(ServerFilesBlacklistedProperty, sourceProfile.ServerFilesBlacklisted);