NetworkedMultiplayerENet

Inherits: NetworkedMultiplayerPeer < PacketPeer < Reference < Object

Category: Core

Brief Description

PacketPeer implementation using the ENet library.

Member Functions

void close_connection ( )
int create_client ( String ip, int port, int in_bandwidth=0, int out_bandwidth=0 )
int create_server ( int port, int max_clients=32, int in_bandwidth=0, int out_bandwidth=0 )
int get_compression_mode ( ) const
void set_bind_ip ( String ip )
void set_compression_mode ( int mode )

Numeric Constants

  • COMPRESS_NONE = 0
  • COMPRESS_RANGE_CODER = 1
  • COMPRESS_FASTLZ = 2
  • COMPRESS_ZLIB = 3
  • COMPRESS_ZSTD = 4

Description

A connection (or a listening server) that should be passed to SceneTree.set_network_peer. Socket events can be handled by connecting to SceneTree signals.

Member Function Description

  • void close_connection ( )

Create client that connects to a server at address ip using specified port.

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

Create server that listens to connections via port.

  • int get_compression_mode ( ) const
  • void set_bind_ip ( String ip )
  • void set_compression_mode ( int mode )