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:
+3
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user