Add object encoding param to serialization methods

Network peers get_var/put_var
File get_var/store_var
GDScript/Mono/VisualScript bytes2var/var2bytes
Add MultiplayerAPI.allow_object_decoding member which deprecates PacketPeer.allow_object_decoding.

Break ABI compatibaility (API compatibility for GDNative).
This commit is contained in:
Fabio Alessandrelli 2019-03-26 16:52:42 +01:00
parent 53ab3a1ba9
commit 393e62b98a
23 changed files with 220 additions and 104 deletions

View file

@ -204,8 +204,11 @@
<method name="get_var" qualifiers="const">
<return type="Variant">
</return>
<argument index="0" name="allow_objects" type="bool" default="false">
</argument>
<description>
Returns the next [Variant] value from the file.
Returns the next [Variant] value from the file. When [code]allow_objects[/code] is [code]true[/code] decoding objects is allowed.
[b]WARNING:[/b] Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution).
</description>
</method>
<method name="is_open" qualifiers="const">
@ -398,8 +401,10 @@
</return>
<argument index="0" name="value" type="Variant">
</argument>
<argument index="1" name="full_objects" type="bool" default="false">
</argument>
<description>
Stores any Variant value in the file.
Stores any Variant value in the file. When [code]full_objects[/code] is [code]true[/code] encoding objects is allowed (and can potentially include code).
</description>
</method>
</methods>