kryonet
kryonet copied to clipboard
2D array is empty when received.
trafficstars
I have this packet:
public class PacketHereIsAChunk {
public int x;
public int[][] blocks = new int[Chunk.SIZE_X][Chunk.SIZE_Y];
}
The 2D array is populated before sending. However when the client receives it. All ints become default values (0).
I have quite the same thing, but for me it works. Odd, what version are you using? Do you have your own serializer for arrays? Do you utilize multi-threading (you fill the chunk in one thread and then send it using another)?
I have version 2.22 and I fill the array in the same thread as the one I send it in.
And no, I do not have a serializer for arrays. Doesn't Kryonet have that builtin?