mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-05-20 01:26:23 +00:00
feat[protocol]: support GdScript of godot 4.4
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
package com.zfoo.protocol.serializer.gdscript;
|
||||
|
||||
import com.zfoo.protocol.generate.GenerateProtocolFile;
|
||||
import com.zfoo.protocol.registration.field.ArrayField;
|
||||
import com.zfoo.protocol.registration.field.IFieldRegistration;
|
||||
import com.zfoo.protocol.registration.field.MapField;
|
||||
import com.zfoo.protocol.serializer.CodeLanguage;
|
||||
@@ -31,7 +32,18 @@ public class GdMapSerializer implements IGdSerializer {
|
||||
|
||||
@Override
|
||||
public String fieldType(Field field, IFieldRegistration fieldRegistration) {
|
||||
return "Dictionary";
|
||||
var mapField = (MapField) fieldRegistration;
|
||||
var keyRegistration = mapField.getMapKeyRegistration();
|
||||
var valueRegistration = mapField.getMapValueRegistration();
|
||||
|
||||
var keyType = CodeGenerateGdScript.gdSerializer(keyRegistration.serializer()).fieldType(field, keyRegistration);
|
||||
var valueType = CodeGenerateGdScript.gdSerializer(valueRegistration.serializer()).fieldType(field, valueRegistration);
|
||||
|
||||
if (keyType.startsWith("Array") || keyType.startsWith("Dictionary") || valueType.startsWith("Array") || valueType.startsWith("Dictionary")) {
|
||||
return "Dictionary";
|
||||
} else {
|
||||
return StringUtils.format("Dictionary[{}, {}]", keyType, valueType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -488,7 +488,7 @@ func writeIntIntMap(map):
|
||||
pass
|
||||
|
||||
func readIntIntMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -508,7 +508,7 @@ func writeIntLongMap(map):
|
||||
pass
|
||||
|
||||
func readIntLongMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -528,7 +528,7 @@ func writeIntStringMap(map):
|
||||
pass
|
||||
|
||||
func readIntStringMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -549,10 +549,11 @@ func writeIntPacketMap(map, protocolId):
|
||||
pass
|
||||
|
||||
func readIntPacketMap(protocolId):
|
||||
var map = {}
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_INT, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readInt()
|
||||
var value = protocolRegistration.read(self)
|
||||
@@ -570,7 +571,7 @@ func writeLongIntMap(map):
|
||||
pass
|
||||
|
||||
func readLongIntMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -590,7 +591,7 @@ func writeLongLongMap(map):
|
||||
pass
|
||||
|
||||
func readLongLongMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -610,7 +611,7 @@ func writeLongStringMap(map):
|
||||
pass
|
||||
|
||||
func readLongStringMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -631,10 +632,11 @@ func writeLongPacketMap(map, protocolId):
|
||||
pass
|
||||
|
||||
func readLongPacketMap(protocolId):
|
||||
var map = {}
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_INT, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readLong()
|
||||
var value = protocolRegistration.read(self)
|
||||
@@ -652,7 +654,7 @@ func writeStringIntMap(map):
|
||||
pass
|
||||
|
||||
func readStringIntMap():
|
||||
var map = {}
|
||||
var map: Dictionary[String, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -672,7 +674,7 @@ func writeStringLongMap(map):
|
||||
pass
|
||||
|
||||
func readStringLongMap():
|
||||
var map = {}
|
||||
var map: Dictionary[String, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -692,7 +694,7 @@ func writeStringStringMap(map):
|
||||
pass
|
||||
|
||||
func readStringStringMap():
|
||||
var map = {}
|
||||
var map: Dictionary[String, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -713,10 +715,11 @@ func writeStringPacketMap(map, protocolId):
|
||||
pass
|
||||
|
||||
func readStringPacketMap(protocolId):
|
||||
var map = {}
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_STRING, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readString()
|
||||
var value = protocolRegistration.read(self)
|
||||
|
||||
@@ -24,6 +24,7 @@ func adjustPadding(predictionLength: int, beforeWriteIndex: int) -> void:
|
||||
writeInt(length)
|
||||
setWriteOffset(currentWriteIndex)
|
||||
else:
|
||||
# get_partial_data of StreamPeerBuffer is deep clone
|
||||
buffer.seek(currentWriteIndex - length)
|
||||
var retainedByteBuf = buffer.get_partial_data(length)[1]
|
||||
setWriteOffset(beforeWriteIndex)
|
||||
@@ -487,7 +488,7 @@ func writeIntIntMap(map):
|
||||
pass
|
||||
|
||||
func readIntIntMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -507,7 +508,7 @@ func writeIntLongMap(map):
|
||||
pass
|
||||
|
||||
func readIntLongMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -527,7 +528,7 @@ func writeIntStringMap(map):
|
||||
pass
|
||||
|
||||
func readIntStringMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -548,10 +549,11 @@ func writeIntPacketMap(map, protocolId):
|
||||
pass
|
||||
|
||||
func readIntPacketMap(protocolId):
|
||||
var map = {}
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_INT, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readInt()
|
||||
var value = protocolRegistration.read(self)
|
||||
@@ -569,7 +571,7 @@ func writeLongIntMap(map):
|
||||
pass
|
||||
|
||||
func readLongIntMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -589,7 +591,7 @@ func writeLongLongMap(map):
|
||||
pass
|
||||
|
||||
func readLongLongMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -609,7 +611,7 @@ func writeLongStringMap(map):
|
||||
pass
|
||||
|
||||
func readLongStringMap():
|
||||
var map = {}
|
||||
var map: Dictionary[int, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -630,10 +632,11 @@ func writeLongPacketMap(map, protocolId):
|
||||
pass
|
||||
|
||||
func readLongPacketMap(protocolId):
|
||||
var map = {}
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_INT, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readLong()
|
||||
var value = protocolRegistration.read(self)
|
||||
@@ -651,7 +654,7 @@ func writeStringIntMap(map):
|
||||
pass
|
||||
|
||||
func readStringIntMap():
|
||||
var map = {}
|
||||
var map: Dictionary[String, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -671,7 +674,7 @@ func writeStringLongMap(map):
|
||||
pass
|
||||
|
||||
func readStringLongMap():
|
||||
var map = {}
|
||||
var map: Dictionary[String, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -691,7 +694,7 @@ func writeStringStringMap(map):
|
||||
pass
|
||||
|
||||
func readStringStringMap():
|
||||
var map = {}
|
||||
var map: Dictionary[String, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
@@ -712,10 +715,11 @@ func writeStringPacketMap(map, protocolId):
|
||||
pass
|
||||
|
||||
func readStringPacketMap(protocolId):
|
||||
var map = {}
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_STRING, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readString()
|
||||
var value = protocolRegistration.read(self)
|
||||
|
||||
@@ -43,8 +43,8 @@ var ll: Array # Array<Array<Array<number>>>
|
||||
var lll: Array # Array<Array<ObjectA>>
|
||||
var llll: Array[String]
|
||||
var lllll: Array # Array<Map<number, string>>
|
||||
var m: Dictionary # Map<number, string>
|
||||
var mm: Dictionary # Map<number, ObjectA>
|
||||
var m: Dictionary[int, String]
|
||||
var mm: Dictionary[int, ObjectA]
|
||||
var mmm: Dictionary # Map<ObjectA, Array<number>>
|
||||
var mmmm: Dictionary # Map<Array<Array<ObjectA>>, Array<Array<Array<number>>>>
|
||||
var mmmmm: Dictionary # Map<Array<Map<number, string>>, Set<Map<number, string>>>
|
||||
@@ -65,7 +65,7 @@ func get_class_name() -> String:
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{a:{}, aa:{}, aaa:{}, aaaa:{}, b:{}, bb:{}, bbb:{}, bbbb:{}, c:{}, cc:{}, ccc:{}, cccc:{}, d:{}, dd:{}, ddd:{}, dddd:{}, e:{}, ee:{}, eee:{}, eeee:{}, f:{}, ff:{}, fff:{}, ffff:{}, g:{}, gg:{}, ggg:{}, gggg:{}, jj:'{}', jjj:{}, kk:{}, kkk:{}, l:{}, ll:{}, lll:{}, llll:{}, lllll:{}, m:{}, mm:{}, mmm:{}, mmmm:{}, mmmmm:{}, s:{}, ss:{}, sss:{}, ssss:{}, sssss:{}, myCompatible:{}, myObject:{}}"
|
||||
var params = [self.a, self.aa, JSON.stringify(self.aaa), JSON.stringify(self.aaaa), self.b, self.bb, JSON.stringify(self.bbb), JSON.stringify(self.bbbb), self.c, self.cc, JSON.stringify(self.ccc), JSON.stringify(self.cccc), self.d, self.dd, JSON.stringify(self.ddd), JSON.stringify(self.dddd), self.e, self.ee, JSON.stringify(self.eee), JSON.stringify(self.eeee), self.f, self.ff, JSON.stringify(self.fff), JSON.stringify(self.ffff), self.g, self.gg, JSON.stringify(self.ggg), JSON.stringify(self.gggg), self.jj, JSON.stringify(self.jjj), self.kk, JSON.stringify(self.kkk), JSON.stringify(self.l), JSON.stringify(self.ll), JSON.stringify(self.lll), JSON.stringify(self.llll), JSON.stringify(self.lllll), JSON.stringify(self.m), JSON.stringify(self.mm), JSON.stringify(self.mmm), JSON.stringify(self.mmmm), JSON.stringify(self.mmmmm), JSON.stringify(self.s), JSON.stringify(self.ss), JSON.stringify(self.sss), JSON.stringify(self.ssss), JSON.stringify(self.sssss), self.myCompatible, self.myObject]
|
||||
var params = [self.a, self.aa, JSON.stringify(self.aaa), JSON.stringify(self.aaaa), self.b, self.bb, JSON.stringify(self.bbb), JSON.stringify(self.bbbb), self.c, self.cc, JSON.stringify(self.ccc), JSON.stringify(self.cccc), self.d, self.dd, JSON.stringify(self.ddd), JSON.stringify(self.dddd), self.e, self.ee, JSON.stringify(self.eee), JSON.stringify(self.eeee), self.f, self.ff, JSON.stringify(self.fff), JSON.stringify(self.ffff), self.g, self.gg, JSON.stringify(self.ggg), JSON.stringify(self.gggg), self.jj, JSON.stringify(self.jjj), self.kk, JSON.stringify(self.kkk), JSON.stringify(self.l), JSON.stringify(self.ll), JSON.stringify(self.lll), JSON.stringify(self.llll), JSON.stringify(self.lllll), self.m, self.mm, JSON.stringify(self.mmm), JSON.stringify(self.mmmm), JSON.stringify(self.mmmmm), JSON.stringify(self.s), JSON.stringify(self.ss), JSON.stringify(self.sss), JSON.stringify(self.ssss), JSON.stringify(self.sssss), self.myCompatible, self.myObject]
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class ComplexObjectRegistration:
|
||||
|
||||
@@ -18,12 +18,10 @@ var l: Array[int]
|
||||
var ll: Array[int]
|
||||
var lll: Array[ObjectA]
|
||||
var llll: Array[String]
|
||||
var m: Dictionary # Map<number, string>
|
||||
var mm: Dictionary # Map<number, ObjectA>
|
||||
var m: Dictionary[int, String]
|
||||
var mm: Dictionary[int, ObjectA]
|
||||
var s: Array[int]
|
||||
var ssss: Array[String]
|
||||
var outCompatibleValue: int
|
||||
var outCompatibleValue2: int
|
||||
|
||||
func protocolId() -> int:
|
||||
return 101
|
||||
@@ -32,8 +30,8 @@ func get_class_name() -> String:
|
||||
return "NormalObject"
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{a:{}, aaa:{}, b:{}, c:{}, d:{}, e:{}, f:{}, g:{}, jj:'{}', kk:{}, l:{}, ll:{}, lll:{}, llll:{}, m:{}, mm:{}, s:{}, ssss:{}, outCompatibleValue:{}, outCompatibleValue2:{}}"
|
||||
var params = [self.a, JSON.stringify(self.aaa), self.b, self.c, self.d, self.e, self.f, self.g, self.jj, self.kk, JSON.stringify(self.l), JSON.stringify(self.ll), JSON.stringify(self.lll), JSON.stringify(self.llll), JSON.stringify(self.m), JSON.stringify(self.mm), JSON.stringify(self.s), JSON.stringify(self.ssss), self.outCompatibleValue, self.outCompatibleValue2]
|
||||
const jsonTemplate = "{a:{}, aaa:{}, b:{}, c:{}, d:{}, e:{}, f:{}, g:{}, jj:'{}', kk:{}, l:{}, ll:{}, lll:{}, llll:{}, m:{}, mm:{}, s:{}, ssss:{}}"
|
||||
var params = [self.a, JSON.stringify(self.aaa), self.b, self.c, self.d, self.e, self.f, self.g, self.jj, self.kk, JSON.stringify(self.l), JSON.stringify(self.ll), JSON.stringify(self.lll), JSON.stringify(self.llll), self.m, self.mm, JSON.stringify(self.s), JSON.stringify(self.ssss)]
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class NormalObjectRegistration:
|
||||
@@ -41,8 +39,7 @@ class NormalObjectRegistration:
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
var beforeWriteIndex = buffer.getWriteOffset()
|
||||
buffer.writeInt(857)
|
||||
buffer.writeInt(-1)
|
||||
buffer.writeByte(packet.a)
|
||||
buffer.writeByteArray(packet.aaa)
|
||||
buffer.writeShort(packet.b)
|
||||
@@ -61,9 +58,6 @@ class NormalObjectRegistration:
|
||||
buffer.writeIntPacketMap(packet.mm, 102)
|
||||
buffer.writeIntArray(packet.s)
|
||||
buffer.writeStringArray(packet.ssss)
|
||||
buffer.writeInt(packet.outCompatibleValue)
|
||||
buffer.writeInt(packet.outCompatibleValue2)
|
||||
buffer.adjustPadding(857, beforeWriteIndex)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
@@ -108,12 +102,6 @@ class NormalObjectRegistration:
|
||||
packet.s = set16
|
||||
var set17 = buffer.readStringArray()
|
||||
packet.ssss = set17
|
||||
if buffer.compatibleRead(beforeReadIndex, length):
|
||||
var result18 = buffer.readInt()
|
||||
packet.outCompatibleValue = result18
|
||||
if buffer.compatibleRead(beforeReadIndex, length):
|
||||
var result19 = buffer.readInt()
|
||||
packet.outCompatibleValue2 = result19
|
||||
if (length > 0):
|
||||
buffer.setReadOffset(beforeReadIndex + length)
|
||||
return packet
|
||||
@@ -3,9 +3,8 @@ const ObjectB = preload("res://zfoogd/packet/ObjectB.gd")
|
||||
|
||||
|
||||
var a: int
|
||||
var m: Dictionary # Map<number, string>
|
||||
var m: Dictionary[int, String]
|
||||
var objectB: ObjectB
|
||||
var innerCompatibleValue: int
|
||||
|
||||
func protocolId() -> int:
|
||||
return 102
|
||||
@@ -14,8 +13,8 @@ func get_class_name() -> String:
|
||||
return "ObjectA"
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{a:{}, m:{}, objectB:{}, innerCompatibleValue:{}}"
|
||||
var params = [self.a, JSON.stringify(self.m), self.objectB, self.innerCompatibleValue]
|
||||
const jsonTemplate = "{a:{}, m:{}, objectB:{}}"
|
||||
var params = [self.a, self.m, self.objectB]
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class ObjectARegistration:
|
||||
@@ -23,13 +22,10 @@ class ObjectARegistration:
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
var beforeWriteIndex = buffer.getWriteOffset()
|
||||
buffer.writeInt(201)
|
||||
buffer.writeInt(-1)
|
||||
buffer.writeInt(packet.a)
|
||||
buffer.writeIntStringMap(packet.m)
|
||||
buffer.writePacket(packet.objectB, 103)
|
||||
buffer.writeInt(packet.innerCompatibleValue)
|
||||
buffer.adjustPadding(201, beforeWriteIndex)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
@@ -44,9 +40,6 @@ class ObjectARegistration:
|
||||
packet.m = map1
|
||||
var result2 = buffer.readPacket(103)
|
||||
packet.objectB = result2
|
||||
if buffer.compatibleRead(beforeReadIndex, length):
|
||||
var result3 = buffer.readInt()
|
||||
packet.innerCompatibleValue = result3
|
||||
if (length > 0):
|
||||
buffer.setReadOffset(beforeReadIndex + length)
|
||||
return packet
|
||||
@@ -2,7 +2,6 @@ const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
|
||||
|
||||
var flag: bool
|
||||
var innerCompatibleValue: int
|
||||
|
||||
func protocolId() -> int:
|
||||
return 103
|
||||
@@ -11,8 +10,8 @@ func get_class_name() -> String:
|
||||
return "ObjectB"
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{flag:{}, innerCompatibleValue:{}}"
|
||||
var params = [self.flag, self.innerCompatibleValue]
|
||||
const jsonTemplate = "{flag:{}}"
|
||||
var params = [self.flag]
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class ObjectBRegistration:
|
||||
@@ -20,11 +19,8 @@ class ObjectBRegistration:
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
var beforeWriteIndex = buffer.getWriteOffset()
|
||||
buffer.writeInt(4)
|
||||
buffer.writeInt(-1)
|
||||
buffer.writeBool(packet.flag)
|
||||
buffer.writeInt(packet.innerCompatibleValue)
|
||||
buffer.adjustPadding(4, beforeWriteIndex)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
@@ -35,9 +31,6 @@ class ObjectBRegistration:
|
||||
var packet = buffer.newInstance(103)
|
||||
var result0 = buffer.readBool()
|
||||
packet.flag = result0
|
||||
if buffer.compatibleRead(beforeReadIndex, length):
|
||||
var result1 = buffer.readInt()
|
||||
packet.innerCompatibleValue = result1
|
||||
if (length > 0):
|
||||
buffer.setReadOffset(beforeReadIndex + length)
|
||||
return packet
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user