Files
zfoo/protocol/src/main/resources/python/ProtocolTemplate.py
T
2023-09-28 10:15:34 +08:00

29 lines
535 B
Python

{}
class {}:
{}
def protocolId(self):
return {}
@classmethod
def write(cls, buffer, packet):
if packet is None:
buffer.writeInt(0)
return
{}
pass
@classmethod
def read(cls, buffer):
length = buffer.readInt()
if length == 0:
return None
beforeReadIndex = buffer.getReadOffset()
packet = {}()
{}
if length > 0:
buffer.setReadOffset(beforeReadIndex + length)
return packet