Add default api url
This commit is contained in:
@@ -24,6 +24,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||||||
{
|
{
|
||||||
public const string LoporritServer = "Loporrit Main Server";
|
public const string LoporritServer = "Loporrit Main Server";
|
||||||
public const string LoporritServiceUri = "wss://lop-sync.com";
|
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";
|
public const string LoporritServiceHubUri = "wss://hub.lop-sync.com/mare";
|
||||||
|
|
||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ public class HubFactory : MediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
var mainServerConfig = await _remoteConfig.GetConfigAsync<HubConnectionConfig>("mainServer").ConfigureAwait(false) ?? new();
|
var mainServerConfig = await _remoteConfig.GetConfigAsync<HubConnectionConfig>("mainServer").ConfigureAwait(false) ?? new();
|
||||||
defaultConfig = mainServerConfig;
|
defaultConfig = mainServerConfig;
|
||||||
|
if (string.IsNullOrEmpty(mainServerConfig.ApiUrl))
|
||||||
|
defaultConfig.ApiUrl = ApiController.LoporritServiceApiUri;
|
||||||
if (string.IsNullOrEmpty(mainServerConfig.HubUrl))
|
if (string.IsNullOrEmpty(mainServerConfig.HubUrl))
|
||||||
defaultConfig.HubUrl = ApiController.LoporritServiceHubUri;
|
defaultConfig.HubUrl = ApiController.LoporritServiceHubUri;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
|
|||||||
var config = await _remoteConfig.GetConfigAsync<HubConnectionConfig>("mainServer").ConfigureAwait(false) ?? new();
|
var config = await _remoteConfig.GetConfigAsync<HubConnectionConfig>("mainServer").ConfigureAwait(false) ?? new();
|
||||||
if (!string.IsNullOrEmpty(config.ApiUrl))
|
if (!string.IsNullOrEmpty(config.ApiUrl))
|
||||||
authApiUrl = config.ApiUrl;
|
authApiUrl = config.ApiUrl;
|
||||||
|
else
|
||||||
|
authApiUrl = ApiController.LoporritServiceApiUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user