Skip to content

Conversation

@XtraCube
Copy link
Contributor

Reactor currently patches a few state machines generated by the C# compiler. This is generally okay but with updates to the game, the names of the compiler generated classes can change. Additionally, these names are not consistent across platforms.

By dynamically resolving these objects at runtime, Reactor will be more resilient to game updates and platform differences, allowing for a single build to be used across multiple platforms.

This PR adds two new utility classes:

  • CompilerGeneratedObjectWrapper: This class provides a wrapper around a compiler generated object. It provides two functions, GetField and SetField, to get and set fields on objects via reflection.
  • StateMachineWrapper<T>: This class inherits from CompilerGeneratedObjectWrapper to add state machine specific utilities.

These classes can be used by other mods that depend on Reactor as well.

@XtraCube
Copy link
Contributor Author

I'm fixing a couple bugs with this PR, I'll request a review when it is ready

@XtraCube
Copy link
Contributor Author

Okay I think it is ready for review

@XtraCube XtraCube marked this pull request as ready for review January 15, 2026 21:57
@XtraCube XtraCube closed this Jan 16, 2026
@XtraCube XtraCube deleted the master-2 branch January 16, 2026 00:13
@XtraCube
Copy link
Contributor Author

OK that was unintentional, lemme remake the PR

@XtraCube XtraCube restored the master-2 branch January 16, 2026 00:14
@XtraCube XtraCube reopened this Jan 16, 2026
@XtraCube
Copy link
Contributor Author

@js6pak mentioned we may want to avoid dynamic invokes and use a delegate or something. I'll look into that when I'm free.

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.

1 participant