From ea3bae1b240f599d639522a9a9faed8a83151987 Mon Sep 17 00:00:00 2001 From: Myra Date: Fri, 8 May 2026 13:13:49 +0200 Subject: [PATCH] Send server URL on hasJoined (#6416) * Send server URL when advertising * Fix --------- Co-authored-by: PJB3005 --- Robust.Server/ServerHub/HubManager.cs | 3 ++- Robust.Shared/Network/NetManager.ServerAuth.cs | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Robust.Server/ServerHub/HubManager.cs b/Robust.Server/ServerHub/HubManager.cs index 68338d98cf..ab4a615a28 100644 --- a/Robust.Server/ServerHub/HubManager.cs +++ b/Robust.Server/ServerHub/HubManager.cs @@ -52,6 +52,7 @@ internal sealed partial class HubManager try { url = await GuessAddress(); + _cfg.SetCVar(CVars.HubServerUrl, url); } catch (Exception e) { @@ -139,7 +140,7 @@ internal sealed partial class HubManager } } - private async Task GuessAddress() + private async Task GuessAddress() { DebugTools.AssertNotNull(_httpClient); diff --git a/Robust.Shared/Network/NetManager.ServerAuth.cs b/Robust.Shared/Network/NetManager.ServerAuth.cs index 12b40a8060..f11458d669 100644 --- a/Robust.Shared/Network/NetManager.ServerAuth.cs +++ b/Robust.Shared/Network/NetManager.ServerAuth.cs @@ -140,7 +140,12 @@ namespace Robust.Shared.Network var authHashBytes = MakeAuthHash(sharedSecret, CryptoPublicKey!); var authHash = Base64Helpers.ConvertToBase64Url(authHashBytes); - var url = $"{authServer}api/session/hasJoined?hash={authHash}&userId={msgEncResponse.UserId}"; + var url = $"{authServer}api/session/hasJoined" + + $"?hash={authHash}&" + + $"userId={msgEncResponse.UserId}"; + var serverUrl = _config.GetCVar(CVars.HubServerUrl); + if (!string.IsNullOrWhiteSpace(serverUrl)) + url += $"&serverUrl={Uri.EscapeDataString(serverUrl)}"; var joinedRespJson = await _http.Client.GetFromJsonAsync(url); if (joinedRespJson is not {IsValid: true})