NetworkedMultiplayerPeer

A high-level network interface to simplify multiplayer interactions.

Manages the connection to network peers. Assigns unique IDs to each client connected to the server. See also MultiplayerAPI. Note: The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

ConnectionStatus
enum ConnectionStatus
Constants
enum Constants
TransferMode
enum TransferMode

Functions

getConnectionStatus
NetworkedMultiplayerPeer.ConnectionStatus getConnectionStatus()

Returns the current state of the connection. See connectionstatus.

getPacketPeer
long getPacketPeer()

Returns the ID of the NetworkedMultiplayerPeer who sent the most recent packet.

getTransferMode
NetworkedMultiplayerPeer.TransferMode getTransferMode()
getUniqueId
long getUniqueId()

Returns the ID of this NetworkedMultiplayerPeer.

isRefusingNewConnections
bool isRefusingNewConnections()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(NetworkedMultiplayerPeer other)
opEquals
bool opEquals(typeof(null) n)
poll
void poll()

Waits up to 1 second to receive a new network event.

setRefuseNewConnections
void setRefuseNewConnections(bool enable)
setTargetPeer
void setTargetPeer(long id)

Sets the peer to which packets will be sent. The id can be one of: constant TARGET_PEER_BROADCAST to send to all connected peers, constant TARGET_PEER_SERVER to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. By default, the target peer is constant TARGET_PEER_BROADCAST.

setTransferMode
void setTransferMode(long mode)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

refuseNewConnections
bool refuseNewConnections [@property getter]
bool refuseNewConnections [@property setter]

If true, this NetworkedMultiplayerPeer refuses new connections.

transferMode
NetworkedMultiplayerPeer.TransferMode transferMode [@property getter]
long transferMode [@property setter]

The manner in which to send packets to the target_peer. See transfermode.

Static functions

_new
NetworkedMultiplayerPeer _new()

Construct a new instance of NetworkedMultiplayerPeer. Note: use memnew!NetworkedMultiplayerPeer instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta