Skip to content

Fix [SyncWorker] attribute failing for typed ref parameters#838

Merged
notfood merged 1 commit intorwmt:masterfrom
Sakura-TA:master
Mar 19, 2026
Merged

Fix [SyncWorker] attribute failing for typed ref parameters#838
notfood merged 1 commit intorwmt:masterfrom
Sakura-TA:master

Conversation

@Sakura-TA
Copy link
Contributor

For me there are 2 ways to fix this:

  1. Make SyncWorkerEntry.Add(MethodInfo) compatible with methods using ref T instead of ref object
  2. Force it to call the generic version of RegisterSyncWorker while looping through [SyncWorker] attributes in RegisterAllAttributes

Chose the first one because:

  • Fix is at the right level where the incompatibility actually occurs

  • RegisterAllAttributes stays clean and readable

@notfood notfood added fix Fixes for a bug or desync. 1.6 Fixes or bugs relating to 1.6 (Not Odyssey). labels Mar 19, 2026
@notfood notfood moved this to In review in 1.6 and Odyssey Mar 19, 2026
@notfood
Copy link
Member

notfood commented Mar 19, 2026

Looks fine. The impact is mostly to other mods that use [SynchWorker], it doesn't affect MpCompat itself. Have you tested with other mods?

@Sakura-TA
Copy link
Contributor Author

Yeah, it can fix CE's patch. And should work with other too.

@notfood notfood merged commit 05d5e6e into rwmt:master Mar 19, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from In review to Done in 1.6 and Odyssey Mar 19, 2026
TheCallunxz added a commit to TheCallunxz/Multiplayer that referenced this pull request Mar 19, 2026
Fix [SyncWorker] attribute failing for typed ref parameters (rwmt#838)
@Sakura-TA
Copy link
Contributor Author

Small problem that this patch forget to use preserved addGenericMethod, very small performance problem when Initializing game, if someone read this try replace line 68 here with addGenericMethod.Invoke(this, [func]). shall works fine.

@notfood
Copy link
Member

notfood commented Mar 19, 2026

Huh??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6 Fixes or bugs relating to 1.6 (Not Odyssey). fix Fixes for a bug or desync.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants