Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

ENetMultiplayerPeer

Inherits: MultiplayerPeer < PacketPeer < RefCounted < Object

A MultiplayerPeer implementation using the ENet library.

Description

A MultiplayerPeer implementation that should be passed to MultiplayerAPI.multiplayer_peer after being initialized as either a client, server, or mesh. Events can then be handled by connecting to MultiplayerAPI signals. See ENetConnection for more information on the ENet library wrapper.

Note: ENet only uses UDP, not TCP. When forwarding the server port to make your server accessible on the public Internet, you only need to forward the server port in UDP. You can use the UPNP class to try to forward the server port automatically when starting the server.

Tutorials

Properties

ENetConnection

host

Methods

Error

add_mesh_peer ( int peer_id, ENetConnection host )

Error

create_client ( String address, int port, int channel_count=0, int in_bandwidth=0, int out_bandwidth=0, int local_port=0 )

Error

create_mesh ( int unique_id )

Error

create_server ( int port, int max_clients=32, int max_channels=0, int in_bandwidth=0, int out_bandwidth=0 )

ENetPacketPeer

get_peer (