0.2.0-dev Download ZIP
162 lines ·7.5 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="MultiplayerPeerExtension" inherits="MultiplayerPeer" api_type="core" keywords="network" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Class that can be inherited to implement custom multiplayer API networking layers via GDExtension. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | 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]. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | </tutorials> |
| 11 | <methods> |
| 12 | <method name="_close" qualifiers="virtual required"> |
| 13 | <return type="void" /> |
| 14 | <description> |
| 15 | Called when the multiplayer peer should be immediately closed (see [method MultiplayerPeer.close]). |
| 16 | </description> |
| 17 | </method> |
| 18 | <method name="_disconnect_peer" qualifiers="virtual required"> |
| 19 | <return type="void" /> |
| 20 | <param index="0" name="peer" type="int" /> |
| 21 | <param index="1" name="force" type="bool" /> |
| 22 | <description> |
| 23 | Called when the connected [param peer] should be forcibly disconnected (see [method MultiplayerPeer.disconnect_peer]). |
| 24 | </description> |
| 25 | </method> |
| 26 | <method name="_get_available_packet_count" qualifiers="virtual required const"> |
| 27 | <return type="int" /> |
| 28 | <description> |
| 29 | Called when the available packet count is internally requested by the [MultiplayerAPI]. |
| 30 | </description> |
| 31 | </method> |
| 32 | <method name="_get_connection_status" qualifiers="virtual required const"> |
| 33 | <return type="int" enum="MultiplayerPeer.ConnectionStatus" /> |
| 34 | <description> |
| 35 | Called when the connection status is requested on the [MultiplayerPeer] (see [method MultiplayerPeer.get_connection_status]). |
| 36 | </description> |
| 37 | </method> |
| 38 | <method name="_get_max_packet_size" qualifiers="virtual required const"> |
| 39 | <return type="int" /> |
| 40 | <description> |
| 41 | Called when the maximum allowed packet size (in bytes) is requested by the [MultiplayerAPI]. |
| 42 | </description> |
| 43 | </method> |
| 44 | <method name="_get_packet" qualifiers="virtual"> |
| 45 | <return type="int" enum="Error" /> |
| 46 | <param index="0" name="r_buffer" type="const uint8_t **" /> |
| 47 | <param index="1" name="r_buffer_size" type="int32_t*" /> |
| 48 | <description> |
| 49 | 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. |
| 50 | </description> |
| 51 | </method> |
| 52 | <method name="_get_packet_channel" qualifiers="virtual required const"> |
| 53 | <return type="int" /> |
| 54 | <description> |
| 55 | Called to get the channel over which the next available packet was received. See [method MultiplayerPeer.get_packet_channel]. |
| 56 | </description> |
| 57 | </method> |
| 58 | <method name="_get_packet_mode" qualifiers="virtual required const"> |
| 59 | <return type="int" enum="MultiplayerPeer.TransferMode" /> |
| 60 | <description> |
| 61 | Called to get the transfer mode the remote peer used to send the next available packet. See [method MultiplayerPeer.get_packet_mode]. |
| 62 | </description> |
| 63 | </method> |
| 64 | <method name="_get_packet_peer" qualifiers="virtual required const"> |
| 65 | <return type="int" /> |
| 66 | <description> |
| 67 | Called when the ID of the [MultiplayerPeer] who sent the most recent packet is requested (see [method MultiplayerPeer.get_packet_peer]). |
| 68 | </description> |
| 69 | </method> |
| 70 | <method name="_get_packet_script" qualifiers="virtual"> |
| 71 | <return type="PackedByteArray" /> |
| 72 | <description> |
| 73 | 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. |
| 74 | </description> |
| 75 | </method> |
| 76 | <method name="_get_transfer_channel" qualifiers="virtual required const"> |
| 77 | <return type="int" /> |
| 78 | <description> |
| 79 | Called when the transfer channel to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]). |
| 80 | </description> |
| 81 | </method> |
| 82 | <method name="_get_transfer_mode" qualifiers="virtual required const"> |
| 83 | <return type="int" enum="MultiplayerPeer.TransferMode" /> |
| 84 | <description> |
| 85 | Called when the transfer mode to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]). |
| 86 | </description> |
| 87 | </method> |
| 88 | <method name="_get_unique_id" qualifiers="virtual required const"> |
| 89 | <return type="int" /> |
| 90 | <description> |
| 91 | 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]. |
| 92 | </description> |
| 93 | </method> |
| 94 | <method name="_is_refusing_new_connections" qualifiers="virtual const"> |
| 95 | <return type="bool" /> |
| 96 | <description> |
| 97 | Called when the "refuse new connections" status is requested on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]). |
| 98 | </description> |
| 99 | </method> |
| 100 | <method name="_is_server" qualifiers="virtual required const"> |
| 101 | <return type="bool" /> |
| 102 | <description> |
| 103 | Called when the "is server" status is requested on the [MultiplayerAPI]. See [method MultiplayerAPI.is_server]. |
| 104 | </description> |
| 105 | </method> |
| 106 | <method name="_is_server_relay_supported" qualifiers="virtual const"> |
| 107 | <return type="bool" /> |
| 108 | <description> |
| 109 | Called to check if the server can act as a relay in the current configuration. See [method MultiplayerPeer.is_server_relay_supported]. |
| 110 | </description> |
| 111 | </method> |
| 112 | <method name="_poll" qualifiers="virtual required"> |
| 113 | <return type="void" /> |
| 114 | <description> |
| 115 | Called when the [MultiplayerAPI] is polled. See [method MultiplayerAPI.poll]. |
| 116 | </description> |
| 117 | </method> |
| 118 | <method name="_put_packet" qualifiers="virtual"> |
| 119 | <return type="int" enum="Error" /> |
| 120 | <param index="0" name="buffer" type="const uint8_t*" /> |
| 121 | <param index="1" name="buffer_size" type="int" /> |
| 122 | <description> |
| 123 | Called when a packet needs to be sent by the [MultiplayerAPI], with [param buffer_size] being the size of the binary [param buffer] in bytes. |
| 124 | </description> |
| 125 | </method> |
| 126 | <method name="_put_packet_script" qualifiers="virtual"> |
| 127 | <return type="int" enum="Error" /> |
| 128 | <param index="0" name="buffer" type="PackedByteArray" /> |
| 129 | <description> |
| 130 | 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. |
| 131 | </description> |
| 132 | </method> |
| 133 | <method name="_set_refuse_new_connections" qualifiers="virtual"> |
| 134 | <return type="void" /> |
| 135 | <param index="0" name="enable" type="bool" /> |
| 136 | <description> |
| 137 | Called when the "refuse new connections" status is set on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]). |
| 138 | </description> |
| 139 | </method> |
| 140 | <method name="_set_target_peer" qualifiers="virtual required"> |
| 141 | <return type="void" /> |
| 142 | <param index="0" name="peer" type="int" /> |
| 143 | <description> |
| 144 | Called when the target peer to use is set for this [MultiplayerPeer] (see [method MultiplayerPeer.set_target_peer]). |
| 145 | </description> |
| 146 | </method> |
| 147 | <method name="_set_transfer_channel" qualifiers="virtual required"> |
| 148 | <return type="void" /> |
| 149 | <param index="0" name="channel" type="int" /> |
| 150 | <description> |
| 151 | Called when the channel to use is set for this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]). |
| 152 | </description> |
| 153 | </method> |
| 154 | <method name="_set_transfer_mode" qualifiers="virtual required"> |
| 155 | <return type="void" /> |
| 156 | <param index="0" name="mode" type="int" enum="MultiplayerPeer.TransferMode" /> |
| 157 | <description> |
| 158 | Called when the transfer mode is set on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]). |
| 159 | </description> |
| 160 | </method> |
| 161 | </methods> |
| 162 | </class> |