Sending objects not subclass to Message


it’s me again, what a surprise.

I’m sorry if I’ve missed something. I have updated my jMonkeyEngine3 project from the SVN-repo, built the project and update the referenced libs in my own project. As you mentioned in the other topic, there are some changes such as the methods Client.sendTCP(Object) and Client.sendUDP(Object) were removed and instead there is only one method Client.send(Message). Now, that is already my question. Is there no more possibility to send Objects not subclasses to Message? In this tutorial () at the very bottom it says:


However, this can not work, can it? Send does not allow parameters that are not subclasses to Message any longer, am I right? Would I have to use the deprecated methods instead??



You’re absolutely right, and the tutorial is in error here. I’ll fix it soon. Indeed, lately you have to use Message. It may be quite annoying but is extremely useful for managing clients and such. I may think of a way around this soon, but this is just the way it is right now.

As for your problem, the best thing is to wrap it in a message class.


public class AddressMessage extends Message {

private Inet4Address addr;