Add default api url

This commit is contained in:
Loporrit
2025-08-05 08:29:51 +00:00
parent b773443b68
commit 9d9ec9cafc
3 changed files with 5 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
{
public const string LoporritServer = "Loporrit Main Server";
public const string LoporritServiceUri = "wss://lop-sync.com";
public const string LoporritServiceApiUri = "wss://hub.lop-sync.com/";
public const string LoporritServiceHubUri = "wss://hub.lop-sync.com/mare";
private readonly DalamudUtilService _dalamudUtil;

View File

@@ -91,6 +91,8 @@ public class HubFactory : MediatorSubscriberBase
{
var mainServerConfig = await _remoteConfig.GetConfigAsync<HubConnectionConfig>("mainServer").ConfigureAwait(false) ?? new();
defaultConfig = mainServerConfig;
if (string.IsNullOrEmpty(mainServerConfig.ApiUrl))
defaultConfig.ApiUrl = ApiController.LoporritServiceApiUri;
if (string.IsNullOrEmpty(mainServerConfig.HubUrl))
defaultConfig.HubUrl = ApiController.LoporritServiceHubUri;
}

View File

@@ -79,6 +79,8 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
var config = await _remoteConfig.GetConfigAsync<HubConnectionConfig>("mainServer").ConfigureAwait(false) ?? new();
if (!string.IsNullOrEmpty(config.ApiUrl))
authApiUrl = config.ApiUrl;
else
authApiUrl = ApiController.LoporritServiceApiUri;
}
try