Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing bindings and documentation for MultiplayerPeerExtension #75116

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion doc/classes/MultiplayerPeerExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
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.
</description>
</method>
<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>
<method name="_get_packet_peer" qualifiers="virtual const">
<return type="int" />
<description>
Expand Down Expand Up @@ -76,7 +88,7 @@
<method name="_get_unique_id" qualifiers="virtual const">
<return type="int" />
<description>
Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]).
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].
</description>
</method>
<method name="_is_refusing_new_connections" qualifiers="virtual const">
Expand All @@ -91,6 +103,12 @@
Called when the "is server" status is requested on the [MultiplayerAPI]. See [method MultiplayerAPI.is_server].
</description>
</method>
<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>
<method name="_poll" qualifiers="virtual">
<return type="void" />
<description>
Expand Down
4 changes: 4 additions & 0 deletions scene/main/multiplayer_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ void MultiplayerPeerExtension::_bind_methods() {
GDVIRTUAL_BIND(_get_packet_script)
GDVIRTUAL_BIND(_put_packet_script, "p_buffer");

GDVIRTUAL_BIND(_get_packet_channel);
GDVIRTUAL_BIND(_get_packet_mode);
dsnopek marked this conversation as resolved.
Show resolved Hide resolved

GDVIRTUAL_BIND(_set_transfer_channel, "p_channel");
GDVIRTUAL_BIND(_get_transfer_channel);

Expand All @@ -217,6 +220,7 @@ void MultiplayerPeerExtension::_bind_methods() {
GDVIRTUAL_BIND(_get_unique_id);
GDVIRTUAL_BIND(_set_refuse_new_connections, "p_enable");
GDVIRTUAL_BIND(_is_refusing_new_connections);
GDVIRTUAL_BIND(_is_server_relay_supported);
GDVIRTUAL_BIND(_get_connection_status);

ADD_PROPERTY_DEFAULT("transfer_mode", TRANSFER_MODE_RELIABLE);
Expand Down