Commit graph

52 commits

Author SHA1 Message Date
Soreepeong
7f5ef03917 Use EarlyLoadedService for anything that is not mandatory for kicking off plugin loader 2024-04-07 21:53:23 +09:00
github-actions[bot]
fe80490d5e Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-19 15:04:46 +00:00
srkizer
be63276a85
Rename to Framework.Run (#1728) 2024-03-19 08:04:21 -07:00
github-actions[bot]
990f04715f Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-19 03:11:08 +00:00
srkizer
5d473919a1
Hide scheduler from RunOnFrameworkThread (#1725)
* Hide scheduler from RunOnFrameworkThread

Creating new tasks via Task.Run and alike would fetch the current
scheduler, which we do not want in case of running stuff from the
framework thread. Change is to prevent the standard library from seeing
the "current scheduler". If one wants to use `await` with an async
function to be run in the framework thread, one can use
`RunOnFrameworkThreadAwaitable` instead now.

* TaskSchedulerWidget: test better stuff

* TaskSchedulerWidget: add freeze tests

* More comments

* Make TaskFactory a getter method instead of property to avoid bad suggestions

* Why are there stuff still not pushed
2024-03-18 20:10:47 -07:00
github-actions[bot]
4abb3535fa Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-16 16:02:57 +00: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
710fff118d
Remove unnecessary stuff from ObjectTable (#1713)
* Remove unnecessary stuff from ObjectTable

* Remove unused

* fix
2024-03-14 14:37:52 -07:00
github-actions[bot]
458e48c088 Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-14 04:35:37 +00:00
srkizer
a26bb58fdb
Use custom TaskScheduler for Framework.RunOnTick (#1597)
* Use custom TaskScheduler for Framework.RunOnTick

* TaskSchedulerWidget: add example
2024-03-14 00:36:38 +01:00
rootdarkarchon
31227016c1
Add Object Table Cache (#1708)
Proposed improvement to object table access speeds; prevents creating objects for every plugin iterating the object table.

---------

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
Co-authored-by: Soreepeong <soreepeong@gmail.com>
2024-03-13 14:13:29 -07:00
srkizer
a0f4baf8fa
Less footguns in service dependency handling (#1560) 2023-12-06 21:29:46 -08:00
MidoriKami
28804b905e
Fix Framework Stat Tracking (#1506) 2023-10-29 14:01:48 +01:00
MidoriKami
e12ec0ceff
Add FrameworkPluginScoped (#1442)
Co-authored-by: KazWolfe <KazWolfe@users.noreply.github.com>
2023-10-21 18:06:02 -07: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
5809cf5d7c
chore: make all services with interfaces internal 2023-09-17 21:09:00 +02:00
MidoriKami
385c4b7a8b
Add IFramework (#1286) 2023-09-10 13:19:44 -07:00
goat
166301f56f
fix warnings in Dalamud 2023-06-09 23:38:13 +02:00
goat
9ff7eb801f
feat: add GameLifecycle service 2023-03-27 19:43:29 +02:00
goat
01efbf358a
fix: wait for services to unload in framework destroy 2023-03-09 11:45:24 +01:00
goat
f032adb155
fix: correctly use dependency order to unload, declare all plugin services as deps to PM 2023-03-08 22:51:04 +01:00
kalilistic
ce48477fb4 feat: add hitch config 2023-02-27 21:05:11 -05:00
goat
7ffd196c2e
chore: adjust minimum times for hitch detection a bit 2023-02-18 23:36:25 +01:00
goat
44dc127101
feat: detect hitches in framework update, draw and gamenetwork 2023-02-17 21:02:49 +01:00
goat
9c16359914
feat: batch config saves 2022-11-01 19:44:57 +01:00
goat
987ff8dc8f
chore: convert Dalamud to file-scoped namespaces 2022-10-29 15:23:22 +02:00
goat
b093323acc
chore: warnings pass 2022-10-29 15:19:52 +02:00
Soreepeong
92416e45da fix RunOnFrameworkThread/RunOnNextTick race condition 2022-09-19 14:29:42 +09:00
Stanley Dimant
2317d28b39 naming adjustments 2022-09-01 21:40:23 +02:00
Stanley Dimant
652b357341 add exception handling for some event delegates 2022-09-01 21:25:20 +02:00
kizer
716736f022
Improvements (#903) 2022-06-29 11:51:40 +02:00
kizer
3369f569fb
Add call-on-services-ready attribute for service methods, and fix scene nullability (#900) 2022-06-26 18:49:34 +02:00
kizer
8e7f370ddd
Load services asynchronously whenever possible (#893) 2022-06-24 22:12:51 +02:00
goaaats
2febdd2124
chore: rename Framework destroy => free for accuracy 2022-06-20 22:10:46 +02:00
goaaats
3397b608d0
feat: switch framework hooks from vtable to sigs 2022-06-20 22:08:50 +02:00
goaaats
b1d927ab8f
chore: fix some warnings 2022-05-12 11:00:31 +02:00
kizer
9413755ee3
Add Service<Framework>.RunOnTick() (#832) 2022-05-12 10:36:05 +02:00
goaaats
2d90598b70
refactor: make all PluginInterface classes explicitly disposable 2022-01-08 03:00:56 +01:00
goat
1561fbac00
Revert "refactor(Dalamud): switch to file-scoped namespaces"
This reverts commit b5f34c3199.
2021-11-18 15:23:40 +01:00
goat
b5f34c3199
refactor(Dalamud): switch to file-scoped namespaces 2021-11-17 19:42:32 +01:00
goaaats
c06a29a2d4
feat: actually fail in Framework if tier load fails, remove DALAMUD_NOT_HAVE_INTERFACE 2021-11-07 16:39:40 +01:00
goat
a4629447d6
fix: no hard error when tier 3 load isn't detected 2021-10-25 16:27:40 +02:00
goaaats
a819c72913
feat: show error message if tier 3 load never happened 2021-10-20 22:39:13 +02:00
goat
fcf7140293
fix: revert d3d11 GShade workaround, not reliable 2021-10-10 19:27:41 +02:00
Raymond
01c0e21440 use stopwatch for more precise delta 2021-09-07 22:47:23 -04:00
Raymond
8ed050e41f Fix usage 2021-09-07 22:18:17 -04:00
Raymond
d7b2d92552 formatting 2021-09-07 21:56:59 -04:00
Raymond
7768a9c1d9 feat: expose framework timing 2021-09-07 21:56:52 -04:00
Raymond
2b4f4bc9fd Change Framework.OnUpdateEvent to Update 2021-08-23 17:32:45 -04:00
Raymond
ac1a7cf806 Register the LibcFunction service 2021-08-21 16:01:45 -04:00