|
|
|
 |
Reply From: |
quinno |
Having a quick look at the source code for the function, you can see that it takes a Variant type. This is basically all the base types in Godot (including the containers). The containers are handled recursively (“deep copy”). There doesn’t look to be any system to handle cyclic references. RPC does appear to be the same.
The Variant is ultimately processed by the encode_variant function in marshalls.cpp if you’re curious: https://github.com/godotengine/godot/blob/master/core/io/marshalls.cpp#L694
Here’s the full list (taken from variant.h: https://github.com/godotengine/godot/blob/master/core/variant.h#L75)
NIL,
// atomic types
BOOL,
INT,
REAL,
STRING,
// math types
VECTOR2, // 5
RECT2,
VECTOR3,
TRANSFORM2D,
PLANE,
QUAT, // 10
RECT3,
BASIS,
TRANSFORM,
// misc types
COLOR,
NODE_PATH, // 15
_RID,
OBJECT,
DICTIONARY,
ARRAY, // 20
// arrays
POOL_BYTE_ARRAY,
POOL_INT_ARRAY,
POOL_REAL_ARRAY,
POOL_STRING_ARRAY,
POOL_VECTOR2_ARRAY, // 25
POOL_VECTOR3_ARRAY,
POOL_COLOR_ARRAY
Thank you, but does not fully answer the question since you didn’t say whether the encoding is a deep copy. I will look at marshalls.cpp and try to figure it out there, though.
raymoo | 2017-06-08 13:05
Looks like it does do a deep copy, and that there is no cycle checking.
raymoo | 2017-06-08 13:11
Yeah I had found the same. I updated the answer
quinno | 2017-06-08 13:16