godot-start/gdProtocol/packet/SimpleObject.gd

25 lines
463 B
GDScript
Raw Normal View History

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 c # int
var g # boolean
const PROTOCOL_ID = 104
static func write(buffer, packet):
if (buffer.writePacketFlag(packet)):
return
buffer.writeInt(packet.c)
buffer.writeBool(packet.g)
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 07:20:14 +00:00
var result0 = buffer.readInt()
packet.c = result0
var result1 = buffer.readBool()
packet.g = result1
return packet