Removes max players
This commit is contained in:
parent
e2dce0ded6
commit
f98d58beea
3 changed files with 2 additions and 5 deletions
|
|
@ -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
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue