mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
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:
parent
5b822517c3
commit
2baf0bc392
10 changed files with 422 additions and 210 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue