-
Notifications
You must be signed in to change notification settings - Fork 1
Events
Olybear9 edited this page May 26, 2021
·
2 revisions
Events are used to communicate binary information from RakNet to the Server.
This is emitted when a connection is accepted.
Name | Type | Description |
---|---|---|
client_accept | RakEvent.Accept |
Connection is accepted. |
Parameter | Type | Description |
---|---|---|
connection | RakConnection |
The connection created. |
import { RakServer, RakEvent } from 'raknet';
const channel = new RakServer().channel;
channel.on("client_accept", (connection: RakConnection) => {});
// or
channel.on(RakEvent.Accept, (connection: RakConnection) => {});
This is emitted when a connection is kicked or removed for any reason.
Name | Type | Description |
---|---|---|
client_quit | RakEvent.Disconnect |
Connection is destroyed in some way. |
Parameter | Type | Description |
---|---|---|
address | Address |
The address of the connection that was terminated. |
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) => {});