Commit graph

12 commits

Author SHA1 Message Date
goat
913d4732b5 don't write to the manifest when reloading dev plugins(fixes #1328)
genericizes the way WorkingPluginId is accessed away from the manifest, since we probably don't want to have it there in the future for regular plugins either
2024-05-14 00:27:11 +02:00
goat
448b0d16ea
Add "loading dialog" for service init, unify blocking logic (#1779)
* wip

* hacky fix for overlapping event text in profiler

* move IsResumeGameAfterPluginLoad logic to PluginManager

* fix some warnings

* handle exceptions properly

* remove ability to cancel, rename button to "hide" instead

* undo Dalamud.Service refactor for now

* warnings

* add explainer, show which plugins are still loading

* add some text if loading takes more than 3 minutes

* undo wrong CS merge
2024-04-21 17:28:37 +02:00
srkizer
87b9edb448
Add IInternal/PublicDisposableService (#1696)
* Add IInternal/PublicDisposableService

Plugins are exposed interfaces that are not inherited from
`IDisposable`, but services implementing plugin interfaces often
implement `IDisposable`. Some plugins may try to call
`IDisposable.Dispose` on everything provided, and it also is possible to
use `using` clause too eagerly while working on Dalamud itself, such as
writing `using var smth = await Service<SomeService>.GetAsync();`. Such
behaviors often lead to a difficult-to-debug errors, and making those
services either not an `IDisposable` or making `IDisposable.Dispose` do
nothing if the object has been loaded would prevent such errors. As
`ServiceManager` must be the only class dealing with construction and
disposal of services, `IInternalDisposableService` has been added to
limit who can dispose the object. `IPublicDisposableService` also has
been added to classes that can be constructed and accessed directly by
plugins; for those, `Dispose` will be ignored if the instance is a
service instance, and only `DisposeService` will respond.

In addition, `DalamudPluginInterface` and `UiBuilder` also have been
changed so that their `IDisposable.Dispose` no longer respond, and
instead, internal functions have been added to only allow disposal from
Dalamud.

* Cleanup

* Postmerge fixes

* More explanation on RunOnFrameworkThread(ClearHooks)

* Mark ReliableFileStorage public ctor obsolete

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-03-16 15:58:05 +00:00
srkizer
88a8d45798
Accommodate nested AddonLifecycle event calls (#1698)
* Accommodate nested AddonLifecycle event calls

The game is free to call event handlers of another addon from one addon,
but the previous code was written under the assumption that only one
function may be called at a time. This changes the recycled addon args
into pooled args.

* Always clear addon name cache
2024-03-07 17:47:11 -08:00
MidoriKami
02b1f6e426
[AddonEventManager] Actually Ensure Thread Safety (#1589)
* Actually make AddonEventManager thread safe

* Ensure AddonEventHandlers are also thread safe

Additionally, use Guid instead of strings

* Make DalamudInternalKey readonly

* Properly use ConcurrentDict features

Fixes GUID not working
2023-12-31 14:30:21 -08:00
MidoriKami
df1cdff1a5
AddonEventManager fix thread safety (#1576)
Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2023-12-16 21:01:40 +01:00
srkizer
a0f4baf8fa
Less footguns in service dependency handling (#1560) 2023-12-06 21:29:46 -08:00
srkizer
b66be84b93
Better Service dependency handling (#1535) 2023-11-28 22:20:16 +01:00
MidoriKami
9a8f370975
Update AddonEventType (#1516) 2023-11-10 21:03:54 +01:00
goat
db5b9d1b83
fix: BaseAddressResolver should take a ISigScanner instead 2023-10-05 23:15:34 +02:00
goat
ebabb7bd04
chore: make SigScanner public, have separate service TargetSigScanner that resolves via ISigScanner (closes #1426) 2023-09-24 01:49:34 +02:00
goat
c767971a36
move around new Addon services a bit to match folder structure 2023-09-23 13:09:43 +02:00