Server Shutdown/Restart Fixes

- rewritten the code that sends the RCON commands to prevent the hangs after the RCON command fails.
- added an accessibility check when doing the worldsave and first shutdown via RCON.
- changed the online player count method on the main screen.
- updated the support zip method with the new global settings.
This commit is contained in:
Brett Hewitson 2022-05-15 00:38:08 +10:00
parent 5b822517c3
commit 2baf0bc392
10 changed files with 422 additions and 210 deletions

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
@ -307,15 +308,16 @@ namespace ServerManagerTool.Lib
{
serverInfo = null;
}
}
try
{
onlinePlayerCount = serverInfo?.Players ?? 0;
}
catch (Exception)
{
onlinePlayerCount = 0;
try
{
var playerInfo = server?.GetPlayers()?.Where(p => !string.IsNullOrWhiteSpace(p.Name?.Trim()));
onlinePlayerCount = playerInfo?.Count() ?? 0;
}
catch (Exception)
{
onlinePlayerCount = 0;
}
}
}
catch (SocketException ex)