Skip to content

Use Global structs for TC packets#535

Merged
valarnin merged 4 commits into
OverlayPlugin:mainfrom
MilkVio:main
May 7, 2026
Merged

Use Global structs for TC packets#535
valarnin merged 4 commits into
OverlayPlugin:mainfrom
MilkVio:main

Conversation

@MilkVio

@MilkVio MilkVio commented May 5, 2026

Copy link
Copy Markdown

Summary

Fix Traditional Chinese packet parsing by using Global packet structures with TC opcodes.

FFXIV_ACT_Plugin currently handles Traditional Chinese packets through Global packet handlers at runtime. As a result, the effective runtime model is:

  • Global packet handlers
  • Global packet structures
  • TraditionalChinese opcodes

Previously, MachinaPacketHelper.cs attempted to resolve a dedicated TC packet type first:

MachinaMap.GetPacketType(GameRegion.TraditionalChinese, packetTypeName, out var tcPacketType)

When a TC-specific Machina structure exists, this can cause the helper to use the TC structure instead of the Global one. Since this does not match the packet structures used by FFXIV_ACT_Plugin at runtime, it can lead to parsing mismatches.

Change

Use the Global packet type for TC packet structure resolution:

var tcPacketType = globalPacketType;

The TC opcode values are still used as before.

Testing

Tested this change on the Traditional Chinese client. Several logs that previously failed to display now work correctly.

For example,107 logs are displayed correctly after this change.

Notes

This change is intended to match the current runtime behavior of FFXIV_ACT_Plugin.

If FFXIV_ACT_Plugin later switches TC runtime handling to dedicated TC packet handlers and packet structures, this logic can be restored to use:

MachinaMap.GetPacketType(GameRegion.TraditionalChinese, ...)

@ShadyWhite ShadyWhite requested a review from valarnin May 7, 2026 04:07

@valarnin valarnin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see an open PR (ravahn/machina#38) to address some of this upstream, but that PR only updates ActorCast. Is there a reason it doesn't also address the differences in ActionEffect?


Just a request to add a comment pointing to the previous commit, as I expect to overhaul this code some time in the next few months as part of the pre-8.0 cleanup, and I don't want to lose track of the original logic.

…tHelper.cs

Co-authored-by: valarnin <valarnin@gmail.com>
@MilkVio

MilkVio commented May 7, 2026

Copy link
Copy Markdown
Author

Added the commit reference comment.

Regarding ActionEffect and the other structs: I did notice there may be similar TC-vs-Global differences outside ActorCast, but I’m not sure what direction upstream Machina would prefer.

From my testing with the TC client, the working behavior appears to be TC opcodes + Global packet structs for this path. Setting tcPacketType = globalPacketType makes OverlayPlugin’s lookup behavior consistent with the current Machina behavior for TC packets.

I’m not sure whether upstream Machina would prefer TC to explicitly define separate structs that currently match Global, or to continue sharing the Global structs while only keeping TC-specific opcodes. Since I’m not familiar enough with the intended maintenance direction, I kept this PR narrow and only submitted the ActorCast fix I could verify.

Happy to adjust the scope if you’d prefer this PR to cover ActionEffect or other TC packet structs too.

@valarnin

valarnin commented May 7, 2026

Copy link
Copy Markdown

I’m not sure whether upstream Machina would prefer TC to explicitly define separate structs that currently match Global, or to continue sharing the Global structs while only keeping TC-specific opcodes. Since I’m not familiar enough with the intended maintenance direction, I kept this PR narrow and only submitted the ActorCast fix I could verify.

Happy to adjust the scope if you’d prefer this PR to cover ActionEffect or other TC packet structs too.

Each game build needs its own opcodes and packet structs. Global, Chinese, and Korean are all now on the same game build (same build date, same opcodes). Until TC is also on the same build, that client will continue to need its own structs. As such, those structs should be updated in Machina for correctness.

This OverlayPlugin PR (and FFXIV_ACT_Plugin using the Global structs for the TC region) is a workaround currently.

@valarnin valarnin merged commit 9f44603 into OverlayPlugin:main May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants