kryonet icon indicating copy to clipboard operation
kryonet copied to clipboard

2D array is empty when received.

Open midn1 opened this issue 8 years ago • 2 comments
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).

midn1 avatar Feb 12 '17 12:02 midn1

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)?

RobertZenz avatar Feb 12 '17 16:02 RobertZenz

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?

midn1 avatar Feb 12 '17 17:02 midn1