Own server tags in the web panel (Settings) and server.json

Tags (max. 6, normalized like the keymaster) are sent with the heartbeat;
official and featured are only given by the MSCO admins and are refused with
a note. MSCO_TAGS environment variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 21:20:06 +02:00
co-authored by Claude Opus 5.5
parent 1ab9a01efb
commit e523e5e17b
6 changed files with 63 additions and 4 deletions
+3 -2
View File
@@ -22,7 +22,7 @@ public sealed class MasterClient
public bool Unreachable { get; init; }
}
record HeartbeatBody(string Key, string Name, string Description, string Address, int Port, int Players, int MaxPlayers,
string Version, bool Public, bool RequireSteam);
string Version, bool Public, bool RequireSteam, List<string> Tags);
readonly HttpClient http = new() { Timeout = TimeSpan.FromSeconds(10) };
readonly string baseUrl;
@@ -72,7 +72,8 @@ public sealed class MasterClient
try
{
var body = new HeartbeatBody(config.LicenseKey, config.Name, config.Description, config.PublicAddress, config.Port,
players, config.MaxPlayers, version, config.Public, config.RequireSteam);
players, config.MaxPlayers, version, config.Public, config.RequireSteam,
ServerConfig.NormalizeTags(config.Tags, out _));
var response = await http.PostAsJsonAsync(baseUrl + "/api/servers/heartbeat", body);
int status = (int)response.StatusCode;
if (!response.IsSuccessStatusCode) return new HeartbeatResult(status, null, false, null, 0);