mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-06-09 10:06:34 +02:00
Send server URL on hasJoined (#6416)
* Send server URL when advertising * Fix --------- Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
This commit is contained in:
@@ -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<string?> GuessAddress()
|
||||
private async Task<string> GuessAddress()
|
||||
{
|
||||
DebugTools.AssertNotNull(_httpClient);
|
||||
|
||||
|
||||
@@ -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<HasJoinedResponse>(url);
|
||||
|
||||
if (joinedRespJson is not {IsValid: true})
|
||||
|
||||
Reference in New Issue
Block a user