Skip to content

Commit

Permalink
first pass on v9 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
goaaats authored Sep 17, 2023
1 parent fd45869 commit 8a905f7
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion docs/versions/v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,44 @@ living document of the major changes for developers in v9.
- **.NET Version:** .NET 7.0
- .NET 8 is due for official release in November 2023. Due to release timing,
we will be targeting .NET 7.0 for v9, and will upgrade to .NET 8 in a future
release.
release, when we can confirm that it is stable on all platforms.

## New Features
* A new plugin-specific logging class has been added that you can receive as a service instance via the `IPluginLog` type.
* Static functions in `PluginLog` have been deprecated, and we recommend that you move to the new service. They were slow and unreliable, due to having to look up the calling plugin via reflection, and won’t support new filtering features.
If you wish to set up your own logging framework, you can request a Serilog sink specific to your plugin via OOO

## Major Changes
### General
* All services must be used via interfaces, their implementations are now private.
* This allows us to create per-plugin implementations of services, which will be able to safely dispose of plugin-specific resources, and opens up the possibility of creating mocks that allow for testing outside of the game
* To migrate, you only have to change the type used to the interface equivalent in the `Dalamud.Plugin.Services` namespace(e.g. `DataManager` => `IDataManager`)
* `IDataManager.ClientOpcodes` and `IDataManager.ServerOpcodes` have been removed. Dalamud systems that use opcodes directly will now use hooks instead. We recommend any plugin that has been using these opcodes to switch to hooks.

### UI and ImGui
* Texture- and Icon-related functions on DataManager have been removed and are now available in a new service, `ITextureProvider`.
* API has been simplified in a major way and now properly supports high-resolution textures
* Icons and textures are now only loaded once globally when requesting them using this service, reducing memory usage
* Icons and textures are now automatically unloaded if not drawn for more than 2 seconds, and will be reloaded transparently if they are accessed again by your plugin
* An API that allows plugins to replace paths to tex files has been added. This means that you no longer manually have to implement this functionality to make your plugin compatible with e.g. UI mods.
* ITextureProvider is designed for ImGui specific use cases. Plugins that need to work with raw tex files should implement their own logic.
* IDisposable ImGui-helpers have been moved to the main Dalamud assembly and are now accessible via the `Dalamud.Interface.Utility` namespace
* We recommend using these for **any new UI**, as they are much safer and reduce the chance of crashes caused by misbehaving UI code

### Hooking
* Obsolete constructors for `Hook<T>` and the static `Hook<T>.FromX()` functions have been removed.
* Please use the equivalent functions in the `IHookProvider` service
* `IHookProvider.FromSignature()` has been added
* `SignatureHelper.Initialize()` has been removed. Please use `IHookProvider.InitializeFromAttributes()`.

## Minor Changes
* `Util.HttpClient` has been removed in favor of allowing plugins to manage their own HTTP lifecycles.
* You can use `Dalamud.Networking.Http` as your `SocketsHttpHandler.ConnectCallback` to enable improved IPv6 connection handling to dual-stack servers.
* `SeStringManager` has been removed. Please use `SeStringBuilder` instead.
* `Util.CopyTo()` has been removed, as it has been added to the standard library as `Stream.CopyTo()`.
* `DalamudPluginInterface.PluginNames` and `PluginInternalNames` have been replaced in favor of `InstalledPlugins`, which provides more context.
* Obsolete/non-functional icons in `FontAwesomeIcon` have been removed.
* `DataManager.IsDataReady` has been removed, as it is always true when plugins are loaded.
* `SeStringBuilder.AddItemLink()` now correctly adds a full item link, instead of only adding an `ItemPayload`.
* `Util.IsLinux()` has been changed to `Util.IsWine()`. `Util.GetHostPlatform()` has been added to get the actual platform the game is running on - this relies on a special env var that may not be present on all environments Dalamud can run under yet.
* The Serilog property `SourceContext` is no longer used for Dalamud systems. Plugins implementing their own logging systems should write their plugin internal name to the `Dalamud.PluginName` property instead, otherwise, **filtering in the new console will not work**.

0 comments on commit 8a905f7

Please sign in to comment.