mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-21 18:15:54 +00:00
test[python]: test python serialization
This commit is contained in:
1 parent
20d73fe7e6
commit
6083a284cd
9 files changed
+16424
No files matched your search
@@ -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