I have some packets that have helper methods for initalizing such as this
public String reason = "No reason give. Please contact the development team if you see this message!";
private String[] reasonList =
{"Invalid Username.",
"Invalid Password.",
"This account has been banned." ,
"The server is currently in maintenance mode."
};
public Packet4LoginFailed(int index){
reason = reasonList[index];
}
I have registered the classes in the right order in both the server and the client (the registration is done in a shared class). However it errors. If I removed the constructor the packet no longer errors. I have a feeling this is to do with how kryo serializes the class. Is there anyway I can hide the constructor from serialization. I’m presuming there is some kind of annotation, however I couldn’t find anything in the kryonet google project page.
edit
the constructor is just 1 example of when I’d like to hide a method Some of my packets have other helper methods to make sure I initialize it properly.