8000 feat: Deprecate IGameNetwork by KazWolfe · Pull Request #2241 · goatcorp/Dalamud · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Deprecate IGameNetwork #2241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KazWolfe
Copy link
Member
@KazWolfe 8000 KazWolfe commented Apr 8, 2025

This PR is a proposal to remove the IGameNetwork service from Dalamud. With changes in Patch 7.2 (namely, additional packet obfuscation), this service no longer really provides useful data in some cases. In general, Dalamud has encouraged developers move away from opcode management in favor of hook(s) in the appropriate locations, and this solidifies that decision.

This service may still be used by certain plugins. As such, we are seeking input from relevant community members who may still have some use for these APIs about the deprecation path here.

Identified Uses:

At this time, the internal service is not planned to be deprecated, as it's still used for the debug window. This feature is still deemed beneficial as it can be used to identify whether something does (or doesn't) send a network request.

@KazWolfe KazWolfe added question Further information is requested plugin-api About or affects the Plugin API needs api bump Held for the next API bump labels Apr 8, 2025
@KazWolfe KazWolfe requested a review from a team as a code owner April 8, 2025 18:36
Co-authored-by: Haselnussbomber <mail@haselnussbomber.de>
@KazWolfe KazWolfe force-pushed the remove-igamenetwork branch from 2c3423c to 968fc24 Compare April 8, 2025 18:42
@KazWolfe KazWolfe added this to the Dalamud API 13 (Patch 7.3) milestone Apr 8, 2025
@KazWolfe
Copy link
Member Author
KazWolfe commented Apr 8, 2025

In response to a Discord comment:

If we can actually provide a hook that outputs good, deobfuscated packets that might be valuable [...]

I'm of the opinion that there's no longer any valid use case for this service. Even were we to move the hooks to provide deobfuscated information, there's very little value to providing such an API surface.

There is a possibility that it may still be beneficial to have a singular hook interacting with the relevant function(s), but in practice this seems minimal at best. Nearly every plugin that would use this service can be better served hooking elsewhere, leaving the general-purpose methods untouched.

While the singular-hook argument also means that events can be managed in a cleaner fashion and we can prevent plugins from bringing down the entire stack, it's still ultimately a plugin developer's responsibility to test their code and make sure things don't crash. This method already passed a nint to game data directly, meaning plugins that wanted to tamper with things already had that ability - multiple hooks doesn't really change this too much.

@rekyuu
Copy link
rekyuu commented Apr 8, 2025

I only really use IGameNetwork for PvP countdown and completion events, so it wouldn't be a huge loss but it would be a bit sad. Not sure if those events could be re-implemented somehow.

https://github.com/rekyuu/StanleyParableXiv/blob/main/StanleyParableXiv/Events/PvpEvent.cs#L334

PingPlugin and DeepDungeonTracker are obviously way more important though.

I agree that moving these sorts of things to an actual API would be much better and it would make things like this less confusing to read. I worry that it would also mean that there will prob be a lot of very minute, specific cases that someone might want implemented in the API, but would have to wait behind a PR/Dalamud update. Maybe that's not a bad thing, but it makes "should this specific packet be implemented into Dalamud" a possibly subjective thing.

EDIT: I am now caught up on Discord and am now aware that PacketDispatcher.OnReceivePacket exists, so this doesn't seem like that big of a deal at all.

@Critical-Impact
Copy link
Contributor

Anything currently using the network could track down one of the functions further the call tree from ProcessZonePacketDown using IDA/Ghidra and hook that instead. You've still gotta decode the network packets depending on how far down you go but there's definitely alternatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs api bump Held for the next API bump plugin-api About or affects the Plugin API question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0