2021-09-08 01:50:22 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-05 22:07:03 +02:00
<class name= "MultiplayerPeerExtension" inherits= "MultiplayerPeer" version= "4.2" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2021-09-08 01:50:22 +02:00
<brief_description >
2021-12-08 12:49:22 +01:00
Class that can be inherited to implement custom multiplayer API networking layers via GDExtension.
2021-09-08 01:50:22 +02:00
</brief_description>
<description >
2021-12-08 12:49:22 +01:00
This class is designed to be inherited from a GDExtension plugin to implement custom networking layers for the multiplayer API (such as WebRTC). All the methods below [b]must[/b] be implemented to have a working custom multiplayer implementation. See also [MultiplayerAPI].
2021-09-08 01:50:22 +02:00
</description>
<tutorials >
</tutorials>
<methods >
2022-10-22 17:49:40 +02:00
<method name= "_close" qualifiers= "virtual" >
<return type= "void" />
<description >
Called when the multiplayer peer should be immediately closed (see [method MultiplayerPeer.close]).
</description>
</method>
<method name= "_disconnect_peer" qualifiers= "virtual" >
<return type= "void" />
<param index= "0" name= "p_peer" type= "int" />
<param index= "1" name= "p_force" type= "bool" />
<description >
Called when the connected [param p_peer] should be forcibly disconnected (see [method MultiplayerPeer.disconnect_peer]).
</description>
</method>
2021-09-08 01:50:22 +02:00
<method name= "_get_available_packet_count" qualifiers= "virtual const" >
<return type= "int" />
<description >
2021-12-08 12:49:22 +01:00
Called when the available packet count is internally requested by the [MultiplayerAPI].
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_get_connection_status" qualifiers= "virtual const" >
2022-09-01 05:09:07 +02:00
<return type= "int" enum= "MultiplayerPeer.ConnectionStatus" />
2021-09-08 01:50:22 +02:00
<description >
2021-12-08 12:49:22 +01:00
Called when the connection status is requested on the [MultiplayerPeer] (see [method MultiplayerPeer.get_connection_status]).
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_get_max_packet_size" qualifiers= "virtual const" >
<return type= "int" />
<description >
2021-12-08 12:49:22 +01:00
Called when the maximum allowed packet size (in bytes) is requested by the [MultiplayerAPI].
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_get_packet" qualifiers= "virtual" >
2022-09-01 05:09:07 +02:00
<return type= "int" enum= "Error" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "r_buffer" type= "const uint8_t **" />
<param index= "1" name= "r_buffer_size" type= "int32_t*" />
2021-09-08 01:50:22 +02:00
<description >
2022-08-12 15:36:48 +02:00
Called when a packet needs to be received by the [MultiplayerAPI], with [param r_buffer_size] being the size of the binary [param r_buffer] in bytes.
2021-09-08 01:50:22 +02:00
</description>
</method>
2023-03-19 20:41:25 +01:00
<method name= "_get_packet_channel" qualifiers= "virtual const" >
<return type= "int" />
<description >
Called to get the channel over which the next available packet was received. See [method MultiplayerPeer.get_packet_channel].
</description>
</method>
<method name= "_get_packet_mode" qualifiers= "virtual const" >
<return type= "int" enum= "MultiplayerPeer.TransferMode" />
<description >
Called to get the [enum MultiplayerPeer.TransferMode] the remote peer used to send the next available packet. See [method MultiplayerPeer.get_packet_mode].
</description>
</method>
2021-09-08 01:50:22 +02:00
<method name= "_get_packet_peer" qualifiers= "virtual const" >
<return type= "int" />
<description >
2021-12-08 12:49:22 +01:00
Called when the ID of the [MultiplayerPeer] who sent the most recent packet is requested (see [method MultiplayerPeer.get_packet_peer]).
2021-09-08 01:50:22 +02:00
</description>
</method>
2022-07-20 21:43:34 +02:00
<method name= "_get_packet_script" qualifiers= "virtual" >
<return type= "PackedByteArray" />
<description >
Called when a packet needs to be received by the [MultiplayerAPI], if [method _get_packet] isn't implemented. Use this when extending this class via GDScript.
</description>
</method>
2021-09-08 01:50:22 +02:00
<method name= "_get_transfer_channel" qualifiers= "virtual const" >
<return type= "int" />
<description >
2021-12-08 12:49:22 +01:00
Called when the transfer channel to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]).
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_get_transfer_mode" qualifiers= "virtual const" >
2022-09-01 05:09:07 +02:00
<return type= "int" enum= "MultiplayerPeer.TransferMode" />
2021-09-08 01:50:22 +02:00
<description >
2021-12-08 12:49:22 +01:00
Called when the transfer mode to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]).
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_get_unique_id" qualifiers= "virtual const" >
<return type= "int" />
<description >
2023-03-19 20:41:25 +01:00
Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]). The value must be between [code]1[/code] and [code]2147483647[/code].
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_is_refusing_new_connections" qualifiers= "virtual const" >
<return type= "bool" />
<description >
2021-12-08 12:49:22 +01:00
Called when the "refuse new connections" status is requested on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]).
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_is_server" qualifiers= "virtual const" >
<return type= "bool" />
<description >
2021-12-08 12:49:22 +01:00
Called when the "is server" status is requested on the [MultiplayerAPI]. See [method MultiplayerAPI.is_server].
2021-09-08 01:50:22 +02:00
</description>
</method>
2023-03-19 20:41:25 +01:00
<method name= "_is_server_relay_supported" qualifiers= "virtual const" >
<return type= "bool" />
<description >
Called to check if the server can act as a relay in the current configuration. See [method MultiplayerPeer.is_server_relay_supported].
</description>
</method>
2021-09-08 01:50:22 +02:00
<method name= "_poll" qualifiers= "virtual" >
2022-09-01 05:09:07 +02:00
<return type= "void" />
2021-09-08 01:50:22 +02:00
<description >
2021-12-08 12:49:22 +01:00
Called when the [MultiplayerAPI] is polled. See [method MultiplayerAPI.poll].
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_put_packet" qualifiers= "virtual" >
2022-09-01 05:09:07 +02:00
<return type= "int" enum= "Error" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "p_buffer" type= "const uint8_t*" />
<param index= "1" name= "p_buffer_size" type= "int" />
2021-09-08 01:50:22 +02:00
<description >
2022-08-12 15:36:48 +02:00
Called when a packet needs to be sent by the [MultiplayerAPI], with [param p_buffer_size] being the size of the binary [param p_buffer] in bytes.
2021-09-08 01:50:22 +02:00
</description>
</method>
2022-07-20 21:43:34 +02:00
<method name= "_put_packet_script" qualifiers= "virtual" >
2022-09-01 05:09:07 +02:00
<return type= "int" enum= "Error" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "p_buffer" type= "PackedByteArray" />
2022-07-20 21:43:34 +02:00
<description >
Called when a packet needs to be sent by the [MultiplayerAPI], if [method _put_packet] isn't implemented. Use this when extending this class via GDScript.
</description>
</method>
2021-09-08 01:50:22 +02:00
<method name= "_set_refuse_new_connections" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "p_enable" type= "bool" />
2021-09-08 01:50:22 +02:00
<description >
2021-12-08 12:49:22 +01:00
Called when the "refuse new connections" status is set on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]).
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_set_target_peer" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "p_peer" type= "int" />
2021-09-08 01:50:22 +02:00
<description >
2021-12-08 12:49:22 +01:00
Called when the target peer to use is set for this [MultiplayerPeer] (see [method MultiplayerPeer.set_target_peer]).
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_set_transfer_channel" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "p_channel" type= "int" />
2021-09-08 01:50:22 +02:00
<description >
2021-12-08 12:49:22 +01:00
Called when the channel to use is set for this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]).
2021-09-08 01:50:22 +02:00
</description>
</method>
<method name= "_set_transfer_mode" qualifiers= "virtual" >
<return type= "void" />
2022-09-01 05:09:07 +02:00
<param index= "0" name= "p_mode" type= "int" enum= "MultiplayerPeer.TransferMode" />
2021-09-08 01:50:22 +02:00
<description >
2021-12-08 12:49:22 +01:00
Called when the transfer mode is set on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]).
2021-09-08 01:50:22 +02:00
</description>
</method>
</methods>
</class>