Skip to content
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

Support reading constant field #386

Merged

Conversation

DemoJameson
Copy link
Contributor

No description provided.

@tristanmcpherson
Copy link
Member

Nice. Just out of curiosity, I noticed you’ve put a lot of work into these reflection utils. Is that mostly out of fun or are these actually going to be used somewhere? Great improvements for sure, and they’re not limited to just this game of course.

@DemoJameson
Copy link
Contributor Author

yes, I used part of it in one of my own projects
the main point is to make this method as generic as possible
public static object GetFieldValue(this object obj, string name)

@tristanmcpherson tristanmcpherson merged commit ae6cd3e into risk-of-thunder:master Apr 14, 2022
@Windows10CE
Copy link
Contributor

Is there a particular reason you aren't using publicized assemblies in that project as well? That's mostly why these reflection utilities have been largely unmaintained, they aren't used anymore

@WEGFan
Copy link

WEGFan commented Apr 14, 2022

Could you tell us what you are mostly using? We used this util class in our mod for Celeste, since the game targets at .NET Framework 4.5.2, we can only use assemblies supports this, and there are some limitations on cross platform compatibility.

@harbingerofme
Copy link
Collaborator

We publicize and strip the game assembly, and add assembly attributes that tell the runtime to skip access checks. Eg: everything is public when we build our mods

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.

5 participants