track private slots for webfront overview
This commit is contained in:
parent
99e0990770
commit
bc0ec6c050
@ -1342,6 +1342,8 @@ namespace IW4MAdmin
|
||||
var logsync = await this.GetMappedDvarValueOrDefaultAsync<int>("g_logsync", token: Manager.CancellationToken);
|
||||
var ip = await this.GetMappedDvarValueOrDefaultAsync<string>("net_ip", token: Manager.CancellationToken);
|
||||
var gamePassword = await this.GetMappedDvarValueOrDefaultAsync("g_password", overrideDefault: "", token: Manager.CancellationToken);
|
||||
var privateClients = await this.GetMappedDvarValueOrDefaultAsync("sv_privateClients", overrideDefault: 0,
|
||||
token: Manager.CancellationToken);
|
||||
|
||||
if (Manager.GetApplicationSettings().Configuration().EnableCustomSayName)
|
||||
{
|
||||
@ -1383,12 +1385,14 @@ namespace IW4MAdmin
|
||||
}
|
||||
|
||||
WorkingDirectory = basepath.Value;
|
||||
this.Hostname = hostname;
|
||||
this.MaxClients = maxplayers;
|
||||
this.FSGame = game.Value;
|
||||
this.Gametype = gametype;
|
||||
this.IP = ip.Value is "localhost" or "0.0.0.0" ? ServerConfig.IPAddress : ip.Value ?? ServerConfig.IPAddress;
|
||||
this.GamePassword = gamePassword.Value;
|
||||
Hostname = hostname;
|
||||
MaxClients = maxplayers;
|
||||
FSGame = game.Value;
|
||||
Gametype = gametype;
|
||||
IP = ip.Value is "localhost" or "0.0.0.0" ? ServerConfig.IPAddress : ip.Value ?? ServerConfig.IPAddress;
|
||||
GamePassword = gamePassword.Value;
|
||||
PrivateClientSlots = privateClients.Value;
|
||||
|
||||
UpdateMap(mapname);
|
||||
|
||||
if (RconParser.CanGenerateLogPath && string.IsNullOrEmpty(ServerConfig.ManualLogPath))
|
||||
|
@ -14,6 +14,7 @@ namespace SharedLibraryCore.Dtos
|
||||
public string GameType { get; set; }
|
||||
public int ClientCount { get; set; }
|
||||
public int MaxClients { get; set; }
|
||||
public int PrivateClientSlots { get; set; }
|
||||
public List<ChatInfo> ChatHistory { get; set; }
|
||||
public List<PlayerInfo> Players { get; set; }
|
||||
public List<Report> Reports { get; set; }
|
||||
|
@ -73,6 +73,11 @@ namespace SharedLibraryCore.Interfaces
|
||||
/// </summary>
|
||||
string GamePassword { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of private client slots
|
||||
/// </summary>
|
||||
int PrivateClientSlots { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Current map the game server is running
|
||||
/// </summary>
|
||||
|
@ -123,6 +123,7 @@ namespace SharedLibraryCore
|
||||
?.FirstOrDefault(gt => gt.Name == Gametype)?.Alias ?? Gametype;
|
||||
|
||||
public string GamePassword { get; protected set; }
|
||||
public int PrivateClientSlots { get; protected set; }
|
||||
public Map CurrentMap { get; set; }
|
||||
public Map Map => CurrentMap;
|
||||
|
||||
|
@ -38,6 +38,7 @@ namespace WebfrontCore.Controllers
|
||||
Game = (Reference.Game)matchingServer.GameName,
|
||||
ClientCount = matchingServer.ClientNum,
|
||||
MaxClients = matchingServer.MaxClients,
|
||||
PrivateClientSlots = matchingServer.PrivateClientSlots,
|
||||
GameType = matchingServer.GametypeName,
|
||||
Players = matchingServer.GetClientsAsList()
|
||||
.Select(client => new PlayerInfo
|
||||
|
@ -74,6 +74,7 @@ namespace WebfrontCore.ViewComponents
|
||||
Game = (Reference.Game)server.GameName,
|
||||
ClientCount = server.ClientNum,
|
||||
MaxClients = server.MaxClients,
|
||||
PrivateClientSlots = server.PrivateClientSlots,
|
||||
GameType = server.GametypeName,
|
||||
ClientHistory = new ClientHistoryInfo
|
||||
{
|
||||
|
@ -65,7 +65,7 @@
|
||||
</div>
|
||||
}
|
||||
<div class="mr-5 ml-5 align-self-center">
|
||||
<span class="server-clientcount">@Model.ClientCount</span>/<span class="server-maxclients">@Model.MaxClients</span>
|
||||
<span class="server-clientcount">@Model.ClientCount</span>/<span class="server-maxclients">@(Model.MaxClients - Model.PrivateClientSlots)@(Model.PrivateClientSlots > 0 ? $" ({Model.MaxClients})": "")</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user