Removes max players

This commit is contained in:
Kamron Batman 2026-03-31 00:44:09 -07:00
parent e2dce0ded6
commit f98d58beea
No known key found for this signature in database
GPG key ID: 7D81DF26D9A5D94A
3 changed files with 2 additions and 5 deletions

View file

@ -132,7 +132,7 @@ public static class GatewayClient
// --- SignalR methods --- // --- SignalR methods ---
public static Task SendHeartbeatAsync(HeartbeatRequest data) => public static Task SendHeartbeatAsync(HeartbeatRequest data) =>
_hubConnection?.InvokeAsync("Heartbeat", new { data.PlayerCount, data.MaxPlayers, data.IsOnline }) _hubConnection?.InvokeAsync("Heartbeat", new { data.PlayerCount, data.IsOnline })
?? Task.CompletedTask; ?? Task.CompletedTask;
public static Task SyncAccountStateAsync(string username, string accessLevel, bool isBanned) public static Task SyncAccountStateAsync(string username, string accessLevel, bool isBanned)
@ -178,7 +178,6 @@ public static class GatewayClient
public record HeartbeatRequest( public record HeartbeatRequest(
[property: JsonPropertyName("playerCount")] int PlayerCount, [property: JsonPropertyName("playerCount")] int PlayerCount,
[property: JsonPropertyName("maxPlayers")] int MaxPlayers,
[property: JsonPropertyName("isOnline")] bool IsOnline [property: JsonPropertyName("isOnline")] bool IsOnline
); );

View file

@ -17,7 +17,6 @@ public static class GatewayConfig
public static string GatewayUrl { get; private set; } = ""; public static string GatewayUrl { get; private set; } = "";
public static string ApiKey { get; private set; } = ""; public static string ApiKey { get; private set; } = "";
public static int HeartbeatIntervalSeconds { get; private set; } public static int HeartbeatIntervalSeconds { get; private set; }
public static int MaxPlayers { get; private set; }
public static void Configure() public static void Configure()
{ {
@ -31,7 +30,6 @@ public static class GatewayConfig
GatewayUrl = ServerConfiguration.GetOrUpdateSetting("gateway.url", "http://localhost:5000"); GatewayUrl = ServerConfiguration.GetOrUpdateSetting("gateway.url", "http://localhost:5000");
ApiKey = ServerConfiguration.GetOrUpdateSetting("gateway.apiKey", ""); ApiKey = ServerConfiguration.GetOrUpdateSetting("gateway.apiKey", "");
HeartbeatIntervalSeconds = ServerConfiguration.GetOrUpdateSetting("gateway.heartbeatIntervalSeconds", 30); HeartbeatIntervalSeconds = ServerConfiguration.GetOrUpdateSetting("gateway.heartbeatIntervalSeconds", 30);
MaxPlayers = ServerConfiguration.GetOrUpdateSetting("gateway.maxPlayers", 200);
if (string.IsNullOrWhiteSpace(ApiKey)) if (string.IsNullOrWhiteSpace(ApiKey))
{ {

View file

@ -53,7 +53,7 @@ public static class GatewayHeartbeat
try try
{ {
var playerCount = NetState.Instances.Count; var playerCount = NetState.Instances.Count;
var request = new GatewayClient.HeartbeatRequest(playerCount, GatewayConfig.MaxPlayers, true); var request = new GatewayClient.HeartbeatRequest(playerCount, true);
if (GatewayClient.IsSignalRConnected) if (GatewayClient.IsSignalRConnected)
{ {