2022-03-20 23:30:30 +01:00
<?xml version="1.0" encoding="UTF-8" ?>
2024-04-26 17:32:25 +02:00
<class name= "SceneSynchronizer" inherits= "Node" version= "4.4" >
2022-03-20 23:30:30 +01:00
<brief_description >
2023-12-25 19:27:07 +01:00
The `SceneSynchronizer` is used to synchronize all the peers using server authoritative networking model.
2022-03-20 23:30:30 +01:00
</brief_description>
<description >
</description>
<tutorials >
</tutorials>
<methods >
<method name= "apply_scene_changes" >
<return type= "void" />
<argument index= "0" name= "sync_data" type= "Variant" />
<description >
</description>
</method>
<method name= "clear" >
<return type= "void" />
<description >
</description>
</method>
<method name= "controller_add_dependency" >
<return type= "void" />
<argument index= "0" name= "controller" type= "Node" />
<argument index= "1" name= "node" type= "Node" />
<description >
</description>
</method>
<method name= "controller_get_dependency" >
<return type= "Node" />
<argument index= "0" name= "controller" type= "Node" />
<argument index= "1" name= "index" type= "int" />
<description >
</description>
</method>
<method name= "controller_get_dependency_count" qualifiers= "const" >
<return type= "int" />
<argument index= "0" name= "controller" type= "Node" />
<description >
</description>
</method>
<method name= "controller_remove_dependency" >
<return type= "void" />
<argument index= "0" name= "controller" type= "Node" />
<argument index= "1" name= "node" type= "Node" />
<description >
</description>
</method>
2023-12-25 19:27:07 +01:00
<method name= "find_action_id" qualifiers= "const" >
<return type= "int" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "event_name" type= "StringName" />
2023-12-25 19:27:07 +01:00
<description >
</description>
</method>
2022-03-20 23:30:30 +01:00
<method name= "force_state_notify" >
<return type= "void" />
<description >
</description>
</method>
<method name= "get_node_from_id" >
<return type= "Node" />
<argument index= "0" name= "id" type= "int" />
<description >
</description>
</method>
<method name= "get_node_id" >
<return type= "int" />
<argument index= "0" name= "node" type= "Node" />
<description >
</description>
</method>
<method name= "get_peer_networking_enable" qualifiers= "const" >
<return type= "bool" />
<argument index= "0" name= "peer" type= "int" />
<description >
</description>
</method>
<method name= "get_variable_id" >
<return type= "int" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "variable" type= "StringName" />
2022-03-20 23:30:30 +01:00
<description >
</description>
</method>
<method name= "is_client" qualifiers= "const" >
<return type= "bool" />
<description >
</description>
</method>
<method name= "is_end_sync" qualifiers= "const" >
<return type= "bool" />
<description >
</description>
</method>
<method name= "is_networked" qualifiers= "const" >
<return type= "bool" />
<description >
</description>
</method>
<method name= "is_node_sync" qualifiers= "const" >
<return type= "bool" />
<argument index= "0" name= "node" type= "Node" />
<description >
</description>
</method>
<method name= "is_recovered" qualifiers= "const" >
<return type= "bool" />
<description >
</description>
</method>
<method name= "is_resetted" qualifiers= "const" >
<return type= "bool" />
<description >
</description>
</method>
<method name= "is_rewinding" qualifiers= "const" >
<return type= "bool" />
<description >
</description>
</method>
<method name= "is_server" qualifiers= "const" >
<return type= "bool" />
<description >
</description>
</method>
<method name= "pop_scene_changes" qualifiers= "const" >
<return type= "Variant" />
<argument index= "0" name= "diff_handle" type= "Object" />
<description >
</description>
</method>
2023-12-25 19:27:07 +01:00
<method name= "register_action" >
<return type= "int" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "action_func" type= "StringName" />
<argument index= "2" name= "action_encoding_func" type= "StringName" />
2023-12-25 19:27:07 +01:00
<argument index= "3" name= "can_client_trigger" type= "bool" default= "false" />
<argument index= "4" name= "wait_server_validation" type= "bool" default= "false" />
2023-12-25 20:20:30 +01:00
<argument index= "5" name= "server_action_validation_func" type= "StringName" default= "@""" />
2023-12-25 19:27:07 +01:00
<description >
Register an new action.
`node` The node that owns the event
`action_func` The function that is triggered when the event is executed.
`action_encoding_func` The function called to definte the validation encoding.
`can_client_trigger` If true this `Action` can be triggered on client.
`wait_server_validation` If true the event will be emitted locally only if the server validates it.
`server_action_validation_func` The validation function, must return a boolean.
</description>
</method>
2022-03-20 23:30:30 +01:00
<method name= "register_node" >
<return type= "int" />
<argument index= "0" name= "node" type= "Node" />
<description >
</description>
</method>
<method name= "register_process" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "function" type= "StringName" />
2022-03-20 23:30:30 +01:00
<description >
</description>
</method>
<method name= "register_variable" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "variable" type= "StringName" />
<argument index= "2" name= "on_change_notify" type= "StringName" default= "@""" />
2022-03-20 23:30:30 +01:00
<argument index= "3" name= "flags" type= "int" enum= "NetEventFlag" default= "17" />
<description >
</description>
</method>
<method name= "reset_synchronizer_mode" >
<return type= "void" />
<description >
</description>
</method>
<method name= "set_enabled" >
<return type= "void" />
<argument index= "0" name= "enabled" type= "bool" />
<description >
</description>
</method>
<method name= "set_node_as_controlled_by" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
<argument index= "1" name= "controller" type= "Node" />
<description >
</description>
</method>
<method name= "set_peer_networking_enable" >
<return type= "void" />
<argument index= "0" name= "peer" type= "int" />
<argument index= "1" name= "enabled" type= "bool" />
<description >
</description>
</method>
<method name= "set_skip_rewinding" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "variable" type= "StringName" />
2022-03-20 23:30:30 +01:00
<argument index= "2" name= "skip_rewinding" type= "bool" />
<description >
</description>
</method>
<method name= "start_node_sync" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
<description >
</description>
</method>
<method name= "start_tracking_scene_changes" qualifiers= "const" >
<return type= "void" />
<argument index= "0" name= "diff_handle" type= "Object" />
<description >
</description>
</method>
<method name= "stop_node_sync" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
<description >
</description>
</method>
<method name= "stop_tracking_scene_changes" qualifiers= "const" >
<return type= "void" />
<argument index= "0" name= "diff_handle" type= "Object" />
<description >
</description>
</method>
<method name= "track_variable_changes" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "variable" type= "StringName" />
2022-03-20 23:30:30 +01:00
<argument index= "2" name= "object" type= "Object" />
2023-12-25 20:20:30 +01:00
<argument index= "3" name= "method" type= "StringName" />
2022-03-20 23:30:30 +01:00
<argument index= "4" name= "flags" type= "int" enum= "NetEventFlag" default= "17" />
<description >
</description>
</method>
2023-12-25 19:27:07 +01:00
<method name= "trigger_action" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
<argument index= "1" name= "action_id" type= "int" />
<argument index= "2" name= "arguments" type= "Array" default= "[ ]" />
<argument index= "3" name= "recipients_peers" type= "PoolIntArray" default= "PoolIntArray( )" />
<description >
Trigger an action.
This action can be triggered by the client, only if it was registered with `can_client_trigger = true`.
Note: If you pass a recipient the action is notified only to that peer; if you leave it unset the action will be propagated to all the peers. Generally you never specify the `recipients`. In any case, only the server can use this feature.
</description>
</method>
<method name= "trigger_action_by_name" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "event_name" type= "StringName" />
2023-12-25 19:27:07 +01:00
<argument index= "2" name= "arguments" type= "Array" default= "[ ]" />
<argument index= "3" name= "recipients_peers" type= "PoolIntArray" default= "PoolIntArray( )" />
<description >
Trigger an action.
This action can be triggered by the client, only if it was registered with `can_client_trigger = true`.
Note: If you pass a recipient the action is notified only to that peer; if you leave it unset the action will be propagated to all the peers. Generally you never specify the `recipients`. In any case, only the server can use this feature.
</description>
</method>
2022-03-20 23:30:30 +01:00
<method name= "unregister_node" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
<description >
</description>
</method>
<method name= "unregister_process" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "function" type= "StringName" />
2022-03-20 23:30:30 +01:00
<description >
</description>
</method>
<method name= "unregister_variable" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "variable" type= "StringName" />
2022-03-20 23:30:30 +01:00
<description >
</description>
</method>
<method name= "untrack_variable_changes" >
<return type= "void" />
<argument index= "0" name= "node" type= "Node" />
2023-12-25 20:20:30 +01:00
<argument index= "1" name= "variable" type= "StringName" />
2022-03-20 23:30:30 +01:00
<argument index= "2" name= "object" type= "Object" />
2023-12-25 20:20:30 +01:00
<argument index= "3" name= "method" type= "StringName" />
2022-03-20 23:30:30 +01:00
<description >
</description>
</method>
</methods>
<members >
2023-12-25 19:27:07 +01:00
<member name= "actions_redundancy" type= "int" setter= "set_actions_redundancy" getter= "get_actions_redundancy" default= "3" >
</member>
<member name= "actions_resend_time" type= "float" setter= "set_actions_resend_time" getter= "get_actions_resend_time" default= "0.0333333" >
</member>
2022-03-20 23:30:30 +01:00
<member name= "comparison_float_tolerance" type= "float" setter= "set_comparison_float_tolerance" getter= "get_comparison_float_tolerance" default= "0.001" >
</member>
<member name= "server_notify_state_interval" type= "float" setter= "set_server_notify_state_interval" getter= "get_server_notify_state_interval" default= "1.0" >
</member>
</members>
<signals >
2023-12-25 20:20:30 +01:00
<signal name= "desync_detected" >
<argument index= "0" name= "input_id" type= "int" />
<argument index= "1" name= "node" type= "Object" />
<argument index= "2" name= "var_names" type= "Array" />
<argument index= "3" name= "client_values" type= "Array" />
<argument index= "4" name= "server_values" type= "Array" />
<description >
</description>
</signal>
2022-03-20 23:30:30 +01:00
<signal name= "sync_paused" >
<description >
</description>
</signal>
<signal name= "sync_started" >
<description >
</description>
</signal>
</signals>
<constants >
<constant name= "CHANGE" value= "1" enum= "NetEventFlag" >
</constant>
<constant name= "SYNC_RECOVER" value= "2" enum= "NetEventFlag" >
</constant>
<constant name= "SYNC_RESET" value= "4" enum= "NetEventFlag" >
</constant>
<constant name= "SYNC_REWIND" value= "8" enum= "NetEventFlag" >
</constant>
<constant name= "END_SYNC" value= "16" enum= "NetEventFlag" >
</constant>
<constant name= "DEFAULT" value= "17" enum= "NetEventFlag" >
</constant>
<constant name= "SYNC" value= "14" enum= "NetEventFlag" >
</constant>
<constant name= "ALWAYS" value= "31" enum= "NetEventFlag" >
</constant>
</constants>
</class>