diff --git a/SS14.ServerHub/Controllers/ServerListController.cs b/SS14.ServerHub/Controllers/ServerListController.cs index cb8eb67..a2cf1c4 100644 --- a/SS14.ServerHub/Controllers/ServerListController.cs +++ b/SS14.ServerHub/Controllers/ServerListController.cs @@ -94,7 +94,7 @@ public async Task Advertise([FromBody] ServerAdvertise advertise) if (!Uri.TryCreate(advertise.Address, UriKind.Absolute, out var parsedAddress) || string.IsNullOrWhiteSpace(parsedAddress.Host) || parsedAddress.Scheme is not (Ss14UriHelper.SchemeSs14 or Ss14UriHelper.SchemeSs14s)) - return BadRequest("Invalid SS14 URI"); + return BadRequest("Invalid SS14 URI. Ensure your hub.server_url starts with ss14:// or ss14s:// and that the address is valid."); // Ban check. switch (await CheckAddressBannedAsync(parsedAddress)) @@ -112,7 +112,7 @@ parsedAddress.Scheme is not (Ss14UriHelper.SchemeSs14 or Ss14UriHelper.SchemeSs1 Debug.Assert(statusJson != null); Debug.Assert(infoJson != null); - switch (await CheckInfoBannedAsync(parsedAddress, statusJson, infoJson!)) + switch (await CheckInfoBannedAsync(parsedAddress, statusJson, infoJson)) { case BanCheckResult.Banned: return Unauthorized("Your server has been blocked from advertising on the hub. If you believe this to be in error, please contact us."); @@ -214,8 +214,8 @@ parsedAddress.Scheme is not (Ss14UriHelper.SchemeSs14 or Ss14UriHelper.SchemeSs1 } catch (Exception e) { - _logger.LogInformation(e, "Failed to connect to advertising server"); - return (UnprocessableEntity("Unable to contact status address"), null, null); + _logger.LogInformation(e, $"Failed to connect to advertising server: {uri}"); + return (UnprocessableEntity("Unable to contact status address, ensure your firewall/port forwarding configuration allows traffic from the internet and double check your config."), null, null); } } @@ -314,4 +314,4 @@ public override void Write(Utf8JsonWriter writer, RawJson value, JsonSerializerO writer.WriteRawValue(value.Json, skipInputValidation: true); } } -} \ No newline at end of file +}