Add extra handles in NetworkMessage to filter execution Environment
#77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Often since in Java we can't load classes that have been striped, I find myself needed to create some condition branch that execute a single method since it's the only way to prevent wrongly unavailable import.
After the releasing of my first version of BTA CC, I found myself I did a terrible job of respecting the Client/Server Environement striping which lead to write in every method of my
NetworkMessageextra handle for preventing the server loading theScreenclass even there was some guard to preventing this.This is kind of repetitive to have to have those condition on every
NetworkMessageplus the needed to have two method for handling a simple GUI open so I decided to add two new methods on the HalplibeNetworkMessageIn this PR you will now found
handleClientEnvandhandleServerEnvwhich will be execute after the classichandlewith a check to be sure we are not in the wrong environment which could lead to a crash.Also now
handlehave a default implementation (it's an empty body) and so we can cleanly for opening a Screen just usehandleClientEnvThe usage in also explain in the
NetworkMessageJavaDocs.Also this PR should not introduce breaking changes since
handleis still called like before