If I use FieldSerializer, everything works. But if I switch to SavableSerializer I always get this. No matter how I implement the Savable on given class. It doesn’t matter what I put there. And actually it is read just fine. But shortly after I get this:
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:500)
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:135)
at com.jme3.network.serializing.serializers.ByteSerializer.readObject(ByteSerializer.java:47)
at com.jme3.network.serializing.serializers.ByteSerializer.readObject(ByteSerializer.java:43)
at com.jme3.network.serializing.serializers.FieldSerializer.readObject(FieldSerializer.java:161)
at com.jme3.network.serializing.Serializer.readClassAndObject(Serializer.java:406)
at com.jme3.network.base.MessageProtocol.createMessage(MessageProtocol.java:180)
at com.jme3.network.base.MessageProtocol.addBuffer(MessageProtocol.java:160)
at com.jme3.network.base.ConnectorAdapter.run(ConnectorAdapter.java:169)
I was hoping I could get a bit smaller buffer with this. I’m trying to transfer initial game data to the client. And it is a bit big. But almost fits And the next step would be something drastic I’m sure…