mirror of
https://github.com/Relintai/pandemonium_engine_docs.git
synced 2025-01-23 15:17:21 +01:00
92 lines
6.2 KiB
ReStructuredText
92 lines
6.2 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/NetworkedMultiplayerCustom.xml.
|
|
|
|
.. _class_NetworkedMultiplayerCustom:
|
|
|
|
NetworkedMultiplayerCustom
|
|
==========================
|
|
|
|
**Inherits:** :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` **<** :ref:`PacketPeer<class_PacketPeer>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
|
|
|
|
A :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` implementation that can be controlled from a script.
|
|
|
|
Description
|
|
-----------
|
|
|
|
A :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` implementation that can be used as a :ref:`MultiplayerAPI.network_peer<class_MultiplayerAPI_property_network_peer>` and controlled from a script.
|
|
|
|
Its purpose is to allow adding a new backend for the high-Level multiplayer API without needing to use GDNative.
|
|
|
|
Methods
|
|
-------
|
|
|
|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`deliver_packet<class_NetworkedMultiplayerCustom_method_deliver_packet>` **(** :ref:`PoolByteArray<class_PoolByteArray>` buffer, :ref:`int<class_int>` from_peer_id **)** |
|
|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`initialize<class_NetworkedMultiplayerCustom_method_initialize>` **(** :ref:`int<class_int>` self_peer_id **)** |
|
|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_connection_status<class_NetworkedMultiplayerCustom_method_set_connection_status>` **(** :ref:`ConnectionStatus<enum_NetworkedMultiplayerPeer_ConnectionStatus>` connection_status **)** |
|
|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_max_packet_size<class_NetworkedMultiplayerCustom_method_set_max_packet_size>` **(** :ref:`int<class_int>` max_packet_size **)** |
|
|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_NetworkedMultiplayerCustom_signal_packet_generated:
|
|
|
|
- **packet_generated** **(** :ref:`int<class_int>` peer_id, :ref:`PoolByteArray<class_PoolByteArray>` buffer, :ref:`int<class_int>` transfer_mode **)**
|
|
|
|
Emitted when the local :ref:`MultiplayerAPI<class_MultiplayerAPI>` generates a packet.
|
|
|
|
Your script should take this packet and send it to the requested peer over the network (which should call :ref:`deliver_packet<class_NetworkedMultiplayerCustom_method_deliver_packet>` with the data when it's received).
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_NetworkedMultiplayerCustom_method_deliver_packet:
|
|
|
|
- void **deliver_packet** **(** :ref:`PoolByteArray<class_PoolByteArray>` buffer, :ref:`int<class_int>` from_peer_id **)**
|
|
|
|
Deliver a packet to the local :ref:`MultiplayerAPI<class_MultiplayerAPI>`.
|
|
|
|
When your script receives a packet from other peers over the network (originating from the :ref:`packet_generated<class_NetworkedMultiplayerCustom_signal_packet_generated>` signal on the sending peer), passing it to this method will deliver it locally.
|
|
|
|
----
|
|
|
|
.. _class_NetworkedMultiplayerCustom_method_initialize:
|
|
|
|
- void **initialize** **(** :ref:`int<class_int>` self_peer_id **)**
|
|
|
|
Initialize the peer with the given ``peer_id`` (must be between 1 and 2147483647).
|
|
|
|
Can only be called if the connection status is :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTING<class_NetworkedMultiplayerPeer_constant_CONNECTION_CONNECTING>`. See :ref:`set_connection_status<class_NetworkedMultiplayerCustom_method_set_connection_status>`.
|
|
|
|
----
|
|
|
|
.. _class_NetworkedMultiplayerCustom_method_set_connection_status:
|
|
|
|
- void **set_connection_status** **(** :ref:`ConnectionStatus<enum_NetworkedMultiplayerPeer_ConnectionStatus>` connection_status **)**
|
|
|
|
Set the state of the connection. See :ref:`ConnectionStatus<enum_NetworkedMultiplayerPeer_ConnectionStatus>`.
|
|
|
|
This will emit the :ref:`NetworkedMultiplayerPeer.connection_succeeded<class_NetworkedMultiplayerPeer_signal_connection_succeeded>`, :ref:`NetworkedMultiplayerPeer.connection_failed<class_NetworkedMultiplayerPeer_signal_connection_failed>` or :ref:`NetworkedMultiplayerPeer.server_disconnected<class_NetworkedMultiplayerPeer_signal_server_disconnected>` signals depending on the status and if the peer has the unique network id of ``1``.
|
|
|
|
You can only change to :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTING<class_NetworkedMultiplayerPeer_constant_CONNECTION_CONNECTING>` from :ref:`NetworkedMultiplayerPeer.CONNECTION_DISCONNECTED<class_NetworkedMultiplayerPeer_constant_CONNECTION_DISCONNECTED>` and to :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTED<class_NetworkedMultiplayerPeer_constant_CONNECTION_CONNECTED>` from :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTING<class_NetworkedMultiplayerPeer_constant_CONNECTION_CONNECTING>`.
|
|
|
|
----
|
|
|
|
.. _class_NetworkedMultiplayerCustom_method_set_max_packet_size:
|
|
|
|
- void **set_max_packet_size** **(** :ref:`int<class_int>` max_packet_size **)**
|
|
|
|
Set the max packet size that this peer can handle.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|