godot-start/gdProtocol/packet/SimpleObject.gd

24 lines
454 B
GDScript
Raw Normal View History

2021-10-18 07:20:14 +00:00
# @author jaysunxiao
# @version 3.0
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
var packet = buffer.newInstance(104)
var result0 = buffer.readInt()
packet.c = result0
var result1 = buffer.readBool()
packet.g = result1
return packet