MultiplayerPeerExtension
Class that can be inherited to implement custom multiplayer API networking layers via ReckfellExtension.
Class that can be inherited to implement custom multiplayer API networking layers via ReckfellExtension.
This class is designed to be inherited from a ReckfellExtension plugin to implement custom networking layers for the multiplayer API (such as WebRTC). All the methods below must be implemented to have a working custom multiplayer implementation. See also MultiplayerApi.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
MultiplayerPeerExtensionConstructor
public MultiplayerPeerExtension();Methods21
_Closevoid
public virtual void _Close();Called when the multiplayer peer should be immediately closed (see MultiplayerPeer.Close).
_DisconnectPeervoid
public virtual void _DisconnectPeer(int peer, bool force);Called when the connected peer should be forcibly disconnected (see MultiplayerPeer.DisconnectPeer).
| Name | Type | Default |
|---|---|---|
peer | int | — |
force | bool | — |
_GetAvailablePacketCountint
public virtual int _GetAvailablePacketCount();Called when the available packet count is internally requested by the MultiplayerApi.
int_GetConnectionStatusMultiplayerPeer.ConnectionStatus
public virtual MultiplayerPeer.ConnectionStatus _GetConnectionStatus();Called when the connection status is requested on the MultiplayerPeer (see MultiplayerPeer.GetConnectionStatus).
MultiplayerPeer.ConnectionStatus_GetMaxPacketSizeint
public virtual int _GetMaxPacketSize();Called when the maximum allowed packet size (in bytes) is requested by the MultiplayerApi.
int_GetPacketChannelint
public virtual int _GetPacketChannel();Called to get the channel over which the next available packet was received. See MultiplayerPeer.GetPacketChannel.
int_GetPacketModeMultiplayerPeer.TransferModeEnum
public virtual MultiplayerPeer.TransferModeEnum _GetPacketMode();Called to get the transfer mode the remote peer used to send the next available packet. See MultiplayerPeer.GetPacketMode.
MultiplayerPeer.TransferModeEnum_GetPacketPeerint
public virtual int _GetPacketPeer();Called when the ID of the MultiplayerPeer who sent the most recent packet is requested (see MultiplayerPeer.GetPacketPeer).
int_GetPacketScriptbyte[]
public virtual byte[] _GetPacketScript();Called when a packet needs to be received by the MultiplayerApi, if _get_packet isn't implemented. Use this when extending this class via C#.
byte[]_GetTransferChannelint
public virtual int _GetTransferChannel();Called when the transfer channel to use is read on this MultiplayerPeer (see MultiplayerPeer.TransferChannel).
int_GetTransferModeMultiplayerPeer.TransferModeEnum
public virtual MultiplayerPeer.TransferModeEnum _GetTransferMode();Called when the transfer mode to use is read on this MultiplayerPeer (see MultiplayerPeer.TransferMode).
MultiplayerPeer.TransferModeEnum_GetUniqueIdint
public virtual int _GetUniqueId();Called when the unique ID of this MultiplayerPeer is requested (see MultiplayerPeer.GetUniqueId). The value must be between 1 and 2147483647.
int_IsRefusingNewConnectionsbool
public virtual bool _IsRefusingNewConnections();Called when the "refuse new connections" status is requested on this MultiplayerPeer (see MultiplayerPeer.RefuseNewConnections).
bool_IsServerbool
public virtual bool _IsServer();Called when the "is server" status is requested on the MultiplayerApi. See MultiplayerApi.IsServer.
bool_IsServerRelaySupportedbool
public virtual bool _IsServerRelaySupported();Called to check if the server can act as a relay in the current configuration. See MultiplayerPeer.IsServerRelaySupported.
bool_Pollvoid
public virtual void _Poll();Called when the MultiplayerApi is polled. See MultiplayerApi.Poll.
_PutPacketScriptError
public virtual Error _PutPacketScript(byte[] buffer);Called when a packet needs to be sent by the MultiplayerApi, if _put_packet isn't implemented. Use this when extending this class via C#.
| Name | Type | Default |
|---|---|---|
buffer | byte[] | — |
Error_SetRefuseNewConnectionsvoid
public virtual void _SetRefuseNewConnections(bool enable);Called when the "refuse new connections" status is set on this MultiplayerPeer (see MultiplayerPeer.RefuseNewConnections).
| Name | Type | Default |
|---|---|---|
enable | bool | — |
_SetTargetPeervoid
public virtual void _SetTargetPeer(int peer);Called when the target peer to use is set for this MultiplayerPeer (see MultiplayerPeer.SetTargetPeer).
| Name | Type | Default |
|---|---|---|
peer | int | — |
_SetTransferChannelvoid
public virtual void _SetTransferChannel(int channel);Called when the channel to use is set for this MultiplayerPeer (see MultiplayerPeer.TransferChannel).
| Name | Type | Default |
|---|---|---|
channel | int | — |
_SetTransferModevoid
public virtual void _SetTransferMode(MultiplayerPeer.TransferModeEnum mode);Called when the transfer mode is set on this MultiplayerPeer (see MultiplayerPeer.TransferMode).
| Name | Type | Default |
|---|---|---|
mode | MultiplayerPeer.TransferModeEnum | — |