From 31142ac3ee9bf43443a0ec39b7e9b846877ed1b7 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 12 Jul 2021 15:28:01 +0200 Subject: [Net] Remove most multiplayer hooks from SceneTree. Use `multiplayer` or `get_multiplayer()` instead of `get_tree()`. --- doc/classes/Node.xml | 2 +- doc/classes/SceneTree.xml | 70 ----------------------------------------------- 2 files changed, 1 insertion(+), 71 deletions(-) (limited to 'doc') diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 88e69968d2..15784eaab9 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -660,7 +660,7 @@ Sends a remote procedure call request for the given [code]method[/code] to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same node name. Behaviour depends on the RPC configuration for the given method, see [method rpc_config]. Methods are not exposed to RPCs by default. Returns an empty [Variant]. - [b]Note:[/b] You can only safely use RPCs on clients after you received the [code]connected_to_server[/code] signal from the [SceneTree]. You also need to keep track of the connection state, either by the [SceneTree] signals like [code]server_disconnected[/code] or by checking [code]SceneTree.network_peer.get_connection_status() == CONNECTION_CONNECTED[/code]. + [b]Note:[/b] You can only safely use RPCs on clients after you received the [code]connected_to_server[/code] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [code]server_disconnected[/code] or by checking [code]get_multiplayer().network_peer.get_connection_status() == CONNECTION_CONNECTED[/code]. diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index d327e8cbca..bf51b4dfa7 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -112,20 +112,6 @@ Returns the current frame number, i.e. the total frame count since the application started. - - - - - Returns the peer IDs of all connected peers of this [SceneTree]'s [member network_peer]. - - - - - - - Returns the unique peer ID of this [SceneTree]'s [member network_peer]. - - @@ -149,13 +135,6 @@ Returns an array of currently exising [Tween]s in the [SceneTree] (both running and paused). - - - - - Returns the sender's peer ID for the most recently received RPC call. - - @@ -165,20 +144,6 @@ Returns [code]true[/code] if the given group exists. - - - - - Returns [code]true[/code] if there is a [member network_peer] set. - - - - - - - Returns [code]true[/code] if this [SceneTree]'s [member network_peer] is in server mode (listening for connections). - - @@ -301,32 +266,16 @@ If [code]true[/code] (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal process_frame]. If [code]false[/code], you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads. - - The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the [SceneTree] will become a network server (check with [method is_network_server]) and will set the root node's network mode to master, or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to [SceneTree]'s signals. - If [code]true[/code], the [SceneTree] is paused. Doing so will have the following behavior: - 2D and 3D physics will be stopped. - [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes. - - If [code]true[/code], the [SceneTree]'s [member network_peer] refuses new incoming connections. - The [SceneTree]'s root [Window]. - - - Emitted whenever this [SceneTree]'s [member network_peer] successfully connected to a server. Only emitted on clients. - - - - - Emitted whenever this [SceneTree]'s [member network_peer] fails to establish a connection to a server. Only emitted on clients. - - @@ -336,20 +285,6 @@ Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. - - - - - Emitted whenever this [SceneTree]'s [member network_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). - - - - - - - Emitted whenever this [SceneTree]'s [member network_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server. - - @@ -388,11 +323,6 @@ Emitted immediately before [method Node._process] is called on every node in the [SceneTree]. - - - Emitted whenever this [SceneTree]'s [member network_peer] disconnected from server. Only emitted on clients. - - Emitted whenever the [SceneTree] hierarchy changed (children being moved or renamed, etc.). -- cgit v1.2.3