2021-10-18 07:20:14 +00:00
|
|
|
# @author jaysunxiao
|
|
|
|
# @version 3.0
|
2022-05-18 13:08:42 +00:00
|
|
|
|
2021-10-18 07:20:14 +00:00
|
|
|
var a # int
|
|
|
|
var m # java.util.Map<java.lang.Integer, java.lang.String>
|
|
|
|
var objectB # com.zfoo.protocol.packet.ObjectB
|
|
|
|
|
|
|
|
const PROTOCOL_ID = 102
|
|
|
|
|
|
|
|
static func write(buffer, packet):
|
|
|
|
if (buffer.writePacketFlag(packet)):
|
|
|
|
return
|
|
|
|
buffer.writeInt(packet.a)
|
2021-10-18 11:43:09 +00:00
|
|
|
buffer.writeIntStringMap(packet.m)
|
|
|
|
buffer.writePacket(packet.objectB, 103)
|
2021-10-18 07:20:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
static func read(buffer):
|
|
|
|
if (!buffer.readBool()):
|
|
|
|
return null
|
2022-05-18 13:08:42 +00:00
|
|
|
var packet = buffer.newInstance(PROTOCOL_ID)
|
2021-10-18 11:43:09 +00:00
|
|
|
var result0 = buffer.readInt()
|
|
|
|
packet.a = result0
|
|
|
|
var map1 = buffer.readIntStringMap()
|
|
|
|
packet.m = map1
|
|
|
|
var result2 = buffer.readPacket(103)
|
|
|
|
packet.objectB = result2
|
2021-10-18 07:20:14 +00:00
|
|
|
return packet
|