mooball
    Preparing search index...

    Type Alias CreateRoomParams

    type CreateRoomParams = {
        endpoint: string | null;
        fakePassword?: boolean;
        geo: GeoLocation;
        hideIdentity: boolean;
        maxPlayerCount: int;
        name: string;
        noPlayer?: boolean;
        onConnectionAttempt?(
            peerId: number,
            ip: string,
            sdp: string,
            candidates: any[],
        ): string | null;
        onError?(error: IHBError, playerId: number): void;
        password?: string;
        playerCount?: int;
        showInRoomList: boolean;
        thumbnail: string | null;
        tintColor: int;
        token: string;
        unlimitedPlayerCount?: boolean;
    }
    Index

    Properties

    endpoint: string | null

    Endpoint of the room.

    fakePassword?: boolean

    If set to true or false, the room will set its password-protected status to your value. Passing null or omitting this key disables this behaviour.

    The geolocation value of the room about to be created.

    hideIdentity: boolean

    Whether to hide the owner of the room or not.

    maxPlayerCount: int

    The maximum allowed player count in the room.

    name: string

    Name of the room.

    noPlayer?: boolean

    Determines whether a player object will be created for the room host or not.

    password?: string

    A password string to protect the room. omit or null for no password.

    playerCount?: int

    If set to an integer value, fixes the current player count to this specific value.

    showInRoomList: boolean

    Whether to show this room in the room list or not.

    thumbnail: string | null

    Thumbnail(to show in room list) of the room.

    tintColor: int

    Background tint color(to show in room list) of the room.

    token: string

    In order to create a room, we have to solve a recaptcha challenge and write the resulting token into this key. The recaptcha token can be originally obtained from https://moo-hoo.com/mooball/headlesstoken. However, this url will be different while using a custom backend server.

    unlimitedPlayerCount?: boolean

    If set to true, bypasses the player count checks, resulting in unlimited maximum player count. However, the default backend will not show the room in the room list if the player count > 30.

    Methods

    • Called just before any connection is about to be established with a peer. You are supposed to return null to allow, or a string to block the user from joining the room with the custom message string.

      Parameters

      • peerId: number

        The thrown error.

      • ip: string

        Id of the player that caused the error.

      • sdp: string

        The thrown error.

      • candidates: any[]

        The thrown error.

      Returns string | null

      null|string.

    • Called when a exception is thrown by one of the client connections. playerId is the id of the player that caused the exception. The player's connection will be closed just after this callback is executed.

      Parameters

      • error: IHBError

        The thrown error.

      • playerId: number

        Id of the player that caused the error.

      Returns void

      void.