Fix issue with packet bytes reuse
Big oversight that caused broadcasted (packet sent to multiple clients) packets to only be correct for the first receiver, for example when 3 players were in the same map.
This commit is contained in:
@@ -203,15 +203,4 @@ class ByteBufOutPacketTest {
|
||||
assertEquals(0, wrapped.readByte());
|
||||
assertEquals(secondWrittenByte, wrapped.readByte());
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenGettingBytesRepeatedly_bytesShouldBeLockedInPlace() {
|
||||
outPacket.writeByte(1);
|
||||
byte[] initialWrite = outPacket.getBytes();
|
||||
|
||||
outPacket.writeByte(2);
|
||||
byte[] afterWritingAgain = outPacket.getBytes();
|
||||
|
||||
assertArrayEquals(initialWrite, afterWritingAgain);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user