fix mods not applying race condition, fix service settings empty maybe
This commit is contained in:
@@ -23,6 +23,7 @@ public class ServerConfigurationManager
|
||||
_serverTagConfig = serverTagConfig;
|
||||
_notesConfig = notesConfig;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
EnsureMainExists();
|
||||
}
|
||||
|
||||
public string CurrentApiUrl => CurrentServer.ServerUri;
|
||||
@@ -96,11 +97,7 @@ public class ServerConfigurationManager
|
||||
catch
|
||||
{
|
||||
_configService.Current.CurrentServer = 0;
|
||||
if (!string.Equals(_configService.Current.ServerStorage[0].ServerUri, ApiController.MainServer, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_configService.Current.ServerStorage.Insert(0, new ServerStorage() { ServerUri = ApiController.MainServiceUri, ServerName = ApiController.MainServer });
|
||||
}
|
||||
Save();
|
||||
EnsureMainExists();
|
||||
return CurrentServer!;
|
||||
}
|
||||
}
|
||||
@@ -341,6 +338,15 @@ public class ServerConfigurationManager
|
||||
return _serverTagConfig.Current.ServerTagStorage[CurrentApiUrl];
|
||||
}
|
||||
|
||||
private void EnsureMainExists()
|
||||
{
|
||||
if (_configService.Current.ServerStorage.Count == 0 || !string.Equals(_configService.Current.ServerStorage[0].ServerUri, ApiController.MainServiceUri, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_configService.Current.ServerStorage.Insert(0, new ServerStorage() { ServerUri = ApiController.MainServiceUri, ServerName = ApiController.MainServer });
|
||||
}
|
||||
Save();
|
||||
}
|
||||
|
||||
private void TryCreateCurrentNotesStorage()
|
||||
{
|
||||
if (!_notesConfig.Current.ServerNotes.ContainsKey(CurrentApiUrl))
|
||||
|
||||
Reference in New Issue
Block a user