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

postInit #2

Open
ago1024 opened this issue Dec 27, 2015 · 1 comment
Open

postInit #2

ago1024 opened this issue Dec 27, 2015 · 1 comment

Comments

@ago1024
Copy link
Owner

ago1024 commented Dec 27, 2015

Small issue/suggestion:

Currently if i try to use normal java reflection into wurm code in init or preInit - it causes the class to be properly loaded and frozen, which means javaassist can't modify it later if some other mod wants to do that.

What i'd suggest is adding another "step" - postInit and defining in documentation (i'm not sure if enforcing that in code would be possible) what mods should do in every initialization "step". Eg:

Pre - setup their own internal stuff
Init - add hooks and patch classes, no interaction with wurm classes in "normal" code
Post - wurm classes can be accessed from normal code, javaassist stuff is not allowed anymore
@marad
Copy link

marad commented Dec 30, 2016

This sounds cool. Would Post run after server connection is created? So that all the classes are initiated?

I understand that to do that know I need to use javaassist to hook my code in the right place?

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

No branches or pull requests

2 participants