- prototype - between client and server, allow to capture all exchanges and potentially change them - created to capture server maps in laby - first test get only MapBlock, support version serialization version 28 - prepartion for 29 with zstd but untested. # Conflicts: # fetch_dependencies.sh
29 lines
580 B
Java
29 lines
580 B
Java
package org.artisanlogiciel.games.minetest.net;
|
|
|
|
import org.artisanlogiciel.games.minetest.core.PacketException;
|
|
import org.artisanlogiciel.games.minetest.core.Serialize;
|
|
|
|
public class BufferedPacket {
|
|
|
|
public static int BASE_HEADER_SIZE = 7;
|
|
|
|
// Data of the packet, including headers
|
|
byte[] m_data;
|
|
|
|
BufferedPacket(byte[] data)
|
|
{
|
|
m_data = data;
|
|
}
|
|
|
|
int getSeqNum()
|
|
throws PacketException
|
|
{
|
|
return Serialize.readU16(m_data, BASE_HEADER_SIZE + 1, size());
|
|
}
|
|
|
|
int size()
|
|
{
|
|
return m_data.length;
|
|
}
|
|
}
|