mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-05-21 14:26:56 +00:00
test[python]: test python serialization
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
|
||||
class ObjectB:
|
||||
|
||||
flag = False # bool
|
||||
|
||||
def protocolId(self):
|
||||
return 103
|
||||
|
||||
@classmethod
|
||||
def write(cls, buffer, packet):
|
||||
if buffer.writePacketFlag(packet):
|
||||
return
|
||||
buffer.writeBool(packet.flag)
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def read(cls, buffer):
|
||||
if not buffer.readBool():
|
||||
return None
|
||||
packet = ObjectB()
|
||||
result0 = buffer.readBool()
|
||||
packet.flag = result0
|
||||
return packet
|
||||
|
||||
Reference in New Issue
Block a user