mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-11 03:13:51 +00:00
test[protocol]: gdscript protocol test
This commit is contained in:
1 parent
53d97524d6
commit
588de0130a
10 files changed
+125
-132
No files matched your search
@@ -13,7 +13,7 @@ var readOffset: int = 0
|
||||
func _init():
|
||||
buffer.big_endian = true
|
||||
|
||||
func adjustPadding(predictionLength: int, beforeWriteIndex: int) -> void:
|
||||
func adjustPadding(predictionLength: int, beforeWriteIndex: int):
|
||||
var currentWriteIndex = writeOffset
|
||||
var predictionCount = writeIntCount(predictionLength)
|
||||
var length = currentWriteIndex - beforeWriteIndex - predictionCount
|
||||
@@ -24,7 +24,7 @@ func adjustPadding(predictionLength: int, beforeWriteIndex: int) -> void:
|
||||
writeInt(length)
|
||||
setWriteOffset(currentWriteIndex)
|
||||
else:
|
||||
# get_partial_data of StreamPeerBuffer is deep clone
|
||||
# get_partial_data of StreamPeerBuffer is deep clone
|
||||
buffer.seek(currentWriteIndex - length)
|
||||
var retainedByteBuf = buffer.get_partial_data(length)[1]
|
||||
setWriteOffset(beforeWriteIndex)
|
||||
@@ -43,7 +43,7 @@ func compatibleRead(beforeReadIndex: int, length: int) -> bool:
|
||||
func getBuffer() -> StreamPeerBuffer:
|
||||
return buffer
|
||||
|
||||
func setWriteOffset(writeIndex: int) -> void:
|
||||
func setWriteOffset(writeIndex: int):
|
||||
if (writeIndex > buffer.get_size()):
|
||||
var template = "writeIndex[{}] out of bounds exception: readOffset: {}, writeOffset: {} (expected: 0 <= readOffset <= writeOffset <= capacity: {})"
|
||||
printerr(template.format([writeIndex, readOffset, writeOffset, buffer.get_size()], "{}"))
|
||||
@@ -54,7 +54,7 @@ func setWriteOffset(writeIndex: int) -> void:
|
||||
func getWriteOffset() -> int:
|
||||
return writeOffset
|
||||
|
||||
func setReadOffset(readIndex: int) -> void:
|
||||
func setReadOffset(readIndex: int):
|
||||
if (readIndex > writeOffset):
|
||||
var template = "readIndex[{}] out of bounds exception: readOffset: {}, writeOffset: {} (expected: 0 <= readOffset <= writeOffset <= capacity: {})"
|
||||
printerr(template.format([readIndex, readOffset, writeOffset, buffer.size()], "{}"))
|
||||
@@ -71,7 +71,7 @@ func isReadable() -> bool:
|
||||
func toBytes() -> PackedByteArray:
|
||||
return buffer.data_array.slice(0, writeOffset)
|
||||
|
||||
func newInstance(protocolId: int):
|
||||
func newInstance(protocolId: int) -> Object:
|
||||
return ProtocolManager.newInstance(protocolId)
|
||||
|
||||
# -------------------------------------------------write/read-------------------------------------------------
|
||||
@@ -84,7 +84,7 @@ func writeBytes(value: PackedByteArray):
|
||||
func readBytes(length: int) -> PackedByteArray:
|
||||
return buffer.data_array.slice(0, length)
|
||||
|
||||
func writeBool(value: bool) -> void:
|
||||
func writeBool(value: bool):
|
||||
var byte: int = 1 if value else 0
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_8(byte)
|
||||
@@ -97,7 +97,7 @@ func readBool() -> bool:
|
||||
readOffset += 1
|
||||
return byte == 1
|
||||
|
||||
func writeByte(value: int) -> void:
|
||||
func writeByte(value: int):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_8(value)
|
||||
writeOffset += 1
|
||||
@@ -109,7 +109,7 @@ func readByte() -> int:
|
||||
readOffset += 1
|
||||
return value
|
||||
|
||||
func writeShort(value: int) -> void:
|
||||
func writeShort(value: int):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_16(value)
|
||||
writeOffset += 2
|
||||
@@ -121,7 +121,7 @@ func readShort() -> int:
|
||||
readOffset += 2
|
||||
return value
|
||||
|
||||
func writeRawInt(value) -> void:
|
||||
func writeRawInt(value):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_32(value)
|
||||
writeOffset += 4
|
||||
@@ -133,7 +133,7 @@ func readRawInt() -> int:
|
||||
readOffset += 4
|
||||
return value
|
||||
|
||||
func writeInt(value) -> void:
|
||||
func writeInt(value):
|
||||
if !(minInt <= value && value <= maxInt):
|
||||
printerr("value must range between minInt:-2147483648 and maxInt:2147483647")
|
||||
return
|
||||
@@ -158,7 +158,7 @@ func writeIntCount(value: int) -> int:
|
||||
func readInt() -> int:
|
||||
return readLong()
|
||||
|
||||
func writeLong(longValue: int) -> void:
|
||||
func writeLong(longValue: int):
|
||||
var value: int = (longValue << 1) ^ (longValue >> 63)
|
||||
|
||||
if (value >> 7 == 0):
|
||||
@@ -257,7 +257,7 @@ func readLong() -> int:
|
||||
return mask ^ -(value & 1)
|
||||
|
||||
|
||||
func writeFloat(value: float) -> void:
|
||||
func writeFloat(value: float):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_float(value)
|
||||
writeOffset += 4
|
||||
@@ -269,7 +269,7 @@ func readFloat() -> float:
|
||||
readOffset += 4
|
||||
return value
|
||||
|
||||
func writeDouble(value: float) -> void:
|
||||
func writeDouble(value: float):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_double(value)
|
||||
writeOffset += 8
|
||||
@@ -282,7 +282,7 @@ func readDouble() -> float:
|
||||
return value
|
||||
|
||||
|
||||
func writeString(value: String) -> void:
|
||||
func writeString(value: String):
|
||||
if (value == null || value.length() ==0):
|
||||
writeInt(0)
|
||||
return
|
||||
@@ -309,7 +309,7 @@ func writePacket(packet, protocolId):
|
||||
protocolRegistration.write(self, packet)
|
||||
pass
|
||||
|
||||
func readPacket(protocolId):
|
||||
func readPacket(protocolId) -> Object:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
return protocolRegistration.read(self)
|
||||
|
||||
@@ -356,7 +356,7 @@ func writeShortArray(array):
|
||||
writeShort(element)
|
||||
pass
|
||||
|
||||
func readShortArray():
|
||||
func readShortArray() -> Array[int]:
|
||||
var array: Array[int] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -373,7 +373,7 @@ func writeIntArray(array):
|
||||
writeInt(element)
|
||||
pass
|
||||
|
||||
func readIntArray():
|
||||
func readIntArray() -> Array[int]:
|
||||
var array: Array[int] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -390,7 +390,7 @@ func writeLongArray(array):
|
||||
writeLong(element)
|
||||
pass
|
||||
|
||||
func readLongArray():
|
||||
func readLongArray() -> Array[int]:
|
||||
var array: Array[int] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -407,7 +407,7 @@ func writeFloatArray(array):
|
||||
writeFloat(element)
|
||||
pass
|
||||
|
||||
func readFloatArray():
|
||||
func readFloatArray() -> Array[float]:
|
||||
var array: Array[float] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -424,7 +424,7 @@ func writeDoubleArray(array):
|
||||
writeDouble(element)
|
||||
pass
|
||||
|
||||
func readDoubleArray():
|
||||
func readDoubleArray() -> Array[float]:
|
||||
var array: Array[float] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -441,7 +441,7 @@ func writeStringArray(array):
|
||||
writeString(element)
|
||||
pass
|
||||
|
||||
func readStringArray():
|
||||
func readStringArray() -> Array[String]:
|
||||
var array: Array[String] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -459,7 +459,7 @@ func writePacketArray(array, protocolId):
|
||||
protocolRegistration.write(self, element)
|
||||
pass
|
||||
|
||||
func readPacketArray(protocolId):
|
||||
func readPacketArray(protocolId) -> Array:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var array = Array([], typeof(protocol), StringName("RefCounted"), protocol)
|
||||
@@ -487,7 +487,7 @@ func writeIntIntMap(map):
|
||||
writeInt(map[key])
|
||||
pass
|
||||
|
||||
func readIntIntMap():
|
||||
func readIntIntMap() -> Dictionary[int, int]:
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -507,7 +507,7 @@ func writeIntLongMap(map):
|
||||
writeLong(map[key])
|
||||
pass
|
||||
|
||||
func readIntLongMap():
|
||||
func readIntLongMap() -> Dictionary[int, int]:
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -527,7 +527,7 @@ func writeIntStringMap(map):
|
||||
writeString(map[key])
|
||||
pass
|
||||
|
||||
func readIntStringMap():
|
||||
func readIntStringMap() -> Dictionary[int, String]:
|
||||
var map: Dictionary[int, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -548,7 +548,7 @@ func writeIntPacketMap(map, protocolId):
|
||||
protocolRegistration.write(self, map[key])
|
||||
pass
|
||||
|
||||
func readIntPacketMap(protocolId):
|
||||
func readIntPacketMap(protocolId) -> Dictionary:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_INT, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
@@ -570,7 +570,7 @@ func writeLongIntMap(map):
|
||||
writeInt(map[key])
|
||||
pass
|
||||
|
||||
func readLongIntMap():
|
||||
func readLongIntMap() -> Dictionary[int, int]:
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -590,7 +590,7 @@ func writeLongLongMap(map):
|
||||
writeLong(map[key])
|
||||
pass
|
||||
|
||||
func readLongLongMap():
|
||||
func readLongLongMap() -> Dictionary[int, int]:
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -610,7 +610,7 @@ func writeLongStringMap(map):
|
||||
writeString(map[key])
|
||||
pass
|
||||
|
||||
func readLongStringMap():
|
||||
func readLongStringMap() -> Dictionary[int, String]:
|
||||
var map: Dictionary[int, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -631,7 +631,7 @@ func writeLongPacketMap(map, protocolId):
|
||||
protocolRegistration.write(self, map[key])
|
||||
pass
|
||||
|
||||
func readLongPacketMap(protocolId):
|
||||
func readLongPacketMap(protocolId) -> Dictionary:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_INT, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
@@ -653,7 +653,7 @@ func writeStringIntMap(map):
|
||||
writeInt(map[key])
|
||||
pass
|
||||
|
||||
func readStringIntMap():
|
||||
func readStringIntMap() -> Dictionary[String, String]:
|
||||
var map: Dictionary[String, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -673,7 +673,7 @@ func writeStringLongMap(map):
|
||||
writeLong(map[key])
|
||||
pass
|
||||
|
||||
func readStringLongMap():
|
||||
func readStringLongMap() -> Dictionary[String, int]:
|
||||
var map: Dictionary[String, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -693,7 +693,7 @@ func writeStringStringMap(map):
|
||||
writeString(map[key])
|
||||
pass
|
||||
|
||||
func readStringStringMap():
|
||||
func readStringStringMap() -> Dictionary[String, String]:
|
||||
var map: Dictionary[String, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -714,7 +714,7 @@ func writeStringPacketMap(map, protocolId):
|
||||
protocolRegistration.write(self, map[key])
|
||||
pass
|
||||
|
||||
func readStringPacketMap(protocolId):
|
||||
func readStringPacketMap(protocolId) -> Dictionary:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_STRING, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const ProtocolManager = preload("res://zfoogd/ProtocolManager.gd")
|
||||
const ProtocolManager = preload("./ProtocolManager.gd")
|
||||
|
||||
const EMPTY: String = ""
|
||||
|
||||
@@ -13,7 +13,7 @@ var readOffset: int = 0
|
||||
func _init():
|
||||
buffer.big_endian = true
|
||||
|
||||
func adjustPadding(predictionLength: int, beforeWriteIndex: int) -> void:
|
||||
func adjustPadding(predictionLength: int, beforeWriteIndex: int):
|
||||
var currentWriteIndex = writeOffset
|
||||
var predictionCount = writeIntCount(predictionLength)
|
||||
var length = currentWriteIndex - beforeWriteIndex - predictionCount
|
||||
@@ -24,7 +24,7 @@ func adjustPadding(predictionLength: int, beforeWriteIndex: int) -> void:
|
||||
writeInt(length)
|
||||
setWriteOffset(currentWriteIndex)
|
||||
else:
|
||||
# get_partial_data of StreamPeerBuffer is deep clone
|
||||
# get_partial_data of StreamPeerBuffer is deep clone
|
||||
buffer.seek(currentWriteIndex - length)
|
||||
var retainedByteBuf = buffer.get_partial_data(length)[1]
|
||||
setWriteOffset(beforeWriteIndex)
|
||||
@@ -43,7 +43,7 @@ func compatibleRead(beforeReadIndex: int, length: int) -> bool:
|
||||
func getBuffer() -> StreamPeerBuffer:
|
||||
return buffer
|
||||
|
||||
func setWriteOffset(writeIndex: int) -> void:
|
||||
func setWriteOffset(writeIndex: int):
|
||||
if (writeIndex > buffer.get_size()):
|
||||
var template = "writeIndex[{}] out of bounds exception: readOffset: {}, writeOffset: {} (expected: 0 <= readOffset <= writeOffset <= capacity: {})"
|
||||
printerr(template.format([writeIndex, readOffset, writeOffset, buffer.get_size()], "{}"))
|
||||
@@ -54,7 +54,7 @@ func setWriteOffset(writeIndex: int) -> void:
|
||||
func getWriteOffset() -> int:
|
||||
return writeOffset
|
||||
|
||||
func setReadOffset(readIndex: int) -> void:
|
||||
func setReadOffset(readIndex: int):
|
||||
if (readIndex > writeOffset):
|
||||
var template = "readIndex[{}] out of bounds exception: readOffset: {}, writeOffset: {} (expected: 0 <= readOffset <= writeOffset <= capacity: {})"
|
||||
printerr(template.format([readIndex, readOffset, writeOffset, buffer.size()], "{}"))
|
||||
@@ -71,7 +71,7 @@ func isReadable() -> bool:
|
||||
func toBytes() -> PackedByteArray:
|
||||
return buffer.data_array.slice(0, writeOffset)
|
||||
|
||||
func newInstance(protocolId: int):
|
||||
func newInstance(protocolId: int) -> Object:
|
||||
return ProtocolManager.newInstance(protocolId)
|
||||
|
||||
# -------------------------------------------------write/read-------------------------------------------------
|
||||
@@ -84,7 +84,7 @@ func writeBytes(value: PackedByteArray):
|
||||
func readBytes(length: int) -> PackedByteArray:
|
||||
return buffer.data_array.slice(0, length)
|
||||
|
||||
func writeBool(value: bool) -> void:
|
||||
func writeBool(value: bool):
|
||||
var byte: int = 1 if value else 0
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_8(byte)
|
||||
@@ -97,7 +97,7 @@ func readBool() -> bool:
|
||||
readOffset += 1
|
||||
return byte == 1
|
||||
|
||||
func writeByte(value: int) -> void:
|
||||
func writeByte(value: int):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_8(value)
|
||||
writeOffset += 1
|
||||
@@ -109,7 +109,7 @@ func readByte() -> int:
|
||||
readOffset += 1
|
||||
return value
|
||||
|
||||
func writeShort(value: int) -> void:
|
||||
func writeShort(value: int):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_16(value)
|
||||
writeOffset += 2
|
||||
@@ -121,7 +121,7 @@ func readShort() -> int:
|
||||
readOffset += 2
|
||||
return value
|
||||
|
||||
func writeRawInt(value) -> void:
|
||||
func writeRawInt(value):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_32(value)
|
||||
writeOffset += 4
|
||||
@@ -133,7 +133,7 @@ func readRawInt() -> int:
|
||||
readOffset += 4
|
||||
return value
|
||||
|
||||
func writeInt(value) -> void:
|
||||
func writeInt(value):
|
||||
if !(minInt <= value && value <= maxInt):
|
||||
printerr("value must range between minInt:-2147483648 and maxInt:2147483647")
|
||||
return
|
||||
@@ -158,7 +158,7 @@ func writeIntCount(value: int) -> int:
|
||||
func readInt() -> int:
|
||||
return readLong()
|
||||
|
||||
func writeLong(longValue: int) -> void:
|
||||
func writeLong(longValue: int):
|
||||
var value: int = (longValue << 1) ^ (longValue >> 63)
|
||||
|
||||
if (value >> 7 == 0):
|
||||
@@ -257,7 +257,7 @@ func readLong() -> int:
|
||||
return mask ^ -(value & 1)
|
||||
|
||||
|
||||
func writeFloat(value: float) -> void:
|
||||
func writeFloat(value: float):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_float(value)
|
||||
writeOffset += 4
|
||||
@@ -269,7 +269,7 @@ func readFloat() -> float:
|
||||
readOffset += 4
|
||||
return value
|
||||
|
||||
func writeDouble(value: float) -> void:
|
||||
func writeDouble(value: float):
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_double(value)
|
||||
writeOffset += 8
|
||||
@@ -282,7 +282,7 @@ func readDouble() -> float:
|
||||
return value
|
||||
|
||||
|
||||
func writeString(value: String) -> void:
|
||||
func writeString(value: String):
|
||||
if (value == null || value.length() ==0):
|
||||
writeInt(0)
|
||||
return
|
||||
@@ -309,7 +309,7 @@ func writePacket(packet, protocolId):
|
||||
protocolRegistration.write(self, packet)
|
||||
pass
|
||||
|
||||
func readPacket(protocolId):
|
||||
func readPacket(protocolId) -> Object:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
return protocolRegistration.read(self)
|
||||
|
||||
@@ -356,7 +356,7 @@ func writeShortArray(array):
|
||||
writeShort(element)
|
||||
pass
|
||||
|
||||
func readShortArray():
|
||||
func readShortArray() -> Array[int]:
|
||||
var array: Array[int] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -373,7 +373,7 @@ func writeIntArray(array):
|
||||
writeInt(element)
|
||||
pass
|
||||
|
||||
func readIntArray():
|
||||
func readIntArray() -> Array[int]:
|
||||
var array: Array[int] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -390,7 +390,7 @@ func writeLongArray(array):
|
||||
writeLong(element)
|
||||
pass
|
||||
|
||||
func readLongArray():
|
||||
func readLongArray() -> Array[int]:
|
||||
var array: Array[int] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -407,7 +407,7 @@ func writeFloatArray(array):
|
||||
writeFloat(element)
|
||||
pass
|
||||
|
||||
func readFloatArray():
|
||||
func readFloatArray() -> Array[float]:
|
||||
var array: Array[float] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -424,7 +424,7 @@ func writeDoubleArray(array):
|
||||
writeDouble(element)
|
||||
pass
|
||||
|
||||
func readDoubleArray():
|
||||
func readDoubleArray() -> Array[float]:
|
||||
var array: Array[float] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -441,7 +441,7 @@ func writeStringArray(array):
|
||||
writeString(element)
|
||||
pass
|
||||
|
||||
func readStringArray():
|
||||
func readStringArray() -> Array[String]:
|
||||
var array: Array[String] = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -459,7 +459,7 @@ func writePacketArray(array, protocolId):
|
||||
protocolRegistration.write(self, element)
|
||||
pass
|
||||
|
||||
func readPacketArray(protocolId):
|
||||
func readPacketArray(protocolId) -> Array:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var array = Array([], typeof(protocol), StringName("RefCounted"), protocol)
|
||||
@@ -487,7 +487,7 @@ func writeIntIntMap(map):
|
||||
writeInt(map[key])
|
||||
pass
|
||||
|
||||
func readIntIntMap():
|
||||
func readIntIntMap() -> Dictionary[int, int]:
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -507,7 +507,7 @@ func writeIntLongMap(map):
|
||||
writeLong(map[key])
|
||||
pass
|
||||
|
||||
func readIntLongMap():
|
||||
func readIntLongMap() -> Dictionary[int, int]:
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -527,7 +527,7 @@ func writeIntStringMap(map):
|
||||
writeString(map[key])
|
||||
pass
|
||||
|
||||
func readIntStringMap():
|
||||
func readIntStringMap() -> Dictionary[int, String]:
|
||||
var map: Dictionary[int, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -548,7 +548,7 @@ func writeIntPacketMap(map, protocolId):
|
||||
protocolRegistration.write(self, map[key])
|
||||
pass
|
||||
|
||||
func readIntPacketMap(protocolId):
|
||||
func readIntPacketMap(protocolId) -> Dictionary:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_INT, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
@@ -570,7 +570,7 @@ func writeLongIntMap(map):
|
||||
writeInt(map[key])
|
||||
pass
|
||||
|
||||
func readLongIntMap():
|
||||
func readLongIntMap() -> Dictionary[int, int]:
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -590,7 +590,7 @@ func writeLongLongMap(map):
|
||||
writeLong(map[key])
|
||||
pass
|
||||
|
||||
func readLongLongMap():
|
||||
func readLongLongMap() -> Dictionary[int, int]:
|
||||
var map: Dictionary[int, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -610,7 +610,7 @@ func writeLongStringMap(map):
|
||||
writeString(map[key])
|
||||
pass
|
||||
|
||||
func readLongStringMap():
|
||||
func readLongStringMap() -> Dictionary[int, String]:
|
||||
var map: Dictionary[int, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -631,7 +631,7 @@ func writeLongPacketMap(map, protocolId):
|
||||
protocolRegistration.write(self, map[key])
|
||||
pass
|
||||
|
||||
func readLongPacketMap(protocolId):
|
||||
func readLongPacketMap(protocolId) -> Dictionary:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_INT, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
@@ -653,7 +653,7 @@ func writeStringIntMap(map):
|
||||
writeInt(map[key])
|
||||
pass
|
||||
|
||||
func readStringIntMap():
|
||||
func readStringIntMap() -> Dictionary[String, String]:
|
||||
var map: Dictionary[String, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -673,7 +673,7 @@ func writeStringLongMap(map):
|
||||
writeLong(map[key])
|
||||
pass
|
||||
|
||||
func readStringLongMap():
|
||||
func readStringLongMap() -> Dictionary[String, int]:
|
||||
var map: Dictionary[String, int] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -693,7 +693,7 @@ func writeStringStringMap(map):
|
||||
writeString(map[key])
|
||||
pass
|
||||
|
||||
func readStringStringMap():
|
||||
func readStringStringMap() -> Dictionary[String, String]:
|
||||
var map: Dictionary[String, String] = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
@@ -714,7 +714,7 @@ func writeStringPacketMap(map, protocolId):
|
||||
protocolRegistration.write(self, map[key])
|
||||
pass
|
||||
|
||||
func readStringPacketMap(protocolId):
|
||||
func readStringPacketMap(protocolId) -> Dictionary:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
var protocol = ProtocolManager.getProtocolClass(protocolId)
|
||||
var map = Dictionary({}, TYPE_STRING, "", null, typeof(protocol), StringName("RefCounted"), protocol)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const EmptyObject = preload("res://zfoogd/packet/EmptyObject.gd")
|
||||
const VeryBigObject = preload("res://zfoogd/packet/VeryBigObject.gd")
|
||||
const ComplexObject = preload("res://zfoogd/packet/ComplexObject.gd")
|
||||
const NormalObject = preload("res://zfoogd/packet/NormalObject.gd")
|
||||
const ObjectA = preload("res://zfoogd/packet/ObjectA.gd")
|
||||
const ObjectB = preload("res://zfoogd/packet/ObjectB.gd")
|
||||
const SimpleObject = preload("res://zfoogd/packet/SimpleObject.gd")
|
||||
const EmptyObject = preload("./packet/EmptyObject.gd")
|
||||
const VeryBigObject = preload("./packet/VeryBigObject.gd")
|
||||
const ComplexObject = preload("./packet/ComplexObject.gd")
|
||||
const NormalObject = preload("./packet/NormalObject.gd")
|
||||
const ObjectA = preload("./packet/ObjectA.gd")
|
||||
const ObjectB = preload("./packet/ObjectB.gd")
|
||||
const SimpleObject = preload("./packet/SimpleObject.gd")
|
||||
|
||||
static var protocols: Dictionary[int, RefCounted] = {}
|
||||
static var protocolClassMap: Dictionary[int, Object] = {}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
const ObjectA = preload("res://zfoogd/packet/ObjectA.gd")
|
||||
const ObjectB = preload("res://zfoogd/packet/ObjectB.gd")
|
||||
class_name ComplexObject
|
||||
|
||||
const ByteBuffer = preload("../ByteBuffer.gd")
|
||||
const ObjectA = preload("./ObjectA.gd")
|
||||
const ObjectB = preload("./ObjectB.gd")
|
||||
|
||||
# 复杂的对象,包括了各种复杂的结构,数组,List,Set,Map
|
||||
# byte类型,最简单的整形
|
||||
@@ -60,16 +62,13 @@ var myObject: ObjectA
|
||||
func protocolId() -> int:
|
||||
return 100
|
||||
|
||||
func get_class_name() -> String:
|
||||
return "ComplexObject"
|
||||
|
||||
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), 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:
|
||||
func write(buffer: ByteBuffer, packet: Object):
|
||||
func write(buffer: ByteBuffer, packet: ComplexObject):
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
@@ -213,12 +212,12 @@ class ComplexObjectRegistration:
|
||||
buffer.adjustPadding(36962, beforeWriteIndex)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
func read(buffer: ByteBuffer) -> ComplexObject:
|
||||
var length = buffer.readInt()
|
||||
if (length == 0):
|
||||
return null
|
||||
var beforeReadIndex = buffer.getReadOffset()
|
||||
var packet = buffer.newInstance(100)
|
||||
var packet: ComplexObject = buffer.newInstance(100)
|
||||
var result0 = buffer.readByte()
|
||||
packet.a = result0
|
||||
var result1 = buffer.readByte()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
class_name EmptyObject
|
||||
|
||||
const ByteBuffer = preload("../ByteBuffer.gd")
|
||||
|
||||
|
||||
|
||||
@@ -6,28 +8,25 @@ const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
func protocolId() -> int:
|
||||
return 0
|
||||
|
||||
func get_class_name() -> String:
|
||||
return "EmptyObject"
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{}"
|
||||
var params = []
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class EmptyObjectRegistration:
|
||||
func write(buffer: ByteBuffer, packet: Object):
|
||||
func write(buffer: ByteBuffer, packet: EmptyObject):
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
buffer.writeInt(-1)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
func read(buffer: ByteBuffer) -> EmptyObject:
|
||||
var length = buffer.readInt()
|
||||
if (length == 0):
|
||||
return null
|
||||
var beforeReadIndex = buffer.getReadOffset()
|
||||
var packet = buffer.newInstance(0)
|
||||
var packet: EmptyObject = buffer.newInstance(0)
|
||||
|
||||
if (length > 0):
|
||||
buffer.setReadOffset(beforeReadIndex + length)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
const ObjectA = preload("res://zfoogd/packet/ObjectA.gd")
|
||||
const ObjectB = preload("res://zfoogd/packet/ObjectB.gd")
|
||||
class_name NormalObject
|
||||
|
||||
const ByteBuffer = preload("../ByteBuffer.gd")
|
||||
const ObjectA = preload("./ObjectA.gd")
|
||||
const ObjectB = preload("./ObjectB.gd")
|
||||
|
||||
# 常规的对象,取所有语言语法的交集,基本上所有语言都支持下面的语法
|
||||
var a: int
|
||||
@@ -26,16 +28,13 @@ var ssss: Array[String]
|
||||
func protocolId() -> int:
|
||||
return 101
|
||||
|
||||
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:{}}"
|
||||
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:
|
||||
func write(buffer: ByteBuffer, packet: Object):
|
||||
func write(buffer: ByteBuffer, packet: NormalObject):
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
@@ -60,12 +59,12 @@ class NormalObjectRegistration:
|
||||
buffer.writeStringArray(packet.ssss)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
func read(buffer: ByteBuffer) -> NormalObject:
|
||||
var length = buffer.readInt()
|
||||
if (length == 0):
|
||||
return null
|
||||
var beforeReadIndex = buffer.getReadOffset()
|
||||
var packet = buffer.newInstance(101)
|
||||
var packet: NormalObject = buffer.newInstance(101)
|
||||
var result0 = buffer.readByte()
|
||||
packet.a = result0
|
||||
var array1 = buffer.readByteArray()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
const ObjectB = preload("res://zfoogd/packet/ObjectB.gd")
|
||||
class_name ObjectA
|
||||
|
||||
const ByteBuffer = preload("../ByteBuffer.gd")
|
||||
const ObjectB = preload("./ObjectB.gd")
|
||||
|
||||
|
||||
var a: int
|
||||
@@ -9,16 +11,13 @@ var objectB: ObjectB
|
||||
func protocolId() -> int:
|
||||
return 102
|
||||
|
||||
func get_class_name() -> String:
|
||||
return "ObjectA"
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{a:{}, m:{}, objectB:{}}"
|
||||
var params = [self.a, self.m, self.objectB]
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class ObjectARegistration:
|
||||
func write(buffer: ByteBuffer, packet: Object):
|
||||
func write(buffer: ByteBuffer, packet: ObjectA):
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
@@ -28,12 +27,12 @@ class ObjectARegistration:
|
||||
buffer.writePacket(packet.objectB, 103)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
func read(buffer: ByteBuffer) -> ObjectA:
|
||||
var length = buffer.readInt()
|
||||
if (length == 0):
|
||||
return null
|
||||
var beforeReadIndex = buffer.getReadOffset()
|
||||
var packet = buffer.newInstance(102)
|
||||
var packet: ObjectA = buffer.newInstance(102)
|
||||
var result0 = buffer.readInt()
|
||||
packet.a = result0
|
||||
var map1 = buffer.readIntStringMap()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
class_name ObjectB
|
||||
|
||||
const ByteBuffer = preload("../ByteBuffer.gd")
|
||||
|
||||
|
||||
var flag: bool
|
||||
@@ -6,16 +8,13 @@ var flag: bool
|
||||
func protocolId() -> int:
|
||||
return 103
|
||||
|
||||
func get_class_name() -> String:
|
||||
return "ObjectB"
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{flag:{}}"
|
||||
var params = [self.flag]
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class ObjectBRegistration:
|
||||
func write(buffer: ByteBuffer, packet: Object):
|
||||
func write(buffer: ByteBuffer, packet: ObjectB):
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
@@ -23,12 +22,12 @@ class ObjectBRegistration:
|
||||
buffer.writeBool(packet.flag)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
func read(buffer: ByteBuffer) -> ObjectB:
|
||||
var length = buffer.readInt()
|
||||
if (length == 0):
|
||||
return null
|
||||
var beforeReadIndex = buffer.getReadOffset()
|
||||
var packet = buffer.newInstance(103)
|
||||
var packet: ObjectB = buffer.newInstance(103)
|
||||
var result0 = buffer.readBool()
|
||||
packet.flag = result0
|
||||
if (length > 0):
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
class_name SimpleObject
|
||||
|
||||
const ByteBuffer = preload("../ByteBuffer.gd")
|
||||
|
||||
|
||||
var c: int
|
||||
@@ -7,16 +9,13 @@ var g: bool
|
||||
func protocolId() -> int:
|
||||
return 104
|
||||
|
||||
func get_class_name() -> String:
|
||||
return "SimpleObject"
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{c:{}, g:{}}"
|
||||
var params = [self.c, self.g]
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class SimpleObjectRegistration:
|
||||
func write(buffer: ByteBuffer, packet: Object):
|
||||
func write(buffer: ByteBuffer, packet: SimpleObject):
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
@@ -25,12 +24,12 @@ class SimpleObjectRegistration:
|
||||
buffer.writeBool(packet.g)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
func read(buffer: ByteBuffer) -> SimpleObject:
|
||||
var length = buffer.readInt()
|
||||
if (length == 0):
|
||||
return null
|
||||
var beforeReadIndex = buffer.getReadOffset()
|
||||
var packet = buffer.newInstance(104)
|
||||
var packet: SimpleObject = buffer.newInstance(104)
|
||||
var result0 = buffer.readInt()
|
||||
packet.c = result0
|
||||
var result1 = buffer.readBool()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
const ByteBuffer = preload("res://zfoogd/ByteBuffer.gd")
|
||||
const ObjectA = preload("res://zfoogd/packet/ObjectA.gd")
|
||||
const ObjectB = preload("res://zfoogd/packet/ObjectB.gd")
|
||||
class_name VeryBigObject
|
||||
|
||||
const ByteBuffer = preload("../ByteBuffer.gd")
|
||||
const ObjectA = preload("./ObjectA.gd")
|
||||
const ObjectB = preload("./ObjectB.gd")
|
||||
|
||||
|
||||
var a1: int
|
||||
@@ -3351,16 +3353,13 @@ var ssss88: Array[String]
|
||||
func protocolId() -> int:
|
||||
return 1
|
||||
|
||||
func get_class_name() -> String:
|
||||
return "VeryBigObject"
|
||||
|
||||
func _to_string() -> String:
|
||||
const jsonTemplate = "{a1:{}, aa1:{}, aaa1:{}, aaaa1:{}, b1:{}, bb1:{}, bbb1:{}, bbbb1:{}, c1:{}, cc1:{}, ccc1:{}, cccc1:{}, d1:{}, dd1:{}, ddd1:{}, dddd1:{}, e1:{}, ee1:{}, eee1:{}, eeee1:{}, f1:{}, ff1:{}, fff1:{}, ffff1:{}, g1:{}, gg1:{}, ggg1:{}, gggg1:{}, jj1:'{}', jjj1:{}, kk1:{}, kkk1:{}, l1:{}, llll1:{}, m1:{}, mm1:{}, s1:{}, ssss1:{}, a2:{}, aa2:{}, aaa2:{}, aaaa2:{}, b2:{}, bb2:{}, bbb2:{}, bbbb2:{}, c2:{}, cc2:{}, ccc2:{}, cccc2:{}, d2:{}, dd2:{}, ddd2:{}, dddd2:{}, e2:{}, ee2:{}, eee2:{}, eeee2:{}, f2:{}, ff2:{}, fff2:{}, ffff2:{}, g2:{}, gg2:{}, ggg2:{}, gggg2:{}, jj2:'{}', jjj2:{}, kk2:{}, kkk2:{}, l2:{}, llll2:{}, m2:{}, mm2:{}, s2:{}, ssss2:{}, a3:{}, aa3:{}, aaa3:{}, aaaa3:{}, b3:{}, bb3:{}, bbb3:{}, bbbb3:{}, c3:{}, cc3:{}, ccc3:{}, cccc3:{}, d3:{}, dd3:{}, ddd3:{}, dddd3:{}, e3:{}, ee3:{}, eee3:{}, eeee3:{}, f3:{}, ff3:{}, fff3:{}, ffff3:{}, g3:{}, gg3:{}, ggg3:{}, gggg3:{}, jj3:'{}', jjj3:{}, kk3:{}, kkk3:{}, l3:{}, llll3:{}, m3:{}, mm3:{}, s3:{}, ssss3:{}, a4:{}, aa4:{}, aaa4:{}, aaaa4:{}, b4:{}, bb4:{}, bbb4:{}, bbbb4:{}, c4:{}, cc4:{}, ccc4:{}, cccc4:{}, d4:{}, dd4:{}, ddd4:{}, dddd4:{}, e4:{}, ee4:{}, eee4:{}, eeee4:{}, f4:{}, ff4:{}, fff4:{}, ffff4:{}, g4:{}, gg4:{}, ggg4:{}, gggg4:{}, jj4:'{}', jjj4:{}, kk4:{}, kkk4:{}, l4:{}, llll4:{}, m4:{}, mm4:{}, s4:{}, ssss4:{}, a5:{}, aa5:{}, aaa5:{}, aaaa5:{}, b5:{}, bb5:{}, bbb5:{}, bbbb5:{}, c5:{}, cc5:{}, ccc5:{}, cccc5:{}, d5:{}, dd5:{}, ddd5:{}, dddd5:{}, e5:{}, ee5:{}, eee5:{}, eeee5:{}, f5:{}, ff5:{}, fff5:{}, ffff5:{}, g5:{}, gg5:{}, ggg5:{}, gggg5:{}, jj5:'{}', jjj5:{}, kk5:{}, kkk5:{}, l5:{}, llll5:{}, m5:{}, mm5:{}, s5:{}, ssss5:{}, a6:{}, aa6:{}, aaa6:{}, aaaa6:{}, b6:{}, bb6:{}, bbb6:{}, bbbb6:{}, c6:{}, cc6:{}, ccc6:{}, cccc6:{}, d6:{}, dd6:{}, ddd6:{}, dddd6:{}, e6:{}, ee6:{}, eee6:{}, eeee6:{}, f6:{}, ff6:{}, fff6:{}, ffff6:{}, g6:{}, gg6:{}, ggg6:{}, gggg6:{}, jj6:'{}', jjj6:{}, kk6:{}, kkk6:{}, l6:{}, llll6:{}, m6:{}, mm6:{}, s6:{}, ssss6:{}, a7:{}, aa7:{}, aaa7:{}, aaaa7:{}, b7:{}, bb7:{}, bbb7:{}, bbbb7:{}, c7:{}, cc7:{}, ccc7:{}, cccc7:{}, d7:{}, dd7:{}, ddd7:{}, dddd7:{}, e7:{}, ee7:{}, eee7:{}, eeee7:{}, f7:{}, ff7:{}, fff7:{}, ffff7:{}, g7:{}, gg7:{}, ggg7:{}, gggg7:{}, jj7:'{}', jjj7:{}, kk7:{}, kkk7:{}, l7:{}, llll7:{}, m7:{}, mm7:{}, s7:{}, ssss7:{}, a8:{}, aa8:{}, aaa8:{}, aaaa8:{}, b8:{}, bb8:{}, bbb8:{}, bbbb8:{}, c8:{}, cc8:{}, ccc8:{}, cccc8:{}, d8:{}, dd8:{}, ddd8:{}, dddd8:{}, e8:{}, ee8:{}, eee8:{}, eeee8:{}, f8:{}, ff8:{}, fff8:{}, ffff8:{}, g8:{}, gg8:{}, ggg8:{}, gggg8:{}, jj8:'{}', jjj8:{}, kk8:{}, kkk8:{}, l8:{}, llll8:{}, m8:{}, mm8:{}, s8:{}, ssss8:{}, a9:{}, aa9:{}, aaa9:{}, aaaa9:{}, b9:{}, bb9:{}, bbb9:{}, bbbb9:{}, c9:{}, cc9:{}, ccc9:{}, cccc9:{}, d9:{}, dd9:{}, ddd9:{}, dddd9:{}, e9:{}, ee9:{}, eee9:{}, eeee9:{}, f9:{}, ff9:{}, fff9:{}, ffff9:{}, g9:{}, gg9:{}, ggg9:{}, gggg9:{}, jj9:'{}', jjj9:{}, kk9:{}, kkk9:{}, l9:{}, llll9:{}, m9:{}, mm9:{}, s9:{}, ssss9:{}, a10:{}, aa10:{}, aaa10:{}, aaaa10:{}, b10:{}, bb10:{}, bbb10:{}, bbbb10:{}, c10:{}, cc10:{}, ccc10:{}, cccc10:{}, d10:{}, dd10:{}, ddd10:{}, dddd10:{}, e10:{}, ee10:{}, eee10:{}, eeee10:{}, f10:{}, ff10:{}, fff10:{}, ffff10:{}, g10:{}, gg10:{}, ggg10:{}, gggg10:{}, jj10:'{}', jjj10:{}, kk10:{}, kkk10:{}, l10:{}, llll10:{}, m10:{}, mm10:{}, s10:{}, ssss10:{}, a11:{}, aa11:{}, aaa11:{}, aaaa11:{}, b11:{}, bb11:{}, bbb11:{}, bbbb11:{}, c11:{}, cc11:{}, ccc11:{}, cccc11:{}, d11:{}, dd11:{}, ddd11:{}, dddd11:{}, e11:{}, ee11:{}, eee11:{}, eeee11:{}, f11:{}, ff11:{}, fff11:{}, ffff11:{}, g11:{}, gg11:{}, ggg11:{}, gggg11:{}, jj11:'{}', jjj11:{}, kk11:{}, kkk11:{}, l11:{}, llll11:{}, m11:{}, mm11:{}, s11:{}, ssss11:{}, a12:{}, aa12:{}, aaa12:{}, aaaa12:{}, b12:{}, bb12:{}, bbb12:{}, bbbb12:{}, c12:{}, cc12:{}, ccc12:{}, cccc12:{}, d12:{}, dd12:{}, ddd12:{}, dddd12:{}, e12:{}, ee12:{}, eee12:{}, eeee12:{}, f12:{}, ff12:{}, fff12:{}, ffff12:{}, g12:{}, gg12:{}, ggg12:{}, gggg12:{}, jj12:'{}', jjj12:{}, kk12:{}, kkk12:{}, l12:{}, llll12:{}, m12:{}, mm12:{}, s12:{}, ssss12:{}, a13:{}, aa13:{}, aaa13:{}, aaaa13:{}, b13:{}, bb13:{}, bbb13:{}, bbbb13:{}, c13:{}, cc13:{}, ccc13:{}, cccc13:{}, d13:{}, dd13:{}, ddd13:{}, dddd13:{}, e13:{}, ee13:{}, eee13:{}, eeee13:{}, f13:{}, ff13:{}, fff13:{}, ffff13:{}, g13:{}, gg13:{}, ggg13:{}, gggg13:{}, jj13:'{}', jjj13:{}, kk13:{}, kkk13:{}, l13:{}, llll13:{}, m13:{}, mm13:{}, s13:{}, ssss13:{}, a14:{}, aa14:{}, aaa14:{}, aaaa14:{}, b14:{}, bb14:{}, bbb14:{}, bbbb14:{}, c14:{}, cc14:{}, ccc14:{}, cccc14:{}, d14:{}, dd14:{}, ddd14:{}, dddd14:{}, e14:{}, ee14:{}, eee14:{}, eeee14:{}, f14:{}, ff14:{}, fff14:{}, ffff14:{}, g14:{}, gg14:{}, ggg14:{}, gggg14:{}, jj14:'{}', jjj14:{}, kk14:{}, kkk14:{}, l14:{}, llll14:{}, m14:{}, mm14:{}, s14:{}, ssss14:{}, a15:{}, aa15:{}, aaa15:{}, aaaa15:{}, b15:{}, bb15:{}, bbb15:{}, bbbb15:{}, c15:{}, cc15:{}, ccc15:{}, cccc15:{}, d15:{}, dd15:{}, ddd15:{}, dddd15:{}, e15:{}, ee15:{}, eee15:{}, eeee15:{}, f15:{}, ff15:{}, fff15:{}, ffff15:{}, g15:{}, gg15:{}, ggg15:{}, gggg15:{Line truncated
|
||||
var params = [self.a1, self.aa1, JSON.stringify(self.aaa1), JSON.stringify(self.aaaa1), self.b1, self.bb1, JSON.stringify(self.bbb1), JSON.stringify(self.bbbb1), self.c1, self.cc1, JSON.stringify(self.ccc1), JSON.stringify(self.cccc1), self.d1, self.dd1, JSON.stringify(self.ddd1), JSON.stringify(self.dddd1), self.e1, self.ee1, JSON.stringify(self.eee1), JSON.stringify(self.eeee1), self.f1, self.ff1, JSON.stringify(self.fff1), JSON.stringify(self.ffff1), self.g1, self.gg1, JSON.stringify(self.ggg1), JSON.stringify(self.gggg1), self.jj1, JSON.stringify(self.jjj1), self.kk1, JSON.stringify(self.kkk1), JSON.stringify(self.l1), JSON.stringify(self.llll1), self.m1, self.mm1, JSON.stringify(self.s1), JSON.stringify(self.ssss1), self.a2, self.aa2, JSON.stringify(self.aaa2), JSON.stringify(self.aaaa2), self.b2, self.bb2, JSON.stringify(self.bbb2), JSON.stringify(self.bbbb2), self.c2, self.cc2, JSON.stringify(self.ccc2), JSON.stringify(self.cccc2), self.d2, self.dd2, JSON.stringify(self.ddd2), JSON.stringify(self.dddd2), self.e2, self.ee2, JSON.stringify(self.eee2), JSON.stringify(self.eeee2), self.f2, self.ff2, JSON.stringify(self.fff2), JSON.stringify(self.ffff2), self.g2, self.gg2, JSON.stringify(self.ggg2), JSON.stringify(self.gggg2), self.jj2, JSON.stringify(self.jjj2), self.kk2, JSON.stringify(self.kkk2), JSON.stringify(self.l2), JSON.stringify(self.llll2), self.m2, self.mm2, JSON.stringify(self.s2), JSON.stringify(self.ssss2), self.a3, self.aa3, JSON.stringify(self.aaa3), JSON.stringify(self.aaaa3), self.b3, self.bb3, JSON.stringify(self.bbb3), JSON.stringify(self.bbbb3), self.c3, self.cc3, JSON.stringify(self.ccc3), JSON.stringify(self.cccc3), self.d3, self.dd3, JSON.stringify(self.ddd3), JSON.stringify(self.dddd3), self.e3, self.ee3, JSON.stringify(self.eee3), JSON.stringify(self.eeee3), self.f3, self.ff3, JSON.stringify(self.fff3), JSON.stringify(self.ffff3), self.g3, self.gg3, JSON.stringify(self.ggg3), JSON.stringify(self.gggg3), self.jj3, JSON.stringify(self.jjj3), self.kk3, JSON.stringify(self.kkk3), JSON.stringify(self.l3), JSON.stringify(self.llll3), self.m3, self.mm3, JSON.stringify(self.s3), JSON.stringify(self.ssss3), self.a4, self.aa4, JSON.stringify(self.aaa4), JSON.stringify(self.aaaa4), self.b4, self.bb4, JSON.stringify(self.bbb4), JSON.stringify(self.bbbb4), self.c4, self.cc4, JSON.stringify(self.ccc4), JSON.stringify(self.cccc4), self.d4, self.dd4, JSON.stringify(self.ddd4), JSON.stringify(self.dddd4), self.e4, self.ee4, JSON.stringify(self.eee4), JSON.stringify(self.eeee4), self.f4, self.ff4, JSON.stringify(self.fff4), JSON.stringify(self.ffff4), self.g4, self.gg4, JSON.stringify(self.ggg4), JSON.stringify(self.gggg4), self.jj4, JSON.stringify(self.jjj4), self.kk4, JSON.stringify(self.kkk4), JSON.stringify(self.l4), JSON.stringify(self.llll4), self.m4, self.mm4, JSON.stringify(self.s4), JSON.stringify(self.ssss4), self.a5, self.aa5, JSON.stringify(self.aaa5), JSON.stringify(self.aaaa5), self.b5, self.bb5, JSON.stringify(self.bbb5), JSON.stringify(self.bbbb5), self.c5, self.cc5, JSON.stringify(self.ccc5), JSON.stringify(self.cccc5), self.d5, self.dd5, JSON.stringify(self.ddd5), JSON.stringify(self.dddd5), self.e5, self.ee5, JSON.stringify(self.eee5), JSON.stringify(self.eeee5), self.f5, self.ff5, JSON.stringify(self.fff5), JSON.stringify(self.ffff5), self.g5, self.gg5, JSON.stringify(self.ggg5), JSON.stringify(self.gggg5), self.jj5, JSON.stringify(self.jjj5), self.kk5, JSON.stringify(self.kkk5), JSON.stringify(self.l5), JSON.stringify(self.llll5), self.m5, self.mm5, JSON.stringify(self.s5), JSON.stringify(self.ssss5), self.a6, self.aa6, JSON.stringify(self.aaa6), JSON.stringify(self.aaaa6), self.b6, self.bb6, JSON.stringify(self.bbb6), JSON.stringify(self.bbbb6), self.c6, self.cc6, JSON.stringify(self.ccc6), JSON.stringify(self.cccc6), self.d6, self.dd6, JSON.stringify(self.ddd6), JSON.stringify(self.dddd6), self.e6, self.ee6, JSON.stringify(self.eee6), JSON.stringify(self.eeee6), self.f6, self.ff6, JSON.stringify(self.fff6), JSON.stringify(self.ffff6), self.g6, self.gg6, JSON.stringify(self.ggg6), JSON.stringify(self.gggg6), self.jj6, JSON.stringify(self.jjj6), self.kk6, JSON.stringify(self.kkk6), JSON.stringify(self.l6), JSON.stringify(self.llll6), self.m6, self.mm6, JSON.stringify(self.s6), JSON.stringify(self.ssss6), self.a7, self.aa7, JSON.stringify(self.aaa7), JSON.stringify(self.aaaa7), self.b7, self.bb7, JSON.stringify(self.bbb7), JSON.stringify(self.bbbb7), self.c7, self.cc7, JSON.stringify(self.ccc7), JSON.stringify(self.cccc7), self.d7, self.dd7, JSON.stringify(self.ddd7), JSON.stringify(self.dddd7), self.e7, self.ee7, JSON.stringify(self.eee7), JSON.stringify(self.eeee7), self.f7, self.ff7, JSON.stringify(self.fff7), JSON.stringify(self.ffff7), self.g7, self.gg7, JSON.stringify(self.ggg7), JSON.stringify(self.gggg7), self.jj7, JSON.stringify(self.jjj7), self.kk7, JSON.stringify(self.kkk7), JSON.stringify(self.l7), JSON.stringify(self.llll7), self.m7, self.mm7, JSON.stringify(selLine truncated
|
||||
return jsonTemplate.format(params, "{}")
|
||||
|
||||
class VeryBigObjectRegistration:
|
||||
func write(buffer: ByteBuffer, packet: Object):
|
||||
func write(buffer: ByteBuffer, packet: VeryBigObject):
|
||||
if (packet == null):
|
||||
buffer.writeInt(0)
|
||||
return
|
||||
@@ -6711,12 +6710,12 @@ class VeryBigObjectRegistration:
|
||||
buffer.writeStringArray(packet.ssss9)
|
||||
pass
|
||||
|
||||
func read(buffer: ByteBuffer):
|
||||
func read(buffer: ByteBuffer) -> VeryBigObject:
|
||||
var length = buffer.readInt()
|
||||
if (length == 0):
|
||||
return null
|
||||
var beforeReadIndex = buffer.getReadOffset()
|
||||
var packet = buffer.newInstance(1)
|
||||
var packet: VeryBigObject = buffer.newInstance(1)
|
||||
var result0 = buffer.readByte()
|
||||
packet.a1 = result0
|
||||
var result1 = buffer.readByte()
|
||||
|
||||
Reference in new issue
Block a user