Skip to content
Olybear9 edited this page May 26, 2021 · 2 revisions

Events are used to communicate binary information from RakNet to the Server.

Connection Accepted

This is emitted when a connection is accepted.

Channel Details

Name Type Description
client_accept RakEvent.Accept Connection is accepted.

Listener Details

Parameter Type Description
connection RakConnection The connection created.

Example

import { RakServer, RakEvent } from 'raknet';

const channel = new RakServer().channel;
channel.on("client_accept", (connection: RakConnection) => {});
// or
channel.on(RakEvent.Accept, (connection: RakConnection) => {});

Connection Quit

This is emitted when a connection is kicked or removed for any reason.

Channel Details

Name Type Description
client_quit RakEvent.Disconnect Connection is destroyed in some way.

Listener Details

Parameter Type Description
address Address The address of the connection that was terminated.

Example

import { RakServer, RakEvent } from 'raknet';
import { Address } from 'netrex';

const channel = new RakServer().channel;
channel.on("client_quit", (address: Address) => {});
// or
channel.on(RakEvent.Disconnect, (address: Address) => {});
Clone this wiki locally