feat: enable early loaded services to wait for provided services, some rewrites to make service kind declaration more explicit

This commit is contained in:
goat 2023-10-01 21:12:27 +02:00
parent 0690f5dd2a
commit 2bdb837577
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
4 changed files with 37 additions and 26 deletions

View file

@ -74,14 +74,17 @@ internal sealed class Dalamud : IServiceType
if (!configuration.IsResumeGameAfterPluginLoad)
{
NativeFunctions.SetEvent(mainThreadContinueEvent);
try
{
_ = ServiceManager.InitializeEarlyLoadableServices();
}
catch (Exception e)
{
Log.Error(e, "Service initialization failure");
}
ServiceManager.InitializeEarlyLoadableServices()
.ContinueWith(t =>
{
if (t.IsCompletedSuccessfully)
return;
Log.Error(t.Exception!, "Service initialization failure");
Util.Fatal(
"Dalamud failed to load all necessary services.\n\nThe game will continue, but you may not be able to use plugins.",
"Dalamud", false);
});
}
else
{