Instance Propertymigueldeicaza.swiftgodot 0.45.0SwiftGodot
encodeBufferMaxSize
Maximum buffer size allowed when encoding Variant
s. Raise this value to support heavier memory allocations.
final var encodeBufferMaxSize: Int32 { get set }
The putVar(_:fullObjects:)
method allocates memory on the stack, and the buffer used will grow automatically to the closest power of two to match the size of the Variant
. If the Variant
is bigger than encodeBufferMaxSize
, the method will error out with errOutOfMemory
.
Other members in extension
Type members
Instance members
func getAvailablePacketCount(
) -> Int32 Returns the number of packets currently available in the ring-buffer.
func getPacket(
) -> PackedByteArray Gets a raw packet.
func getPacketError(
) -> GodotError Returns the error state of the last packet received (via
getPacket
andgetVar(allowObjects:)
).func getVar(allowObjects: Bool
) -> Variant Gets a Variant. If
allowObjects
istrue
, decoding objects is allowed.func putPacket(buffer: PackedByteArray
) -> GodotError Sends a raw packet.
func putVar(Variant, fullObjects: Bool
) -> GodotError Sends a
Variant
as a packet. IffullObjects
istrue
, encoding objects is allowed (and can potentially include code).