bugfix: private servers were shown with port 0

This commit is contained in:
CommonLoon102 2020-01-24 08:48:59 +01:00
parent 0ac65ffd08
commit 6b1351ab0d
4 changed files with 3 additions and 5 deletions

View File

@ -63,14 +63,12 @@ namespace Supervisor
{
Port = packetData.Port,
IsStarted = packetData.IsStarted,
IsPrivate = packetData.IsPrivate,
CurrentPlayers = packetData.CurrentPlayers,
MaximumPlayers = packetData.MaximumPlayers
},
(port, server) =>
{
server.IsStarted = packetData.IsStarted;
server.IsPrivate = packetData.IsPrivate;
server.CurrentPlayers = packetData.CurrentPlayers;
server.MaximumPlayers = packetData.MaximumPlayers;
return server;

View File

@ -8,6 +8,5 @@ namespace Supervisor
{
public int Port { get; set; }
public bool IsStarted { get; set; }
public bool IsPrivate { get; set; }
}
}

View File

@ -61,6 +61,7 @@ namespace Supervisor
int processId = int.Parse(split[1]);
Program.State.Servers.AddOrUpdate(port, new Server()
{
Port = port,
ProcessId = processId,
IsPrivate = true
},

View File

@ -58,8 +58,8 @@ namespace WebInterface.Controllers
_isBusy = true;
if (parameters.Players < 2)
parameters.Players = 2;
if (parameters.Players < 3)
parameters.Players = 3;
if (parameters.ApiKey != _config.GetValue<string>("ApiKey"))
return new StartServerResponse("Invalid ApiKey.");