-
Notifications
You must be signed in to change notification settings - Fork 85
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
API Only #1448
API Only #1448
Conversation
Hot reload is a thing to consider here.
|
Awesome, I also thought about similar thing. Maybe add
For hot reload... They need to be notified somehow that instance changed because static field values are "attached" to assembly - after hot reload if you try reading static field using instance from old assembly you may get garbage data. |
Its cached!
in the old code once TMPE.API is resolved it is also attached to the old assembly so I am not making anythings worse. Improving hot-reload is out of scope of the PR
There is a event for mod state changed. that can be used to reset cache. I already do this in my own mod : https://github.com/kianzarrin/KianCommons/blob/b49f663683804de9d8a9a9349509ee9a26450223/KianCommons/Plugins/AdaptiveRoadsUtil.cs#L12 |
@krzychu124 note that |
Yeah, it looks like I didn't read the code carefully. All clear. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Is this suitable description for the changelog?
If not, what would be better text? |
Yeah, it's ok IMO |
I'd add that referencing TrafficManager.dll is not required anymore. |
I created references from TMPE API to TranfficManager Implementations so that other mods will only need to reference
TMPE.API.dll
I could not reference TrafficManager from TMPE.API because of the issue of cyclic dependency. So I used reflection instead.