mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-13 12:44:14 +01:00
fix mods not applying race condition, fix service settings empty maybe
This commit is contained in:
parent
a272f7819f
commit
4ef2054995
3 changed files with 50 additions and 28 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue