Class RoomBeforeCreateEvent

Emitted before a player successfully or unsuccessfully creates a room.

This event allows you to prevent players from creating rooms, or allow custom room codes.

Example

.@EventListener("room.beforecreate")
onWorkerBeforeCreate(ev: WorkerBeforeCreateEvent) {
if (ev.client.mods.size > 0) {
ev.cancel();
return ev.client.disconnect("You cannot create a room with Reactor enabled!!!");
}
}

Hierarchy

  • CancelableEvent
    • RoomBeforeCreateEvent

Properties

eventName: "room.beforecreate" = ...
canceled: boolean
client: Connection

The client that is attempting to create a room.

eventName: "room.beforecreate" = ...
gameOptions: GameSettings

The game options that the player is attempting to create a room with.

roomCode: number

The game code of the room that will be created.

Accessors

Methods

  • Returns void

  • Change the room code for the room.

    Parameters

    • roomCode: string | number

      The new room code

    Returns void

Constructors

Generated using TypeDoc