mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
Merge pull request #21 from Bletch1971/ServerMonitorChanges
Server monitor changes
This commit is contained in:
commit
bdd36bf235
25 changed files with 1825 additions and 329 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<Configurations>Debug;Release;Debug - Beta</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net462</TargetFramework>
|
<TargetFramework>net462</TargetFramework>
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,16 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug - ServerMonitor|AnyCPU'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\Debug - ServerMonitor\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="DotNetZip, Version=1.13.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
<Reference Include="DotNetZip, Version=1.13.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DotNetZip.1.13.8\lib\net40\DotNetZip.dll</HintPath>
|
<HintPath>..\packages\DotNetZip.1.13.8\lib\net40\DotNetZip.dll</HintPath>
|
||||||
|
|
@ -356,6 +366,7 @@
|
||||||
<Resource Include="Art\StatusWarning.ico" />
|
<Resource Include="Art\StatusWarning.ico" />
|
||||||
<Resource Include="Art\Collapse.ico" />
|
<Resource Include="Art\Collapse.ico" />
|
||||||
<Resource Include="Art\Expand.ico" />
|
<Resource Include="Art\Expand.ico" />
|
||||||
|
<Resource Include="Art\Restart.ico" />
|
||||||
<Content Include="GameData\Genesis2.gamedata">
|
<Content Include="GameData\Genesis2.gamedata">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
|
||||||
BIN
src/ARKServerManager/Art/Restart.ico
Normal file
BIN
src/ARKServerManager/Art/Restart.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
|
|
@ -440,6 +440,7 @@
|
||||||
<!--#region Server Monitor Window -->
|
<!--#region Server Monitor Window -->
|
||||||
<sys:String x:Key="ServerMonitor_Title">Server Monitor</sys:String>
|
<sys:String x:Key="ServerMonitor_Title">Server Monitor</sys:String>
|
||||||
|
|
||||||
|
<sys:String x:Key="ServerMonitor_SelectedColumnLabel">Selected</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_TotalCountLabel">Total Servers:</sys:String>
|
<sys:String x:Key="ServerMonitor_TotalCountLabel">Total Servers:</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_ServerColumnLabel">Server</sys:String>
|
<sys:String x:Key="ServerMonitor_ServerColumnLabel">Server</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_MapColumnLabel">Map</sys:String>
|
<sys:String x:Key="ServerMonitor_MapColumnLabel">Map</sys:String>
|
||||||
|
|
@ -449,6 +450,16 @@
|
||||||
<sys:String x:Key="ServerMonitor_StatusColumnLabel">Status</sys:String>
|
<sys:String x:Key="ServerMonitor_StatusColumnLabel">Status</sys:String>
|
||||||
|
|
||||||
<sys:String x:Key="ServerMonitor_CreateShortcutButtonTooltip">Create a desktop shortcut to open this form directly.</sys:String>
|
<sys:String x:Key="ServerMonitor_CreateShortcutButtonTooltip">Create a desktop shortcut to open this form directly.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StartServersButtonTooltip">Start the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_ShutdownServersButtonLabel">Shutdown Selected Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_ShutdownServersButtonTooltip">Shutdown the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StopServersButtonLabel">Stop Selected Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StopServersButtonTooltip">Stop the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RestartServersButtonTooltip">Restart the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_UpdateServersButtonTooltip">Update the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_BackupServersButtonTooltip">Backup the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_SelectAllServersButtonTooltip">Select all servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_UnselectAllServersButtonTooltip">Unselect all servers.</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_PlayerListButtonTooltip">Open the Player List window.</sys:String>
|
<sys:String x:Key="ServerMonitor_PlayerListButtonTooltip">Open the Player List window.</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_RCONButtonTooltip">Open the RCON window.</sys:String>
|
<sys:String x:Key="ServerMonitor_RCONButtonTooltip">Open the RCON window.</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_StartServerTooltip">Start the server.</sys:String>
|
<sys:String x:Key="ServerMonitor_StartServerTooltip">Start the server.</sys:String>
|
||||||
|
|
@ -459,7 +470,23 @@
|
||||||
<sys:String x:Key="ServerMonitor_UpgradeServer_FailedTitle">Server Update Error</sys:String>
|
<sys:String x:Key="ServerMonitor_UpgradeServer_FailedTitle">Server Update Error</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_UpgradeServer_FailedLabel">Another server is being upgraded, wait until the upgrade has finished and try again.</sys:String>
|
<sys:String x:Key="ServerMonitor_UpgradeServer_FailedLabel">Another server is being upgraded, wait until the upgrade has finished and try again.</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_CloseWindow_ConfirmTitle">Confirm Window Close</sys:String>
|
<sys:String x:Key="ServerMonitor_CloseWindow_ConfirmTitle">Confirm Window Close</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_CloseWindow_ConfirmLabel">You are currently perform a server update, closing the window with disconnect you from steamcmd. Do you want to continue closing the window?</sys:String>
|
<sys:String x:Key="ServerMonitor_CloseWindow_ConfirmLabel">You are currently performing a server update, closing the window will disconnect you from steamcmd. Do you want to continue closing the window?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_ShutdownServers_ConfirmTitle">Confirm Shutdown Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_ShutdownServers_ConfirmLabel">You are about to shutdown the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StartServers_ConfirmTitle">Confirm Start Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StartServers_ConfirmLabel">You are about to start the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StopServers_ConfirmTitle">Confirm Stop Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StopServers_ConfirmLabel">You are about to stop the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RestartServers_ConfirmTitle">Confirm Restart Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RestartServers_ConfirmLabel">You are about to restart the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_UpdateServers_ConfirmTitle">Confirm Update Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_UpdateServers_ConfirmLabel">You are about to update the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_BackupServers_ConfirmTitle">Confirm Backup Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_BackupServers_ConfirmLabel">You are about to backup the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_NoServersSelected_ErrorTitle">Selected Servers Error</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_NoServersSelected_ErrorLabel">You have not selected any servers. Selected one or more servers in the list and try again.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RunningProcesses_ConfirmTitle">Close Server Monitor Error</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RunningProcesses_ConfirmLabel">The server monitor window cannot be closed at this time. One or more of the servers is currently starting, shutting down or restarting.</sys:String>
|
||||||
<!--#endregion-->
|
<!--#endregion-->
|
||||||
|
|
||||||
<!--#region Shutdown Window -->
|
<!--#region Shutdown Window -->
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ namespace ServerManagerTool.Lib
|
||||||
public bool DeleteOldBackupFiles = Config.Default.AutoBackup_DeleteOldFiles;
|
public bool DeleteOldBackupFiles = Config.Default.AutoBackup_DeleteOldFiles;
|
||||||
public int ExitCode = EXITCODE_NORMALEXIT;
|
public int ExitCode = EXITCODE_NORMALEXIT;
|
||||||
public bool OutputLogs = false;
|
public bool OutputLogs = false;
|
||||||
|
public bool PerformWorldSave = Config.Default.ServerShutdown_EnableWorldSave;
|
||||||
public bool SendAlerts = false;
|
public bool SendAlerts = false;
|
||||||
public bool SendEmails = false;
|
public bool SendEmails = false;
|
||||||
public string ShutdownReason = null;
|
public string ShutdownReason = null;
|
||||||
|
|
@ -257,11 +258,14 @@ namespace ServerManagerTool.Lib
|
||||||
|
|
||||||
ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped);
|
ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped);
|
||||||
|
|
||||||
// make a backup of the current profile and config files.
|
if (ServerProcess != ServerProcessType.Stop)
|
||||||
CreateProfileBackupArchiveFile(_profile);
|
{
|
||||||
|
// make a backup of the current profile and config files.
|
||||||
|
CreateProfileBackupArchiveFile(_profile);
|
||||||
|
|
||||||
if (ExitCode != EXITCODE_NORMALEXIT)
|
if (ExitCode != EXITCODE_NORMALEXIT)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (BackupWorldFile)
|
if (BackupWorldFile)
|
||||||
{
|
{
|
||||||
|
|
@ -284,10 +288,10 @@ namespace ServerManagerTool.Lib
|
||||||
{
|
{
|
||||||
ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped);
|
ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (ExitCode != EXITCODE_NORMALEXIT)
|
if (ExitCode != EXITCODE_NORMALEXIT)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// check if this is a shutdown only, or a shutdown and restart.
|
// check if this is a shutdown only, or a shutdown and restart.
|
||||||
if (restartServer)
|
if (restartServer)
|
||||||
|
|
@ -579,7 +583,7 @@ namespace ServerManagerTool.Lib
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if we need to perform a world save (not required for SotF servers)
|
// check if we need to perform a world save (not required for SotF servers)
|
||||||
if (serverAccessible && Config.Default.ServerShutdown_EnableWorldSave && !_profile.SotFEnabled)
|
if (serverAccessible && PerformWorldSave && !_profile.SotFEnabled)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -670,35 +674,38 @@ namespace ServerManagerTool.Lib
|
||||||
process.Exited += handler;
|
process.Exited += handler;
|
||||||
|
|
||||||
// Method 1 - Shutdown Command
|
// Method 1 - Shutdown Command
|
||||||
if (serverAccessible && _profile.RCONEnabled && Config.Default.ServerShutdown_UseShutdownCommand)
|
if (ServerProcess != ServerProcessType.Stop)
|
||||||
{
|
{
|
||||||
try
|
if (serverAccessible && _profile.RCONEnabled && Config.Default.ServerShutdown_UseShutdownCommand)
|
||||||
{
|
{
|
||||||
sent = SendCommand(Config.Default.ServerShutdownCommand, cancellationToken);
|
try
|
||||||
if (sent)
|
|
||||||
{
|
{
|
||||||
Task.Delay(10000, cancellationToken).Wait(cancellationToken);
|
sent = SendCommand(Config.Default.ServerShutdownCommand, cancellationToken);
|
||||||
|
if (sent)
|
||||||
|
{
|
||||||
|
Task.Delay(10000, cancellationToken).Wait(cancellationToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine($"RCON> {Config.Default.ServerShutdownCommand} command.\r\n{ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Debug.WriteLine($"RCON> {Config.Default.ServerShutdownCommand} command.\r\n{ex.Message}");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sent && !process.HasExited)
|
if (sent && !process.HasExited)
|
||||||
{
|
{
|
||||||
ts.Task.Wait(60000); // 1 minute
|
ts.Task.Wait(60000); // 1 minute
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.HasExited)
|
if (process.HasExited)
|
||||||
{
|
{
|
||||||
LogProfileMessage($"Exited server successfully.");
|
LogProfileMessage($"Exited server successfully.");
|
||||||
LogProfileMessage("");
|
LogProfileMessage("");
|
||||||
ExitCode = EXITCODE_NORMALEXIT;
|
ExitCode = EXITCODE_NORMALEXIT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogProfileMessage("Exiting server timed out, attempting to close the server.");
|
LogProfileMessage("Exiting server timed out, attempting to close the server.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method 2 - Close the process
|
// Method 2 - Close the process
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,11 @@ namespace ServerManagerTool.Utils
|
||||||
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
||||||
case CommandType.Shutdown:
|
case CommandType.Shutdown:
|
||||||
if (Config.Default.AllowDiscordShutdown)
|
if (Config.Default.AllowDiscordShutdown)
|
||||||
return ShutdownServer(channelId, profileIdOrAlias, token);
|
return StopServer(channelId, profileIdOrAlias, true, token);
|
||||||
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
||||||
case CommandType.Stop:
|
case CommandType.Stop:
|
||||||
if (Config.Default.AllowDiscordStop)
|
if (Config.Default.AllowDiscordStop)
|
||||||
return StopServer(channelId, profileIdOrAlias, token);
|
return StopServer(channelId, profileIdOrAlias, false, token);
|
||||||
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
||||||
case CommandType.Start:
|
case CommandType.Start:
|
||||||
if (Config.Default.AllowDiscordStart)
|
if (Config.Default.AllowDiscordStart)
|
||||||
|
|
@ -475,112 +475,7 @@ namespace ServerManagerTool.Utils
|
||||||
return responseList;
|
return responseList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IList<string> ShutdownServer(string channelId, string profileIdOrAlias, CancellationToken token)
|
private static IList<string> StopServer(string channelId, string profileIdOrAlias, bool shutdown, CancellationToken token)
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(profileIdOrAlias))
|
|
||||||
{
|
|
||||||
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_ProfileMissing"), CommandType.Shutdown) };
|
|
||||||
}
|
|
||||||
|
|
||||||
var profileList = new List<ServerProfileSnapshot>();
|
|
||||||
var responseList = new List<string>();
|
|
||||||
|
|
||||||
TaskUtils.RunOnUIThreadAsync(() =>
|
|
||||||
{
|
|
||||||
var serverList = ServerManager.Instance.Servers.Where(s =>
|
|
||||||
string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase)
|
|
||||||
&& (
|
|
||||||
string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase)
|
|
||||||
|| !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase)
|
|
||||||
|| !string.IsNullOrWhiteSpace(Config.Default.DiscordBotAllServersKeyword) && string.Equals(profileIdOrAlias, Config.Default.DiscordBotAllServersKeyword, StringComparison.OrdinalIgnoreCase)
|
|
||||||
|| s.Profile.AllowDiscordClusterAlias && string.Equals(profileIdOrAlias, s.Profile.CrossArkClusterId, StringComparison.OrdinalIgnoreCase)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (serverList.IsEmpty())
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrWhiteSpace(Config.Default.DiscordBotAllServersKeyword) && string.Equals(profileIdOrAlias, Config.Default.DiscordBotAllServersKeyword, StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
responseList.Add(_globalizer.GetResourceString("DiscordBot_NoChannelProfiles"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileNotFound"), profileIdOrAlias));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var server in serverList)
|
|
||||||
{
|
|
||||||
if (!server.Profile.AllowDiscordShutdown)
|
|
||||||
{
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_CommandDisabledProfile"), CommandType.Shutdown, server.Profile.ProfileName));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if another command is being run against the profile
|
|
||||||
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
|
||||||
{
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (server.Runtime.Status)
|
|
||||||
{
|
|
||||||
case ServerStatus.Initializing:
|
|
||||||
case ServerStatus.Stopping:
|
|
||||||
case ServerStatus.Stopped:
|
|
||||||
case ServerStatus.Uninstalled:
|
|
||||||
case ServerStatus.Unknown:
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
|
||||||
continue;
|
|
||||||
|
|
||||||
case ServerStatus.Updating:
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Shutdown);
|
|
||||||
profileList.Add(ServerProfileSnapshot.Create(server.Profile));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).Wait(token);
|
|
||||||
|
|
||||||
foreach (var profile in profileList)
|
|
||||||
{
|
|
||||||
var app = new ServerApp(true)
|
|
||||||
{
|
|
||||||
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
|
||||||
OutputLogs = false,
|
|
||||||
SendAlerts = true,
|
|
||||||
SendEmails = false,
|
|
||||||
ServerProcess = ServerProcessType.Shutdown,
|
|
||||||
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
|
||||||
{
|
|
||||||
TaskUtils.RunOnUIThreadAsync(() =>
|
|
||||||
{
|
|
||||||
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
|
||||||
if (server != null)
|
|
||||||
{
|
|
||||||
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
|
||||||
}
|
|
||||||
}).Wait(token);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
app.PerformProfileShutdown(profile, false, false, false, false, token);
|
|
||||||
_currentProfileCommands.Remove(profile.ProfileId);
|
|
||||||
}, token);
|
|
||||||
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ShutdownRequested"), profile.ServerName));
|
|
||||||
}
|
|
||||||
|
|
||||||
return responseList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IList<string> StopServer(string channelId, string profileIdOrAlias, CancellationToken token)
|
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(profileIdOrAlias))
|
if (string.IsNullOrWhiteSpace(profileIdOrAlias))
|
||||||
{
|
{
|
||||||
|
|
@ -655,12 +550,13 @@ namespace ServerManagerTool.Utils
|
||||||
{
|
{
|
||||||
var app = new ServerApp(true)
|
var app = new ServerApp(true)
|
||||||
{
|
{
|
||||||
|
BackupWorldFile = shutdown,
|
||||||
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
OutputLogs = false,
|
OutputLogs = false,
|
||||||
|
PerformWorldSave = shutdown,
|
||||||
SendAlerts = true,
|
SendAlerts = true,
|
||||||
SendEmails = false,
|
SendEmails = false,
|
||||||
ServerProcess = ServerProcessType.Stop,
|
ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop,
|
||||||
ShutdownInterval = 0,
|
|
||||||
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
{
|
{
|
||||||
TaskUtils.RunOnUIThreadAsync(() =>
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
|
@ -674,13 +570,19 @@ namespace ServerManagerTool.Utils
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!shutdown)
|
||||||
|
app.ShutdownInterval = 0;
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
app.PerformProfileShutdown(profile, false, false, false, false, token);
|
app.PerformProfileShutdown(profile, false, false, false, false, token);
|
||||||
_currentProfileCommands.Remove(profile.ProfileId);
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
}, token);
|
}, token);
|
||||||
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_StopRequested"), profile.ServerName));
|
if (shutdown)
|
||||||
|
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ShutdownRequested"), profile.ServerName));
|
||||||
|
else
|
||||||
|
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_StopRequested"), profile.ServerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
return responseList;
|
return responseList;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,11 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
|
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||||
|
xmlns:sm="clr-namespace:ServerManagerTool"
|
||||||
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
|
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
|
||||||
xmlns:com="clr-namespace:ServerManagerTool.Common;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:enum="clr-namespace:ServerManagerTool.Enums"
|
||||||
xmlns:vm="clr-namespace:ServerManagerTool.Lib.ViewModel"
|
xmlns:vm="clr-namespace:ServerManagerTool.Lib.ViewModel"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
@ -18,21 +21,38 @@
|
||||||
<ResourceDictionary Source="..\Globalization\en-US\en-US.xaml"/>
|
<ResourceDictionary Source="..\Globalization\en-US\en-US.xaml"/>
|
||||||
<ResourceDictionary Source="..\Styles\Default.xaml"/>
|
<ResourceDictionary Source="..\Styles\Default.xaml"/>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
|
<sm:ScrollToBottomAction x:Key="ScrollToBottomAction" />
|
||||||
<vm:MapNameValueConverter x:Key="MapNameValueConverter"/>
|
<vm:MapNameValueConverter x:Key="MapNameValueConverter"/>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="StopButtonContent">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Stop.ico,Size=32}" Width="16" VerticalAlignment="Center"/>
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/DropArrow.ico,Size=32}" Width="8" Margin="2,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Grid Background="{StaticResource BeigeGradient}" MouseLeftButtonUp="OnMouseLeftButtonUp" MouseMove="OnMouseMove">
|
<Grid Background="{StaticResource BeigeGradient}" MouseLeftButtonUp="OnMouseLeftButtonUp" MouseMove="OnMouseMove">
|
||||||
<DockPanel x:Name="dockPanel">
|
<DockPanel x:Name="dockPanel">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="10*"/>
|
<RowDefinition Height="*" MinHeight="200"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto" MinHeight="100"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="200*"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
@ -41,12 +61,55 @@
|
||||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Shortcut.ico,Size=32}"/>
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Shortcut.ico,Size=32}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
|
<Button Grid.Row="0" Grid.Column="1" Width="22" Height="22" Margin="10,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="SelectAllServers_Click" ToolTip="{DynamicResource ServerMonitor_SelectAllServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Checked.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="2" Width="22" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="UnselectAllServers_Click" ToolTip="{DynamicResource ServerMonitor_UnselectAllServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Unchecked.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="3" Width="22" Height="22" Margin="10,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding StartServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_StartServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Start.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="4" Width="22" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding RestartServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_RestartServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Restart.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<controls:DropDownButton Grid.Row="0" Grid.Column="5" Width="35" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Center">
|
||||||
|
<ContentControl ContentTemplate="{StaticResource StopButtonContent}" />
|
||||||
|
|
||||||
|
<controls:DropDownButton.Menu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Header="{DynamicResource ServerMonitor_ShutdownServersButtonLabel}" Command="{Binding ShutdownServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_ShutdownServersButtonTooltip}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Stop.ico,Size=32}"/>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Header="{DynamicResource ServerMonitor_StopServersButtonLabel}" Command="{Binding StopServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_StopServersButtonTooltip}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Stop.ico,Size=32}"/>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
</ContextMenu>
|
||||||
|
</controls:DropDownButton.Menu>
|
||||||
|
</controls:DropDownButton>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="6" Width="22" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" Command="{Binding UpdateServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_UpdateServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Download.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="7" Width="22" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding BackupServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_BackupServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Save.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="0" Grid.Column="8" Orientation="Horizontal">
|
||||||
<TextBlock Margin="30,5,5,0" Text="{DynamicResource ServerMonitor_TotalCountLabel}" VerticalAlignment="Center" />
|
<TextBlock Margin="30,5,5,0" Text="{DynamicResource ServerMonitor_TotalCountLabel}" VerticalAlignment="Center" />
|
||||||
<TextBlock Margin="5,5,5,0" Text="{Binding ServerManager.Servers.Count}" VerticalAlignment="Center" />
|
<TextBlock Margin="5,5,5,0" Text="{Binding ServerManager.Servers.Count}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Button Grid.Row="0" Grid.Column="2" Height="22" Margin="5,5,5,0" Background="#00AA00" Foreground="White" Padding="1" BorderThickness="1" BorderBrush="White" ContentStringFormat="{DynamicResource MainWindow_UpdateToLabelFormat}" Content="{Binding LatestServerManagerVersion}" Click="UpgradeApplication_Click" VerticalAlignment="Center" >
|
<Button Grid.Row="0" Grid.Column="9" Height="22" Margin="5,5,5,0" Background="#00AA00" Foreground="White" Padding="1" BorderThickness="1" BorderBrush="White" ContentStringFormat="{DynamicResource MainWindow_UpdateToLabelFormat}" Content="{Binding LatestServerManagerVersion}" Click="UpgradeApplication_Click" VerticalAlignment="Center" >
|
||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style TargetType="{x:Type Button}">
|
<Style TargetType="{x:Type Button}">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
|
|
@ -61,7 +124,7 @@
|
||||||
</Button.Style>
|
</Button.Style>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Grid.Row="0" Grid.Column="3" Width="22" Height="22" Margin="5,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="PatchNotes_Click" ToolTip="{DynamicResource ServerSettings_PatchNotesTooltip}">
|
<Button Grid.Row="0" Grid.Column="10" Width="22" Height="22" Margin="5,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="PatchNotes_Click" ToolTip="{DynamicResource ServerSettings_PatchNotesTooltip}">
|
||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style TargetType="{x:Type Button}">
|
<Style TargetType="{x:Type Button}">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
|
|
@ -74,11 +137,11 @@
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</Button.Style>
|
</Button.Style>
|
||||||
|
|
||||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/ChangeNotes.ico,Size=32}"/>
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/ChangeNotes.ico,Size=32}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="5" Name="ServersGrid" ItemsSource="{Binding ServerManager.Servers}" GridLinesVisibility="Horizontal" HeadersVisibility="All" AutoGenerateColumns="False" CanUserAddRows="False" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" RowHeaderWidth="25" SelectionMode="Single" PreviewMouseLeftButtonDown="OnMouseLeftButtonDown">
|
<DataGrid Name="ServersGrid" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="11" Margin="5,5,5,0" HorizontalAlignment="Stretch" ItemsSource="{Binding ServerManager.Servers}" GridLinesVisibility="Horizontal" HeadersVisibility="All" AutoGenerateColumns="False" CanUserAddRows="False" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" RowHeaderWidth="25" SelectionMode="Single" PreviewMouseLeftButtonDown="OnMouseLeftButtonDown">
|
||||||
<DataGrid.Resources>
|
<DataGrid.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<Style TargetType="{x:Type DataGridCell}">
|
<Style TargetType="{x:Type DataGridCell}">
|
||||||
|
|
@ -140,6 +203,14 @@
|
||||||
|
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
|
|
||||||
|
<DataGridTemplateColumn Width="Auto" Header="{DynamicResource ServerMonitor_SelectedColumnLabel}">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
<DataGridTemplateColumn Width="*">
|
<DataGridTemplateColumn Width="*">
|
||||||
<DataGridTemplateColumn.Header>
|
<DataGridTemplateColumn.Header>
|
||||||
<TextBlock Text="{DynamicResource ServerMonitor_ServerColumnLabel}" />
|
<TextBlock Text="{DynamicResource ServerMonitor_ServerColumnLabel}" />
|
||||||
|
|
@ -530,11 +601,27 @@
|
||||||
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
||||||
|
<GridSplitter Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="11" Height="5" ShowsPreview="True" HorizontalAlignment="Stretch" VerticalAlignment="Center" Opacity="0"/>
|
||||||
|
|
||||||
|
<RichTextBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="11" Margin="5,0,5,5" BorderBrush="LightGray" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" IsReadOnlyCaretVisible="True" IsReadOnly="True" IsTabStop="False">
|
||||||
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="TextChanged" >
|
||||||
|
<sm:ScrollToBottomAction IsEnabled="True"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
|
<RichTextBox.Resources>
|
||||||
|
<Style TargetType="{x:Type Paragraph}">
|
||||||
|
<Setter Property="Margin" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
</RichTextBox.Resources>
|
||||||
|
<FlowDocument Name="ConsoleContent"/>
|
||||||
|
</RichTextBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
<!-- Drag and Drop Popup -->
|
<!-- Drag and Drop Popup -->
|
||||||
<Popup Grid.Row="0" Grid.Column="0" x:Name="popup" IsHitTestVisible="False" Placement="RelativePoint" PlacementTarget="{Binding ElementName=ServerMonitorUI}" AllowsTransparency="True">
|
<Popup x:Name="popup" IsHitTestVisible="False" Placement="RelativePoint" PlacementTarget="{Binding ElementName=ServerMonitorUI}" AllowsTransparency="True" Grid.ColumnSpan="2">
|
||||||
<Border BorderBrush="LightSteelBlue" BorderThickness="2" Background="White" Opacity="0.75">
|
<Border BorderBrush="LightSteelBlue" BorderThickness="2" Background="White" Opacity="0.75">
|
||||||
<StackPanel Orientation="Horizontal" Margin="4,3,8,3">
|
<StackPanel Orientation="Horizontal" Margin="4,3,8,3">
|
||||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Drag.ico,Size=32}" Width="16" Height="16"/>
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Drag.ico,Size=32}" Width="16" Height="16"/>
|
||||||
|
|
@ -544,7 +631,7 @@
|
||||||
</Popup>
|
</Popup>
|
||||||
|
|
||||||
<!-- It's important that this is in the end of the XAML as it needs to be on top of everything else! -->
|
<!-- It's important that this is in the end of the XAML as it needs to be on top of everything else! -->
|
||||||
<Grid x:Name="OverlayGrid" Visibility="Collapsed" DockPanel.Dock="Top" >
|
<Grid x:Name="OverlayGrid" Visibility="Collapsed" DockPanel.Dock="Top">
|
||||||
<Grid Background="Black" Opacity="0.5"/>
|
<Grid Background="Black" Opacity="0.5"/>
|
||||||
<Border MinWidth="250" Background="Orange" BorderBrush="Black" BorderThickness="1" CornerRadius="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
<Border MinWidth="250" Background="Orange" BorderBrush="Black" BorderThickness="1" CornerRadius="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|
@ -557,7 +644,7 @@
|
||||||
Visibility="{Binding IsStandAloneWindow, Converter={StaticResource BooleanToVisibilityConverter}}"
|
Visibility="{Binding IsStandAloneWindow, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||||
ToolTipText="{Binding Title}"
|
ToolTipText="{Binding Title}"
|
||||||
IconSource="../Art/favicon.ico"
|
IconSource="../Art/favicon.ico"
|
||||||
LeftClickCommand="{Binding ShowWindowCommand, ElementName=ServerMonitorUI}">
|
LeftClickCommand="{Binding ShowWindowCommand, ElementName=ServerMonitorUI}" Grid.ColumnSpan="2">
|
||||||
|
|
||||||
<tb:TaskbarIcon.Resources>
|
<tb:TaskbarIcon.Resources>
|
||||||
<clib:BindingProxy x:Key="proxy" Data="{Binding ElementName=ServerMonitorUI}"/>
|
<clib:BindingProxy x:Key="proxy" Data="{Binding ElementName=ServerMonitorUI}"/>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using NLog;
|
using NLog;
|
||||||
using ServerManagerTool.Common.Lib;
|
using ServerManagerTool.Common.Lib;
|
||||||
using ServerManagerTool.Common.Utils;
|
using ServerManagerTool.Common.Utils;
|
||||||
|
using ServerManagerTool.DiscordBot.Enums;
|
||||||
using ServerManagerTool.Enums;
|
using ServerManagerTool.Enums;
|
||||||
using ServerManagerTool.Lib;
|
using ServerManagerTool.Lib;
|
||||||
using ServerManagerTool.Plugin.Common;
|
using ServerManagerTool.Plugin.Common;
|
||||||
|
|
@ -16,7 +17,9 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
using WPFSharp.Globalizer;
|
using WPFSharp.Globalizer;
|
||||||
|
|
||||||
namespace ServerManagerTool.Windows
|
namespace ServerManagerTool.Windows
|
||||||
|
|
@ -26,17 +29,40 @@ namespace ServerManagerTool.Windows
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ServerMonitorWindow : Window
|
public partial class ServerMonitorWindow : Window
|
||||||
{
|
{
|
||||||
|
public class ServerMonitorOutput_Error : Run
|
||||||
|
{
|
||||||
|
public ServerMonitorOutput_Error(string value)
|
||||||
|
: base(value)
|
||||||
|
{
|
||||||
|
Foreground = Brushes.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ServerMonitorOutput_Success : Run
|
||||||
|
{
|
||||||
|
public ServerMonitorOutput_Success(string value)
|
||||||
|
: base(value)
|
||||||
|
{
|
||||||
|
Foreground = Brushes.Green;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
private static readonly List<ServerMonitorWindow> Windows = new List<ServerMonitorWindow>();
|
private static readonly List<ServerMonitorWindow> Windows = new List<ServerMonitorWindow>();
|
||||||
|
|
||||||
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
|
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
|
||||||
private CancellationTokenSource _upgradeCancellationSource = null;
|
private CancellationTokenSource _upgradeCancellationSource = null;
|
||||||
private ActionQueue _versionChecker;
|
private ActionQueue _versionChecker;
|
||||||
|
private ActionQueue _canExecuteChecker;
|
||||||
|
private readonly Dictionary<string, CommandType> _currentProfileCommands = new Dictionary<string, CommandType>();
|
||||||
|
|
||||||
|
private bool HasRunningCommands => _currentProfileCommands.Count > 0;
|
||||||
|
|
||||||
public static readonly DependencyProperty ServerManagerProperty = DependencyProperty.Register(nameof(ServerManager), typeof(ServerManager), typeof(ServerMonitorWindow), new PropertyMetadata(null));
|
public static readonly DependencyProperty ServerManagerProperty = DependencyProperty.Register(nameof(ServerManager), typeof(ServerManager), typeof(ServerMonitorWindow), new PropertyMetadata(null));
|
||||||
public static readonly DependencyProperty LatestServerManagerVersionProperty = DependencyProperty.Register(nameof(LatestServerManagerVersion), typeof(Version), typeof(ServerMonitorWindow), new PropertyMetadata(new Version()));
|
public static readonly DependencyProperty LatestServerManagerVersionProperty = DependencyProperty.Register(nameof(LatestServerManagerVersion), typeof(Version), typeof(ServerMonitorWindow), new PropertyMetadata(new Version()));
|
||||||
public static readonly DependencyProperty ShowUpdateButtonProperty = DependencyProperty.Register(nameof(ShowUpdateButton), typeof(bool), typeof(ServerMonitorWindow), new PropertyMetadata(false));
|
public static readonly DependencyProperty ShowUpdateButtonProperty = DependencyProperty.Register(nameof(ShowUpdateButton), typeof(bool), typeof(ServerMonitorWindow), new PropertyMetadata(false));
|
||||||
public static readonly DependencyProperty IsStandAloneWindowProperty = DependencyProperty.Register(nameof(IsStandAloneWindow), typeof(bool), typeof(ServerMonitorWindow), new PropertyMetadata(false));
|
public static readonly DependencyProperty IsStandAloneWindowProperty = DependencyProperty.Register(nameof(IsStandAloneWindow), typeof(bool), typeof(ServerMonitorWindow), new PropertyMetadata(false));
|
||||||
|
public static readonly DependencyProperty CancellationTokenSourceProperty = DependencyProperty.Register(nameof(CancellationTokenSource), typeof(CancellationTokenSource), typeof(ServerMonitorWindow));
|
||||||
|
|
||||||
public ServerMonitorWindow() : this(null)
|
public ServerMonitorWindow() : this(null)
|
||||||
{
|
{
|
||||||
|
|
@ -89,6 +115,12 @@ namespace ServerManagerTool.Windows
|
||||||
set { SetValue(IsStandAloneWindowProperty, value); }
|
set { SetValue(IsStandAloneWindowProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CancellationTokenSource CancellationTokenSource
|
||||||
|
{
|
||||||
|
get { return (CancellationTokenSource)GetValue(CancellationTokenSourceProperty); }
|
||||||
|
set { SetValue(CancellationTokenSourceProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
private void ServerMonitorWindow_Loaded(object sender, RoutedEventArgs e)
|
private void ServerMonitorWindow_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (ServerManager == null)
|
if (ServerManager == null)
|
||||||
|
|
@ -121,6 +153,9 @@ namespace ServerManagerTool.Windows
|
||||||
_versionChecker = new ActionQueue();
|
_versionChecker = new ActionQueue();
|
||||||
_versionChecker.PostAction(CheckForUpdates).DoNotWait();
|
_versionChecker.PostAction(CheckForUpdates).DoNotWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_canExecuteChecker = new ActionQueue();
|
||||||
|
_canExecuteChecker.PostAction(RaiseCanExecuteChanged).DoNotWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ServerMonitorWindow_LocationChanged(object sender, EventArgs e)
|
private void ServerMonitorWindow_LocationChanged(object sender, EventArgs e)
|
||||||
|
|
@ -156,6 +191,14 @@ namespace ServerManagerTool.Windows
|
||||||
|
|
||||||
protected override void OnClosing(CancelEventArgs e)
|
protected override void OnClosing(CancelEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (HasRunningCommands)
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_RunningProcesses_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_RunningProcesses_ConfirmTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
|
||||||
|
e.Cancel = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.OwnedWindows.OfType<ProgressWindow>().Any())
|
if (this.OwnedWindows.OfType<ProgressWindow>().Any())
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_CloseWindow_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_CloseWindow_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes)
|
if (MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_CloseWindow_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_CloseWindow_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes)
|
||||||
|
|
@ -166,7 +209,9 @@ namespace ServerManagerTool.Windows
|
||||||
}
|
}
|
||||||
|
|
||||||
Windows.Remove(this);
|
Windows.Remove(this);
|
||||||
|
|
||||||
_versionChecker?.DisposeAsync().DoNotWait();
|
_versionChecker?.DisposeAsync().DoNotWait();
|
||||||
|
_canExecuteChecker?.DisposeAsync().DoNotWait();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
@ -409,6 +454,29 @@ namespace ServerManagerTool.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddErrorBlockContent(string message)
|
||||||
|
{
|
||||||
|
var p = new Paragraph();
|
||||||
|
|
||||||
|
p.Inlines.Add(new ServerMonitorOutput_Error(message));
|
||||||
|
|
||||||
|
ConsoleContent.Blocks.Add(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddMessageBlockContent(string message)
|
||||||
|
{
|
||||||
|
var p = new Paragraph();
|
||||||
|
|
||||||
|
p.Inlines.Add(new ServerMonitorOutput_Success(message));
|
||||||
|
|
||||||
|
ConsoleContent.Blocks.Add(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearBlockContents()
|
||||||
|
{
|
||||||
|
ConsoleContent.Blocks.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
private async Task CheckForUpdates()
|
private async Task CheckForUpdates()
|
||||||
{
|
{
|
||||||
string url = App.Instance.BetaVersion ? Config.Default.LatestASMBetaVersionUrl : Config.Default.LatestASMVersionUrl;
|
string url = App.Instance.BetaVersion ? Config.Default.LatestASMBetaVersionUrl : Config.Default.LatestASMVersionUrl;
|
||||||
|
|
@ -455,6 +523,14 @@ namespace ServerManagerTool.Windows
|
||||||
return new ServerMonitorWindow(serverManager);
|
return new ServerMonitorWindow(serverManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task RaiseCanExecuteChanged()
|
||||||
|
{
|
||||||
|
await TaskUtils.RunOnUIThreadAsync(() => CommandManager.InvalidateRequerySuggested());
|
||||||
|
await Task.Delay(5000);
|
||||||
|
|
||||||
|
_canExecuteChecker?.PostAction(RaiseCanExecuteChanged).DoNotWait();
|
||||||
|
}
|
||||||
|
|
||||||
private void SetWindowTitle()
|
private void SetWindowTitle()
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(App.Instance.Title))
|
if (!string.IsNullOrWhiteSpace(App.Instance.Title))
|
||||||
|
|
@ -702,6 +778,114 @@ namespace ServerManagerTool.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICommand BackupServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await BackupSelectedServersAsync();
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand RestartServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await RestartSelectedServersAsync();
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand ShutdownServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await StopSelectedServersAsync(true);
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand StartServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await StartSelectedServersAsync();
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand StopServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await StopSelectedServersAsync(false);
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand UpdateServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await UpdateSelectedServersAsync();
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Drag and Drop
|
#region Drag and Drop
|
||||||
|
|
||||||
public static readonly DependencyProperty DraggedItemProperty = DependencyProperty.Register(nameof(DraggedItem), typeof(Server), typeof(ServerMonitorWindow), new PropertyMetadata(null));
|
public static readonly DependencyProperty DraggedItemProperty = DependencyProperty.Register(nameof(DraggedItem), typeof(Server), typeof(ServerMonitorWindow), new PropertyMetadata(null));
|
||||||
|
|
@ -816,5 +1000,521 @@ namespace ServerManagerTool.Windows
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
private void SelectAllServers_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (var server in ServerManager.Servers)
|
||||||
|
{
|
||||||
|
server.Selected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UnselectAllServers_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (var server in ServerManager.Servers)
|
||||||
|
{
|
||||||
|
server.Selected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task BackupSelectedServersAsync()
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_BackupServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_BackupServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Uninstalled:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Backup);
|
||||||
|
profileList.Add(ServerProfileSnapshot.Create(server.Profile));
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = ServerProcessType.Backup,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileBackup(profile, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_BackupRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task RestartSelectedServersAsync()
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_RestartServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_RestartServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Uninstalled:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Restart);
|
||||||
|
var profile = ServerProfileSnapshot.Create(server.Profile);
|
||||||
|
profile.AutoRestartIfShutdown = true;
|
||||||
|
profileList.Add(profile);
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = ServerProcessType.Restart,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileShutdown(profile, true, false, false, false, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_RestartRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task StartSelectedServersAsync()
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_StartServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_StartServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Running:
|
||||||
|
case ServerStatus.Uninstalled:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Start);
|
||||||
|
var profile = ServerProfileSnapshot.Create(server.Profile);
|
||||||
|
profile.AutoRestartIfShutdown = true;
|
||||||
|
profileList.Add(profile);
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = ServerProcessType.Restart,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileShutdown(profile, true, false, false, false, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_StartRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task StopSelectedServersAsync(bool shutdown)
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = shutdown
|
||||||
|
? MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_ShutdownServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_ShutdownServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question)
|
||||||
|
: MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_StopServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_StopServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Stopped:
|
||||||
|
case ServerStatus.Uninstalled:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Stop);
|
||||||
|
profileList.Add(ServerProfileSnapshot.Create(server.Profile));
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
BackupWorldFile = shutdown,
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
PerformWorldSave = shutdown,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!shutdown)
|
||||||
|
app.ShutdownInterval = 0;
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileShutdown(profile, false, false, false, false, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
if (shutdown)
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ShutdownRequested"), profile.ServerName));
|
||||||
|
else
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_StopRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UpdateSelectedServersAsync()
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_UpdateServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_UpdateServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
var performRestart = false;
|
||||||
|
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Running:
|
||||||
|
performRestart = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update);
|
||||||
|
var profile = ServerProfileSnapshot.Create(server.Profile);
|
||||||
|
profile.RestartAfterShutdown1 = performRestart; // use this property to trigger a restart
|
||||||
|
profileList.Add(profile);
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = ServerProcessType.Update,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileShutdown(profile, profile.RestartAfterShutdown1, true, false, false, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_UpdateRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<Configurations>Debug;Release;Debug - Beta</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net462</TargetFramework>
|
<TargetFramework>net462</TargetFramework>
|
||||||
|
|
|
||||||
BIN
src/ConanServerManager/Art/Restart.ico
Normal file
BIN
src/ConanServerManager/Art/Restart.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
|
|
@ -123,6 +123,16 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignManifests>false</SignManifests>
|
<SignManifests>false</SignManifests>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug - ServerMonitor|AnyCPU'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\Debug - ServerMonitor\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="DotNetZip, Version=1.13.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
<Reference Include="DotNetZip, Version=1.13.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DotNetZip.1.13.8\lib\net40\DotNetZip.dll</HintPath>
|
<HintPath>..\packages\DotNetZip.1.13.8\lib\net40\DotNetZip.dll</HintPath>
|
||||||
|
|
@ -287,6 +297,7 @@
|
||||||
</Content>
|
</Content>
|
||||||
<Resource Include="Art\Filter.ico" />
|
<Resource Include="Art\Filter.ico" />
|
||||||
<Resource Include="Art\DropArrow.ico" />
|
<Resource Include="Art\DropArrow.ico" />
|
||||||
|
<Resource Include="Art\Restart.ico" />
|
||||||
<Content Include="Globalization\en-US\en-US.xaml">
|
<Content Include="Globalization\en-US\en-US.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
|
|
||||||
|
|
@ -400,6 +400,7 @@
|
||||||
<!--#region Server Monitor Window -->
|
<!--#region Server Monitor Window -->
|
||||||
<sys:String x:Key="ServerMonitor_Title">Server Monitor</sys:String>
|
<sys:String x:Key="ServerMonitor_Title">Server Monitor</sys:String>
|
||||||
|
|
||||||
|
<sys:String x:Key="ServerMonitor_SelectedColumnLabel">Selected</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_TotalCountLabel">Total Servers:</sys:String>
|
<sys:String x:Key="ServerMonitor_TotalCountLabel">Total Servers:</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_ServerColumnLabel">Server</sys:String>
|
<sys:String x:Key="ServerMonitor_ServerColumnLabel">Server</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_MapColumnLabel">Map</sys:String>
|
<sys:String x:Key="ServerMonitor_MapColumnLabel">Map</sys:String>
|
||||||
|
|
@ -409,6 +410,16 @@
|
||||||
<sys:String x:Key="ServerMonitor_StatusColumnLabel">Status</sys:String>
|
<sys:String x:Key="ServerMonitor_StatusColumnLabel">Status</sys:String>
|
||||||
|
|
||||||
<sys:String x:Key="ServerMonitor_CreateShortcutButtonTooltip">Create a desktop shortcut to open this form directly.</sys:String>
|
<sys:String x:Key="ServerMonitor_CreateShortcutButtonTooltip">Create a desktop shortcut to open this form directly.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StartServersButtonTooltip">Start the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_ShutdownServersButtonLabel">Shutdown Selected Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_ShutdownServersButtonTooltip">Shutdown the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StopServersButtonLabel">Stop Selected Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StopServersButtonTooltip">Stop the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RestartServersButtonTooltip">Restart the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_UpdateServersButtonTooltip">Update the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_BackupServersButtonTooltip">Backup the selected servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_SelectAllServersButtonTooltip">Select all servers.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_UnselectAllServersButtonTooltip">Unselect all servers.</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_PlayerListButtonTooltip">Open the Player List window.</sys:String>
|
<sys:String x:Key="ServerMonitor_PlayerListButtonTooltip">Open the Player List window.</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_RCONButtonTooltip">Open the RCON window.</sys:String>
|
<sys:String x:Key="ServerMonitor_RCONButtonTooltip">Open the RCON window.</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_StartServerTooltip">Start the server.</sys:String>
|
<sys:String x:Key="ServerMonitor_StartServerTooltip">Start the server.</sys:String>
|
||||||
|
|
@ -419,7 +430,23 @@
|
||||||
<sys:String x:Key="ServerMonitor_UpgradeServer_FailedTitle">Server Update Error</sys:String>
|
<sys:String x:Key="ServerMonitor_UpgradeServer_FailedTitle">Server Update Error</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_UpgradeServer_FailedLabel">Another server is being upgraded, wait until the upgrade has finished and try again.</sys:String>
|
<sys:String x:Key="ServerMonitor_UpgradeServer_FailedLabel">Another server is being upgraded, wait until the upgrade has finished and try again.</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_CloseWindow_ConfirmTitle">Confirm Window Close</sys:String>
|
<sys:String x:Key="ServerMonitor_CloseWindow_ConfirmTitle">Confirm Window Close</sys:String>
|
||||||
<sys:String x:Key="ServerMonitor_CloseWindow_ConfirmLabel">You are currently perform a server update, closing the window with disconnect you from steamcmd. Do you want to continue closing the window?</sys:String>
|
<sys:String x:Key="ServerMonitor_CloseWindow_ConfirmLabel">You are currently performing a server update, closing the window will disconnect you from steamcmd. Do you want to continue closing the window?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_ShutdownServers_ConfirmTitle">Confirm Shutdown Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_ShutdownServers_ConfirmLabel">You are about to shutdown the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StartServers_ConfirmTitle">Confirm Start Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StartServers_ConfirmLabel">You are about to start the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StopServers_ConfirmTitle">Confirm Stop Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_StopServers_ConfirmLabel">You are about to stop the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RestartServers_ConfirmTitle">Confirm Restart Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RestartServers_ConfirmLabel">You are about to restart the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_UpdateServers_ConfirmTitle">Confirm Update Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_UpdateServers_ConfirmLabel">You are about to update the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_BackupServers_ConfirmTitle">Confirm Backup Servers</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_BackupServers_ConfirmLabel">You are about to backup the selected servers. Do you want to continue?</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_NoServersSelected_ErrorTitle">Selected Servers Error</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_NoServersSelected_ErrorLabel">You have not selected any servers. Selected one or more servers in the list and try again.</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RunningProcesses_ConfirmTitle">Close Server Monitor Error</sys:String>
|
||||||
|
<sys:String x:Key="ServerMonitor_RunningProcesses_ConfirmLabel">The server monitor window cannot be closed at this time. One or more of the servers is currently starting, shutting down or restarting.</sys:String>
|
||||||
<!--#endregion-->
|
<!--#endregion-->
|
||||||
|
|
||||||
<!--#region Shutdown Window -->
|
<!--#region Shutdown Window -->
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,7 @@ namespace ServerManagerTool.Lib
|
||||||
public bool DeleteOldBackupFiles = Config.Default.AutoBackup_DeleteOldFiles;
|
public bool DeleteOldBackupFiles = Config.Default.AutoBackup_DeleteOldFiles;
|
||||||
public int ExitCode = EXITCODE_NORMALEXIT;
|
public int ExitCode = EXITCODE_NORMALEXIT;
|
||||||
public bool OutputLogs = false;
|
public bool OutputLogs = false;
|
||||||
|
public bool PerformWorldSave = Config.Default.ServerShutdown_EnableWorldSave;
|
||||||
public bool SendAlerts = false;
|
public bool SendAlerts = false;
|
||||||
public bool SendEmails = false;
|
public bool SendEmails = false;
|
||||||
public string ShutdownReason = null;
|
public string ShutdownReason = null;
|
||||||
|
|
@ -258,11 +259,14 @@ namespace ServerManagerTool.Lib
|
||||||
|
|
||||||
ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped);
|
ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped);
|
||||||
|
|
||||||
// make a backup of the current profile and config files.
|
if (ServerProcess != ServerProcessType.Stop)
|
||||||
CreateProfileBackupArchiveFile(_profile);
|
{
|
||||||
|
// make a backup of the current profile and config files.
|
||||||
|
CreateProfileBackupArchiveFile(_profile);
|
||||||
|
|
||||||
if (ExitCode != EXITCODE_NORMALEXIT)
|
if (ExitCode != EXITCODE_NORMALEXIT)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (BackupWorldFile)
|
if (BackupWorldFile)
|
||||||
{
|
{
|
||||||
|
|
@ -285,10 +289,10 @@ namespace ServerManagerTool.Lib
|
||||||
{
|
{
|
||||||
ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped);
|
ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (ExitCode != EXITCODE_NORMALEXIT)
|
if (ExitCode != EXITCODE_NORMALEXIT)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// check if this is a shutdown only, or a shutdown and restart.
|
// check if this is a shutdown only, or a shutdown and restart.
|
||||||
if (restartServer)
|
if (restartServer)
|
||||||
|
|
@ -579,7 +583,7 @@ namespace ServerManagerTool.Lib
|
||||||
|
|
||||||
// BH - commented out until funcom provide a way to send a save command
|
// BH - commented out until funcom provide a way to send a save command
|
||||||
// check if we need to perform a world save
|
// check if we need to perform a world save
|
||||||
//if (serverAccessible && Config.Default.ServerShutdown_EnableWorldSave)
|
//if (serverAccessible && PerformWorldSave)
|
||||||
//{
|
//{
|
||||||
// try
|
// try
|
||||||
// {
|
// {
|
||||||
|
|
@ -716,6 +720,7 @@ namespace ServerManagerTool.Lib
|
||||||
if (process.HasExited)
|
if (process.HasExited)
|
||||||
{
|
{
|
||||||
process.Close();
|
process.Close();
|
||||||
|
|
||||||
if (Config.Default.EmailNotify_ShutdownRestart)
|
if (Config.Default.EmailNotify_ShutdownRestart)
|
||||||
SendEmail($"{_profile.ProfileName} server shutdown", $"The server has been shutdown to perform the {ServerProcess} process.", false);
|
SendEmail($"{_profile.ProfileName} server shutdown", $"The server has been shutdown to perform the {ServerProcess} process.", false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,11 @@ namespace ServerManagerTool.Utils
|
||||||
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
||||||
case CommandType.Shutdown:
|
case CommandType.Shutdown:
|
||||||
if (Config.Default.AllowDiscordShutdown)
|
if (Config.Default.AllowDiscordShutdown)
|
||||||
return ShutdownServer(channelId, profileIdOrAlias, token);
|
return StopServer(channelId, profileIdOrAlias, true, token);
|
||||||
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
||||||
case CommandType.Stop:
|
case CommandType.Stop:
|
||||||
if (Config.Default.AllowDiscordStop)
|
if (Config.Default.AllowDiscordStop)
|
||||||
return StopServer(channelId, profileIdOrAlias, token);
|
return StopServer(channelId, profileIdOrAlias, false, token);
|
||||||
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_CommandNotEnabled"), commandType) };
|
||||||
case CommandType.Start:
|
case CommandType.Start:
|
||||||
if (Config.Default.AllowDiscordStart)
|
if (Config.Default.AllowDiscordStart)
|
||||||
|
|
@ -471,111 +471,7 @@ namespace ServerManagerTool.Utils
|
||||||
return responseList;
|
return responseList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IList<string> ShutdownServer(string channelId, string profileIdOrAlias, CancellationToken token)
|
private static IList<string> StopServer(string channelId, string profileIdOrAlias, bool shutdown, CancellationToken token)
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(profileIdOrAlias))
|
|
||||||
{
|
|
||||||
return new List<string> { string.Format(_globalizer.GetResourceString("DiscordBot_ProfileMissing"), CommandType.Shutdown) };
|
|
||||||
}
|
|
||||||
|
|
||||||
var profileList = new List<ServerProfileSnapshot>();
|
|
||||||
var responseList = new List<string>();
|
|
||||||
|
|
||||||
TaskUtils.RunOnUIThreadAsync(() =>
|
|
||||||
{
|
|
||||||
var serverList = ServerManager.Instance.Servers.Where(s =>
|
|
||||||
string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase)
|
|
||||||
&& (
|
|
||||||
string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase)
|
|
||||||
|| !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase)
|
|
||||||
|| !string.IsNullOrWhiteSpace(Config.Default.DiscordBotAllServersKeyword) && string.Equals(profileIdOrAlias, Config.Default.DiscordBotAllServersKeyword, StringComparison.OrdinalIgnoreCase)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (serverList.IsEmpty())
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrWhiteSpace(Config.Default.DiscordBotAllServersKeyword) && string.Equals(profileIdOrAlias, Config.Default.DiscordBotAllServersKeyword, StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
responseList.Add(_globalizer.GetResourceString("DiscordBot_NoChannelProfiles"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileNotFound"), profileIdOrAlias));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var server in serverList)
|
|
||||||
{
|
|
||||||
if (!server.Profile.AllowDiscordShutdown)
|
|
||||||
{
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_CommandDisabledProfile"), CommandType.Shutdown, server.Profile.ProfileName));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if another command is being run against the profile
|
|
||||||
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
|
||||||
{
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (server.Runtime.Status)
|
|
||||||
{
|
|
||||||
case ServerStatus.Initializing:
|
|
||||||
case ServerStatus.Stopping:
|
|
||||||
case ServerStatus.Stopped:
|
|
||||||
case ServerStatus.Uninstalled:
|
|
||||||
case ServerStatus.Unknown:
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
|
||||||
continue;
|
|
||||||
|
|
||||||
case ServerStatus.Updating:
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Shutdown);
|
|
||||||
profileList.Add(ServerProfileSnapshot.Create(server.Profile));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).Wait(token);
|
|
||||||
|
|
||||||
foreach (var profile in profileList)
|
|
||||||
{
|
|
||||||
var app = new ServerApp(true)
|
|
||||||
{
|
|
||||||
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
|
||||||
OutputLogs = false,
|
|
||||||
SendAlerts = true,
|
|
||||||
SendEmails = false,
|
|
||||||
ServerProcess = ServerProcessType.Shutdown,
|
|
||||||
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
|
||||||
{
|
|
||||||
TaskUtils.RunOnUIThreadAsync(() =>
|
|
||||||
{
|
|
||||||
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
|
||||||
if (server != null)
|
|
||||||
{
|
|
||||||
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
|
||||||
}
|
|
||||||
}).Wait(token);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
app.PerformProfileShutdown(profile, false, false, false, false, token);
|
|
||||||
_currentProfileCommands.Remove(profile.ProfileId);
|
|
||||||
}, token);
|
|
||||||
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ShutdownRequested"), profile.ServerName));
|
|
||||||
}
|
|
||||||
|
|
||||||
return responseList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IList<string> StopServer(string channelId, string profileIdOrAlias, CancellationToken token)
|
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(profileIdOrAlias))
|
if (string.IsNullOrWhiteSpace(profileIdOrAlias))
|
||||||
{
|
{
|
||||||
|
|
@ -649,12 +545,13 @@ namespace ServerManagerTool.Utils
|
||||||
{
|
{
|
||||||
var app = new ServerApp(true)
|
var app = new ServerApp(true)
|
||||||
{
|
{
|
||||||
|
BackupWorldFile = shutdown,
|
||||||
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
OutputLogs = false,
|
OutputLogs = false,
|
||||||
|
PerformWorldSave = shutdown,
|
||||||
SendAlerts = true,
|
SendAlerts = true,
|
||||||
SendEmails = false,
|
SendEmails = false,
|
||||||
ServerProcess = ServerProcessType.Stop,
|
ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop,
|
||||||
ShutdownInterval = 0,
|
|
||||||
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
{
|
{
|
||||||
TaskUtils.RunOnUIThreadAsync(() =>
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
|
@ -668,13 +565,19 @@ namespace ServerManagerTool.Utils
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!shutdown)
|
||||||
|
app.ShutdownInterval = 0;
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
app.PerformProfileShutdown(profile, false, false, false, false, token);
|
app.PerformProfileShutdown(profile, false, false, false, false, token);
|
||||||
_currentProfileCommands.Remove(profile.ProfileId);
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
}, token);
|
}, token);
|
||||||
|
|
||||||
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_StopRequested"), profile.ServerName));
|
if (shutdown)
|
||||||
|
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_ShutdownRequested"), profile.ServerName));
|
||||||
|
else
|
||||||
|
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_StopRequested"), profile.ServerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
return responseList;
|
return responseList;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,11 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
|
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||||
|
xmlns:sm="clr-namespace:ServerManagerTool"
|
||||||
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
|
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
|
||||||
xmlns:com="clr-namespace:ServerManagerTool.Common;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:enum="clr-namespace:ServerManagerTool.Enums"
|
||||||
xmlns:vm="clr-namespace:ServerManagerTool.Lib.ViewModel"
|
xmlns:vm="clr-namespace:ServerManagerTool.Lib.ViewModel"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
@ -19,7 +22,15 @@
|
||||||
<ResourceDictionary Source="..\Styles\Default.xaml"/>
|
<ResourceDictionary Source="..\Styles\Default.xaml"/>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
|
<sm:ScrollToBottomAction x:Key="ScrollToBottomAction" />
|
||||||
<vm:MapNameValueConverter x:Key="MapNameValueConverter"/>
|
<vm:MapNameValueConverter x:Key="MapNameValueConverter"/>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="StopButtonContent">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Stop.ico,Size=32}" Width="16" VerticalAlignment="Center"/>
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/DropArrow.ico,Size=32}" Width="8" Margin="2,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
|
|
@ -28,11 +39,20 @@
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="10*"/>
|
<RowDefinition Height="*" MinHeight="200"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto" MinHeight="100"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="200*"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
@ -41,12 +61,55 @@
|
||||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Shortcut.ico,Size=32}"/>
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Shortcut.ico,Size=32}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
|
<Button Grid.Row="0" Grid.Column="1" Width="22" Height="22" Margin="10,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="SelectAllServers_Click" ToolTip="{DynamicResource ServerMonitor_SelectAllServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Checked.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="2" Width="22" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="UnselectAllServers_Click" ToolTip="{DynamicResource ServerMonitor_UnselectAllServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Unchecked.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="3" Width="22" Height="22" Margin="10,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding StartServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_StartServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Start.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="4" Width="22" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding RestartServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_RestartServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Restart.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<controls:DropDownButton Grid.Row="0" Grid.Column="5" Width="35" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Center">
|
||||||
|
<ContentControl ContentTemplate="{StaticResource StopButtonContent}" />
|
||||||
|
|
||||||
|
<controls:DropDownButton.Menu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Header="{DynamicResource ServerMonitor_ShutdownServersButtonLabel}" Command="{Binding ShutdownServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_ShutdownServersButtonTooltip}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Stop.ico,Size=32}"/>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Header="{DynamicResource ServerMonitor_StopServersButtonLabel}" Command="{Binding StopServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_StopServersButtonTooltip}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Stop.ico,Size=32}"/>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
</ContextMenu>
|
||||||
|
</controls:DropDownButton.Menu>
|
||||||
|
</controls:DropDownButton>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="6" Width="22" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" Command="{Binding UpdateServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_UpdateServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Download.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="7" Width="22" Height="22" Margin="0,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding BackupServersCommand}" CommandParameter="{Binding}" ToolTip="{DynamicResource ServerMonitor_BackupServersButtonTooltip}">
|
||||||
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Save.ico,Size=32}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="0" Grid.Column="8" Orientation="Horizontal">
|
||||||
<TextBlock Margin="30,5,5,0" Text="{DynamicResource ServerMonitor_TotalCountLabel}" VerticalAlignment="Center" />
|
<TextBlock Margin="30,5,5,0" Text="{DynamicResource ServerMonitor_TotalCountLabel}" VerticalAlignment="Center" />
|
||||||
<TextBlock Margin="5,5,5,0" Text="{Binding ServerManager.Servers.Count}" VerticalAlignment="Center" />
|
<TextBlock Margin="5,5,5,0" Text="{Binding ServerManager.Servers.Count}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Button Grid.Row="0" Grid.Column="2" Height="22" Margin="5,5,5,0" Background="#00AA00" Foreground="White" Padding="1" BorderThickness="1" BorderBrush="White" ContentStringFormat="{DynamicResource MainWindow_UpdateToLabelFormat}" Content="{Binding LatestServerManagerVersion}" Click="UpgradeApplication_Click" VerticalAlignment="Center" >
|
<Button Grid.Row="0" Grid.Column="9" Height="22" Margin="5,5,5,0" Background="#00AA00" Foreground="White" Padding="1" BorderThickness="1" BorderBrush="White" ContentStringFormat="{DynamicResource MainWindow_UpdateToLabelFormat}" Content="{Binding LatestServerManagerVersion}" Click="UpgradeApplication_Click" VerticalAlignment="Center" >
|
||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style TargetType="{x:Type Button}">
|
<Style TargetType="{x:Type Button}">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
|
|
@ -61,7 +124,7 @@
|
||||||
</Button.Style>
|
</Button.Style>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Grid.Row="0" Grid.Column="3" Width="22" Height="22" Margin="5,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="PatchNotes_Click" ToolTip="{DynamicResource ServerSettings_PatchNotesTooltip}">
|
<Button Grid.Row="0" Grid.Column="10" Width="22" Height="22" Margin="5,5,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="PatchNotes_Click" ToolTip="{DynamicResource ServerSettings_PatchNotesTooltip}">
|
||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style TargetType="{x:Type Button}">
|
<Style TargetType="{x:Type Button}">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
|
|
@ -78,7 +141,7 @@
|
||||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/ChangeNotes.ico,Size=32}"/>
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/ChangeNotes.ico,Size=32}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="5" Name="ServersGrid" ItemsSource="{Binding ServerManager.Servers}" GridLinesVisibility="Horizontal" HeadersVisibility="All" AutoGenerateColumns="False" CanUserAddRows="False" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" RowHeaderWidth="25" SelectionMode="Single" PreviewMouseLeftButtonDown="OnMouseLeftButtonDown">
|
<DataGrid Name="ServersGrid" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="11" Margin="5,5,5,0" HorizontalAlignment="Stretch" ItemsSource="{Binding ServerManager.Servers}" GridLinesVisibility="Horizontal" HeadersVisibility="All" AutoGenerateColumns="False" CanUserAddRows="False" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" RowHeaderWidth="25" SelectionMode="Single" PreviewMouseLeftButtonDown="OnMouseLeftButtonDown">
|
||||||
<DataGrid.Resources>
|
<DataGrid.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<Style TargetType="{x:Type DataGridCell}">
|
<Style TargetType="{x:Type DataGridCell}">
|
||||||
|
|
@ -140,6 +203,14 @@
|
||||||
|
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
|
|
||||||
|
<DataGridTemplateColumn Width="Auto" Header="{DynamicResource ServerMonitor_SelectedColumnLabel}">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
<DataGridTemplateColumn Width="*">
|
<DataGridTemplateColumn Width="*">
|
||||||
<DataGridTemplateColumn.Header>
|
<DataGridTemplateColumn.Header>
|
||||||
<TextBlock Text="{DynamicResource ServerMonitor_ServerColumnLabel}" />
|
<TextBlock Text="{DynamicResource ServerMonitor_ServerColumnLabel}" />
|
||||||
|
|
@ -530,11 +601,27 @@
|
||||||
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
||||||
|
<GridSplitter Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="11" Height="5" ShowsPreview="True" HorizontalAlignment="Stretch" VerticalAlignment="Center" Opacity="0"/>
|
||||||
|
|
||||||
|
<RichTextBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="11" Margin="5,0,5,5" BorderBrush="LightGray" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" IsReadOnlyCaretVisible="True" IsReadOnly="True" IsTabStop="False">
|
||||||
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="TextChanged" >
|
||||||
|
<sm:ScrollToBottomAction IsEnabled="True"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
|
<RichTextBox.Resources>
|
||||||
|
<Style TargetType="{x:Type Paragraph}">
|
||||||
|
<Setter Property="Margin" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
</RichTextBox.Resources>
|
||||||
|
<FlowDocument Name="ConsoleContent"/>
|
||||||
|
</RichTextBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
<!-- Drag and Drop Popup -->
|
<!-- Drag and Drop Popup -->
|
||||||
<Popup Grid.Row="0" Grid.Column="0" x:Name="popup" IsHitTestVisible="False" Placement="RelativePoint" PlacementTarget="{Binding ElementName=ServerMonitorUI}" AllowsTransparency="True">
|
<Popup x:Name="popup" IsHitTestVisible="False" Placement="RelativePoint" PlacementTarget="{Binding ElementName=ServerMonitorUI}" AllowsTransparency="True">
|
||||||
<Border BorderBrush="LightSteelBlue" BorderThickness="2" Background="White" Opacity="0.75">
|
<Border BorderBrush="LightSteelBlue" BorderThickness="2" Background="White" Opacity="0.75">
|
||||||
<StackPanel Orientation="Horizontal" Margin="4,3,8,3">
|
<StackPanel Orientation="Horizontal" Margin="4,3,8,3">
|
||||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Drag.ico,Size=32}" Width="16" Height="16"/>
|
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Drag.ico,Size=32}" Width="16" Height="16"/>
|
||||||
|
|
@ -544,7 +631,7 @@
|
||||||
</Popup>
|
</Popup>
|
||||||
|
|
||||||
<!-- It's important that this is in the end of the XAML as it needs to be on top of everything else! -->
|
<!-- It's important that this is in the end of the XAML as it needs to be on top of everything else! -->
|
||||||
<Grid x:Name="OverlayGrid" Visibility="Collapsed" DockPanel.Dock="Top" >
|
<Grid x:Name="OverlayGrid" Visibility="Collapsed" DockPanel.Dock="Top">
|
||||||
<Grid Background="Black" Opacity="0.5"/>
|
<Grid Background="Black" Opacity="0.5"/>
|
||||||
<Border MinWidth="250" Background="Orange" BorderBrush="Black" BorderThickness="1" CornerRadius="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
<Border MinWidth="250" Background="Orange" BorderBrush="Black" BorderThickness="1" CornerRadius="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using NLog;
|
using NLog;
|
||||||
using ServerManagerTool.Common.Lib;
|
using ServerManagerTool.Common.Lib;
|
||||||
using ServerManagerTool.Common.Utils;
|
using ServerManagerTool.Common.Utils;
|
||||||
|
using ServerManagerTool.DiscordBot.Enums;
|
||||||
using ServerManagerTool.Enums;
|
using ServerManagerTool.Enums;
|
||||||
using ServerManagerTool.Lib;
|
using ServerManagerTool.Lib;
|
||||||
using ServerManagerTool.Plugin.Common;
|
using ServerManagerTool.Plugin.Common;
|
||||||
|
|
@ -16,7 +17,9 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
using WPFSharp.Globalizer;
|
using WPFSharp.Globalizer;
|
||||||
|
|
||||||
namespace ServerManagerTool.Windows
|
namespace ServerManagerTool.Windows
|
||||||
|
|
@ -26,19 +29,42 @@ namespace ServerManagerTool.Windows
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ServerMonitorWindow : Window
|
public partial class ServerMonitorWindow : Window
|
||||||
{
|
{
|
||||||
|
public class ServerMonitorOutput_Error : Run
|
||||||
|
{
|
||||||
|
public ServerMonitorOutput_Error(string value)
|
||||||
|
: base(value)
|
||||||
|
{
|
||||||
|
Foreground = Brushes.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ServerMonitorOutput_Success : Run
|
||||||
|
{
|
||||||
|
public ServerMonitorOutput_Success(string value)
|
||||||
|
: base(value)
|
||||||
|
{
|
||||||
|
Foreground = Brushes.Green;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
private static readonly List<ServerMonitorWindow> Windows = new List<ServerMonitorWindow>();
|
private static readonly List<ServerMonitorWindow> Windows = new List<ServerMonitorWindow>();
|
||||||
|
|
||||||
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
|
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
|
||||||
private CancellationTokenSource _upgradeCancellationSource = null;
|
private CancellationTokenSource _upgradeCancellationSource = null;
|
||||||
private ActionQueue _versionChecker;
|
private ActionQueue _versionChecker;
|
||||||
|
private ActionQueue _canExecuteChecker;
|
||||||
|
private readonly Dictionary<string, CommandType> _currentProfileCommands = new Dictionary<string, CommandType>();
|
||||||
|
|
||||||
|
private bool HasRunningCommands => _currentProfileCommands.Count > 0;
|
||||||
|
|
||||||
public static readonly DependencyProperty ServerManagerProperty = DependencyProperty.Register(nameof(ServerManager), typeof(ServerManager), typeof(ServerMonitorWindow), new PropertyMetadata(null));
|
public static readonly DependencyProperty ServerManagerProperty = DependencyProperty.Register(nameof(ServerManager), typeof(ServerManager), typeof(ServerMonitorWindow), new PropertyMetadata(null));
|
||||||
public static readonly DependencyProperty LatestServerManagerVersionProperty = DependencyProperty.Register(nameof(LatestServerManagerVersion), typeof(Version), typeof(ServerMonitorWindow), new PropertyMetadata(new Version()));
|
public static readonly DependencyProperty LatestServerManagerVersionProperty = DependencyProperty.Register(nameof(LatestServerManagerVersion), typeof(Version), typeof(ServerMonitorWindow), new PropertyMetadata(new Version()));
|
||||||
public static readonly DependencyProperty ShowUpdateButtonProperty = DependencyProperty.Register(nameof(ShowUpdateButton), typeof(bool), typeof(ServerMonitorWindow), new PropertyMetadata(false));
|
public static readonly DependencyProperty ShowUpdateButtonProperty = DependencyProperty.Register(nameof(ShowUpdateButton), typeof(bool), typeof(ServerMonitorWindow), new PropertyMetadata(false));
|
||||||
public static readonly DependencyProperty IsStandAloneWindowProperty = DependencyProperty.Register(nameof(IsStandAloneWindow), typeof(bool), typeof(ServerMonitorWindow), new PropertyMetadata(false));
|
public static readonly DependencyProperty IsStandAloneWindowProperty = DependencyProperty.Register(nameof(IsStandAloneWindow), typeof(bool), typeof(ServerMonitorWindow), new PropertyMetadata(false));
|
||||||
|
public static readonly DependencyProperty CancellationTokenSourceProperty = DependencyProperty.Register(nameof(CancellationTokenSource), typeof(CancellationTokenSource), typeof(ServerMonitorWindow));
|
||||||
|
|
||||||
public ServerMonitorWindow() : this(null)
|
public ServerMonitorWindow(): this(null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,6 +115,12 @@ namespace ServerManagerTool.Windows
|
||||||
set { SetValue(IsStandAloneWindowProperty, value); }
|
set { SetValue(IsStandAloneWindowProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CancellationTokenSource CancellationTokenSource
|
||||||
|
{
|
||||||
|
get { return (CancellationTokenSource)GetValue(CancellationTokenSourceProperty); }
|
||||||
|
set { SetValue(CancellationTokenSourceProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
private void ServerMonitorWindow_Loaded(object sender, RoutedEventArgs e)
|
private void ServerMonitorWindow_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (ServerManager == null)
|
if (ServerManager == null)
|
||||||
|
|
@ -121,6 +153,9 @@ namespace ServerManagerTool.Windows
|
||||||
_versionChecker = new ActionQueue();
|
_versionChecker = new ActionQueue();
|
||||||
_versionChecker.PostAction(CheckForUpdates).DoNotWait();
|
_versionChecker.PostAction(CheckForUpdates).DoNotWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_canExecuteChecker = new ActionQueue();
|
||||||
|
_canExecuteChecker.PostAction(RaiseCanExecuteChanged).DoNotWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ServerMonitorWindow_LocationChanged(object sender, EventArgs e)
|
private void ServerMonitorWindow_LocationChanged(object sender, EventArgs e)
|
||||||
|
|
@ -156,6 +191,14 @@ namespace ServerManagerTool.Windows
|
||||||
|
|
||||||
protected override void OnClosing(CancelEventArgs e)
|
protected override void OnClosing(CancelEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (HasRunningCommands)
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_RunningProcesses_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_RunningProcesses_ConfirmTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
|
||||||
|
e.Cancel = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.OwnedWindows.OfType<ProgressWindow>().Any())
|
if (this.OwnedWindows.OfType<ProgressWindow>().Any())
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_CloseWindow_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_CloseWindow_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes)
|
if (MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_CloseWindow_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_CloseWindow_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes)
|
||||||
|
|
@ -166,7 +209,9 @@ namespace ServerManagerTool.Windows
|
||||||
}
|
}
|
||||||
|
|
||||||
Windows.Remove(this);
|
Windows.Remove(this);
|
||||||
|
|
||||||
_versionChecker?.DisposeAsync().DoNotWait();
|
_versionChecker?.DisposeAsync().DoNotWait();
|
||||||
|
_canExecuteChecker?.DisposeAsync().DoNotWait();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
@ -409,6 +454,29 @@ namespace ServerManagerTool.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddErrorBlockContent(string message)
|
||||||
|
{
|
||||||
|
var p = new Paragraph();
|
||||||
|
|
||||||
|
p.Inlines.Add(new ServerMonitorOutput_Error(message));
|
||||||
|
|
||||||
|
ConsoleContent.Blocks.Add(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddMessageBlockContent(string message)
|
||||||
|
{
|
||||||
|
var p = new Paragraph();
|
||||||
|
|
||||||
|
p.Inlines.Add(new ServerMonitorOutput_Success(message));
|
||||||
|
|
||||||
|
ConsoleContent.Blocks.Add(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearBlockContents()
|
||||||
|
{
|
||||||
|
ConsoleContent.Blocks.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
private async Task CheckForUpdates()
|
private async Task CheckForUpdates()
|
||||||
{
|
{
|
||||||
string url = App.Instance.BetaVersion ? Config.Default.LatestServerManagerBetaVersionUrl : Config.Default.LatestServerManagerVersionUrl;
|
string url = App.Instance.BetaVersion ? Config.Default.LatestServerManagerBetaVersionUrl : Config.Default.LatestServerManagerVersionUrl;
|
||||||
|
|
@ -455,6 +523,14 @@ namespace ServerManagerTool.Windows
|
||||||
return new ServerMonitorWindow(serverManager);
|
return new ServerMonitorWindow(serverManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task RaiseCanExecuteChanged()
|
||||||
|
{
|
||||||
|
await TaskUtils.RunOnUIThreadAsync(() => CommandManager.InvalidateRequerySuggested());
|
||||||
|
await Task.Delay(5000);
|
||||||
|
|
||||||
|
_canExecuteChecker?.PostAction(RaiseCanExecuteChanged).DoNotWait();
|
||||||
|
}
|
||||||
|
|
||||||
private void SetWindowTitle()
|
private void SetWindowTitle()
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(App.Instance.Title))
|
if (!string.IsNullOrWhiteSpace(App.Instance.Title))
|
||||||
|
|
@ -699,6 +775,114 @@ namespace ServerManagerTool.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICommand BackupServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await BackupSelectedServersAsync();
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand RestartServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await RestartSelectedServersAsync();
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand ShutdownServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await StopSelectedServersAsync(true);
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand StartServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await StartSelectedServersAsync();
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand StopServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await StopSelectedServersAsync(false);
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand UpdateServersCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RelayCommand<object>(
|
||||||
|
execute: async (_) =>
|
||||||
|
{
|
||||||
|
await UpdateSelectedServersAsync();
|
||||||
|
},
|
||||||
|
canExecute: (_) =>
|
||||||
|
{
|
||||||
|
return ServerManager?.Servers != null && ServerManager.Servers.Count > 0 && ServerManager.Servers.Any(s => s.Selected) && ServerManager.Servers.All(s => s.Runtime.Status != ServerStatus.Unknown)
|
||||||
|
&& CancellationTokenSource == null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Drag and Drop
|
#region Drag and Drop
|
||||||
|
|
||||||
public static readonly DependencyProperty DraggedItemProperty = DependencyProperty.Register(nameof(DraggedItem), typeof(Server), typeof(ServerMonitorWindow), new PropertyMetadata(null));
|
public static readonly DependencyProperty DraggedItemProperty = DependencyProperty.Register(nameof(DraggedItem), typeof(Server), typeof(ServerMonitorWindow), new PropertyMetadata(null));
|
||||||
|
|
@ -813,5 +997,521 @@ namespace ServerManagerTool.Windows
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
private void SelectAllServers_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (var server in ServerManager.Servers)
|
||||||
|
{
|
||||||
|
server.Selected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UnselectAllServers_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (var server in ServerManager.Servers)
|
||||||
|
{
|
||||||
|
server.Selected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task BackupSelectedServersAsync()
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_BackupServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_BackupServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Uninstalled:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Backup);
|
||||||
|
profileList.Add(ServerProfileSnapshot.Create(server.Profile));
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = ServerProcessType.Backup,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileBackup(profile, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_BackupRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task RestartSelectedServersAsync()
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_RestartServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_RestartServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Uninstalled:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Restart);
|
||||||
|
var profile = ServerProfileSnapshot.Create(server.Profile);
|
||||||
|
profile.AutoRestartIfShutdown = true;
|
||||||
|
profileList.Add(profile);
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = ServerProcessType.Restart,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileShutdown(profile, true, false, false, false, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_RestartRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task StartSelectedServersAsync()
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_StartServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_StartServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Running:
|
||||||
|
case ServerStatus.Uninstalled:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Start);
|
||||||
|
var profile = ServerProfileSnapshot.Create(server.Profile);
|
||||||
|
profile.AutoRestartIfShutdown = true;
|
||||||
|
profileList.Add(profile);
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = ServerProcessType.Restart,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileShutdown(profile, true, false, false, false, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_StartRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task StopSelectedServersAsync(bool shutdown)
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = shutdown
|
||||||
|
? MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_ShutdownServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_ShutdownServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question)
|
||||||
|
: MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_StopServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_StopServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Stopped:
|
||||||
|
case ServerStatus.Uninstalled:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Stop);
|
||||||
|
profileList.Add(ServerProfileSnapshot.Create(server.Profile));
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
BackupWorldFile = shutdown,
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
PerformWorldSave = shutdown,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!shutdown)
|
||||||
|
app.ShutdownInterval = 0;
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileShutdown(profile, false, false, false, false, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
if (shutdown)
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ShutdownRequested"), profile.ServerName));
|
||||||
|
else
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_StopRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UpdateSelectedServersAsync()
|
||||||
|
{
|
||||||
|
if (CancellationTokenSource != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var serverList = ServerManager.Servers.Where(s => s.Selected);
|
||||||
|
if (serverList.IsEmpty())
|
||||||
|
{
|
||||||
|
MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorLabel"), _globalizer.GetResourceString("ServerMonitor_NoServersSelected_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = MessageBox.Show(_globalizer.GetResourceString("ServerMonitor_UpdateServers_ConfirmLabel"), _globalizer.GetResourceString("ServerMonitor_UpdateServers_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ClearBlockContents();
|
||||||
|
|
||||||
|
var profileList = new List<ServerProfileSnapshot>();
|
||||||
|
|
||||||
|
foreach (var server in serverList)
|
||||||
|
{
|
||||||
|
var performRestart = false;
|
||||||
|
|
||||||
|
// check if another command is being run against the profile
|
||||||
|
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
|
||||||
|
{
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_CommandRunningProfile"), _currentProfileCommands[server.Profile.ProfileID], server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (server.Runtime.Status)
|
||||||
|
{
|
||||||
|
case ServerStatus.Running:
|
||||||
|
performRestart = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ServerStatus.Initializing:
|
||||||
|
case ServerStatus.Stopping:
|
||||||
|
case ServerStatus.Unknown:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileBadStatus"), server.Profile.ProfileName, server.Runtime.StatusString));
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case ServerStatus.Updating:
|
||||||
|
AddErrorBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_ProfileUpdating"), server.Profile.ProfileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update);
|
||||||
|
var profile = ServerProfileSnapshot.Create(server.Profile);
|
||||||
|
profile.RestartAfterShutdown1 = performRestart; // use this property to trigger a restart
|
||||||
|
profileList.Add(profile);
|
||||||
|
}
|
||||||
|
|
||||||
|
CancellationTokenSource = new CancellationTokenSource();
|
||||||
|
var token = CancellationTokenSource.Token;
|
||||||
|
var tasks = new List<Task>();
|
||||||
|
|
||||||
|
foreach (var profile in profileList)
|
||||||
|
{
|
||||||
|
var app = new ServerApp(true)
|
||||||
|
{
|
||||||
|
DeleteOldBackupFiles = !Config.Default.AutoBackup_EnableBackup,
|
||||||
|
OutputLogs = false,
|
||||||
|
SendAlerts = true,
|
||||||
|
SendEmails = false,
|
||||||
|
ServerProcess = ServerProcessType.Update,
|
||||||
|
ServerStatusChangeCallback = (ServerStatus serverStatus) =>
|
||||||
|
{
|
||||||
|
TaskUtils.RunOnUIThreadAsync(() =>
|
||||||
|
{
|
||||||
|
var server = ServerManager.Instance.Servers.FirstOrDefault(s => string.Equals(profile.ProfileId, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown);
|
||||||
|
}
|
||||||
|
}).Wait(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
app.PerformProfileShutdown(profile, profile.RestartAfterShutdown1, true, false, false, token);
|
||||||
|
_currentProfileCommands.Remove(profile.ProfileId);
|
||||||
|
}, token);
|
||||||
|
|
||||||
|
tasks.Add(task);
|
||||||
|
|
||||||
|
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_UpdateRequested"), profile.ServerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CancellationTokenSource?.Dispose();
|
||||||
|
CancellationTokenSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<Configurations>Debug;Release;Debug - Beta</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net462</TargetFramework>
|
<TargetFramework>net462</TargetFramework>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<Configurations>Debug;Release;Debug - Beta</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net462</TargetFramework>
|
<TargetFramework>net462</TargetFramework>
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerManager.Common.UnitTests", "ServerManager.Common.UnitTests\ServerManager.Common.UnitTests.csproj", "{18271A4E-6135-466A-BCF8-80E25446F454}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerManager.Common.UnitTests", "ServerManager.Common.UnitTests\ServerManager.Common.UnitTests.csproj", "{18271A4E-6135-466A-BCF8-80E25446F454}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueryMaster.UnitTests", "QueryMaster.UnitTests\QueryMaster.UnitTests.csproj", "{A2EEBC18-DAD8-415D-98E4-258EB12369C7}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QueryMaster.UnitTests", "QueryMaster.UnitTests\QueryMaster.UnitTests.csproj", "{A2EEBC18-DAD8-415D-98E4-258EB12369C7}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|
@ -58,6 +58,7 @@ Global
|
||||||
Debug - AutoShutdown|Any CPU = Debug - AutoShutdown|Any CPU
|
Debug - AutoShutdown|Any CPU = Debug - AutoShutdown|Any CPU
|
||||||
Debug - AutoUpdate|Any CPU = Debug - AutoUpdate|Any CPU
|
Debug - AutoUpdate|Any CPU = Debug - AutoUpdate|Any CPU
|
||||||
Debug - Beta|Any CPU = Debug - Beta|Any CPU
|
Debug - Beta|Any CPU = Debug - Beta|Any CPU
|
||||||
|
Debug - ServerMonitor|Any CPU = Debug - ServerMonitor|Any CPU
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
|
@ -68,8 +69,10 @@ Global
|
||||||
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{7C99D9F7-0C65-4116-927A-94EB018C88FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -80,8 +83,10 @@ Global
|
||||||
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{715461E8-4E54-4993-80A8-8E72892135E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{715461E8-4E54-4993-80A8-8E72892135E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -92,8 +97,10 @@ Global
|
||||||
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E4EDA8B8-006C-4D41-822F-F64B6DB0021F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -104,8 +111,10 @@ Global
|
||||||
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{679FE859-9A82-4FFB-A758-C1E8DF915F58}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -116,8 +125,10 @@ Global
|
||||||
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{936EF260-FECF-4E9E-A21E-092D65931C7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -128,8 +139,10 @@ Global
|
||||||
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{3E0C9EE6-780F-4FEF-BA03-E38062A5FDB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -140,8 +153,10 @@ Global
|
||||||
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{D2EE1483-021F-4900-BBE8-88338D1386F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -154,6 +169,8 @@ Global
|
||||||
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug - AutoUpdate|Any CPU.Build.0 = Debug - AutoUpdate|Any CPU
|
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug - AutoUpdate|Any CPU.Build.0 = Debug - AutoUpdate|Any CPU
|
||||||
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
||||||
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
||||||
|
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug - ServerMonitor|Any CPU
|
||||||
|
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug - ServerMonitor|Any CPU.Build.0 = Debug - ServerMonitor|Any CPU
|
||||||
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{F7A82C6A-32CD-4847-AD16-D79ADC72746E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -164,8 +181,10 @@ Global
|
||||||
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{96832688-29BD-464F-9DCE-482E37BFC751}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{96832688-29BD-464F-9DCE-482E37BFC751}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -178,6 +197,8 @@ Global
|
||||||
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug - AutoUpdate|Any CPU.Build.0 = Debug - AutoUpdate|Any CPU
|
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug - AutoUpdate|Any CPU.Build.0 = Debug - AutoUpdate|Any CPU
|
||||||
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
||||||
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
||||||
|
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug - ServerMonitor|Any CPU
|
||||||
|
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug - ServerMonitor|Any CPU.Build.0 = Debug - ServerMonitor|Any CPU
|
||||||
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -188,8 +209,10 @@ Global
|
||||||
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{4CA9C894-518F-42D7-BBE2-CFDFE7A03F8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -200,8 +223,10 @@ Global
|
||||||
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{DD0A2401-99B8-4DE1-B8ED-9B075172F8AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -212,8 +237,10 @@ Global
|
||||||
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{630422CA-4BCC-4D1D-9701-87D8EAF0B209}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -224,8 +251,10 @@ Global
|
||||||
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{39C42E58-36BD-4C6B-9AD2-7F9EBCA7A68A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -238,6 +267,8 @@ Global
|
||||||
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A8BFC452-5BE8-41E7-BD1D-C29B944185CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -249,6 +280,8 @@ Global
|
||||||
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{1434D87A-E9FC-48B9-BEC9-E5A3003F1F2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -258,8 +291,10 @@ Global
|
||||||
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - AutoShutdown|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - AutoUpdate|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - Beta|Any CPU.ActiveCfg = Debug - Beta|Any CPU
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - Beta|Any CPU.Build.0 = Debug - Beta|Any CPU
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C4C8000D-5E45-497C-A218-B95A1567010E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C4C8000D-5E45-497C-A218-B95A1567010E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -272,6 +307,8 @@ Global
|
||||||
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{18271A4E-6135-466A-BCF8-80E25446F454}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{18271A4E-6135-466A-BCF8-80E25446F454}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{18271A4E-6135-466A-BCF8-80E25446F454}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
@ -283,6 +320,8 @@ Global
|
||||||
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug - AutoUpdate|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug - Beta|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug - Beta|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug - ServerMonitor|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug - ServerMonitor|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A2EEBC18-DAD8-415D-98E4-258EB12369C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ namespace ServerManagerTool.Common.Lib
|
||||||
public ActionQueue(TaskScheduler scheduler = null)
|
public ActionQueue(TaskScheduler scheduler = null)
|
||||||
{
|
{
|
||||||
this.workQueue = new ActionBlock<Action>(a => a.Invoke(), new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 1, TaskScheduler = scheduler ?? TaskScheduler.Default });
|
this.workQueue = new ActionBlock<Action>(a => a.Invoke(), new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 1, TaskScheduler = scheduler ?? TaskScheduler.Default });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<T> PostAction<T>(Func<T> action)
|
public Task<T> PostAction<T>(Func<T> action)
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,7 @@ namespace ServerManagerTool.Common.Lib
|
||||||
/// <param name="canExecute">The execution status logic.</param>
|
/// <param name="canExecute">The execution status logic.</param>
|
||||||
public RelayCommand(Action<T> execute, Predicate<T> canExecute)
|
public RelayCommand(Action<T> execute, Predicate<T> canExecute)
|
||||||
{
|
{
|
||||||
if (execute == null)
|
_execute = execute ?? throw new ArgumentNullException("execute");
|
||||||
throw new ArgumentNullException("execute");
|
|
||||||
|
|
||||||
_execute = execute;
|
|
||||||
_canExecute = canExecute;
|
_canExecute = canExecute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +50,7 @@ namespace ServerManagerTool.Common.Lib
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return _canExecute == null ? true : _canExecute((T)parameter);
|
return _canExecute == null || _canExecute((T)parameter);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<Configurations>Debug;Release;Debug - Beta</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net462</TargetFramework>
|
<TargetFramework>net462</TargetFramework>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<Configurations>Debug;Release;Debug - Beta</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net462</TargetFramework>
|
<TargetFramework>net462</TargetFramework>
|
||||||
|
|
@ -11,9 +11,6 @@
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
<DebugSymbols>false</DebugSymbols>
|
<DebugSymbols>false</DebugSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Beta|AnyCPU'">
|
|
||||||
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Discord.Addons.Interactive" Version="2.0.0" />
|
<PackageReference Include="Discord.Addons.Interactive" Version="2.0.0" />
|
||||||
<PackageReference Include="Discord.Net" Version="2.4.0" />
|
<PackageReference Include="Discord.Net" Version="2.4.0" />
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<Configurations>Debug;Release;Debug - Beta</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Configurations>Debug;Release;Debug - Beta</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<ApplicationIcon>Art\favicon.ico</ApplicationIcon>
|
<ApplicationIcon>Art\favicon.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
@ -14,9 +14,6 @@
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Beta|AnyCPU'">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue