Static
serverReadonly
clusterThe global configuration for Hindenburg.
All client connections connected to this server, mapped by their address:port, see address.
The packet decoder used to decode incoming udp packets.
The last client ID that was used.
Used for getNextClientId to get an incrementing client ID.
A map of ports to UDP sockets that clients can connect to.
Logger for this server.
Optional
matchmakerThe Http matchmaker for the server, if enabled, see matchmaker.
Readonly
nodeThe ID of this node relative to the cluster.
The server's plugin loader.
All rooms created on this server, mapped by their game code as an integer.
See createRoom
Vorpal instance responsible for handling interactive CLI.
Create a room on this server.
The created room.
The game code for the room, see generateRoomCode to generate one.
Game options for the room.
The client who is creating the room, if any.
Generate a 4 or 6 letter room code for a room.
The generated room code as an integer.
// Generate a 4 letter code.
const roomCode = generateRoomCode(4);
console.log(roomCode); // => 1246449490
// Generate a 6 letter code.
const roomCode = generateRoomCode(6);
console.log(roomCode); // => -2007212745
The length of the room code, 4 or 6.
Get the next available client ID.
console.log(worker.getNextClientId()); // => 1
console.log(worker.getNextClientId()); // => 2
console.log(worker.getNextClientId()); // => 3
console.log(worker.getNextClientId()); // => 4
console.log(worker.getNextClientId()); // => 5
Retrieve or create a connection based on its remote information received
from a socket message
event.
Handle a message being received via the udp socket.
The raw data buffer that was received.
Information about the remote that sent this data.
Remove a connection from this server.
Note that this does not notify the client of the connection that they have been disconnected, see disconnect.
The connection to remove.
Serialize and reliable or unreliably send a packet to a client.
For reliable packets, packets sent will be reliably recorded and marked for re-sending if the client does not send an acknowledgement for the packet.
worker.sendPacket(connection,
new ReliablePacket(
connection.getNextNonce(),
[
new HostGameMessage("ALBERT")
]
)
);
The connection to send this packet to.
The root packet to send.
The name of the cluster that this node is apart of.
The ID of this node relative to the cluster.
The global configuration for Hindenburg.
Generated using TypeDoc
The name of the cluster that this node is apart of.