import { CancelableEvent } from "@skeldjs/events"; import { GameSettings } from "@skeldjs/protocol"; import { Connection } from "../../../worker"; /** * 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 * ```ts * .@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!!!"); * } * } * ``` */ export declare class RoomBeforeCreateEvent extends CancelableEvent { /** * The client that is attempting to create a room. */ readonly client: Connection; /** * The game options that the player is attempting to create a room with. */ readonly gameOptions: GameSettings; /** * The game code of the room that will be created. */ readonly roomCode: number; static eventName: "room.beforecreate"; eventName: "room.beforecreate"; private _alteredRoomCode; constructor( /** * The client that is attempting to create a room. */ client: Connection, /** * The game options that the player is attempting to create a room with. */ gameOptions: GameSettings, /** * The game code of the room that will be created. */ roomCode: number); /** * The new room code if it was altered. */ get alteredRoomCode(): number; /** * Change the room code for the room. * @param roomCode The new room code */ setCode(roomCode: number | string): void; }