@game-vir/multiplayer - v15.1.1
    Preparing search index...

    Type Alias MultiplayerControllerParams<Action>

    Constructor parameters for MultiplayerController.

    type MultiplayerControllerParams<Action extends JsonCompatibleValue> = {
        acceptConnection?: (
            connectingClientId: Uuid,
            controller: MultiplayerController<Action>,
        ) => MaybePromise<boolean>;
        frameDuration?: AnyDuration;
        gameId: string;
    }

    Type Parameters

    • Action extends JsonCompatibleValue
    Index

    Properties

    acceptConnection?: (
        connectingClientId: Uuid,
        controller: MultiplayerController<Action>,
    ) => MaybePromise<boolean>

    This is fired when a WebRTC peer attempts to connect to the host client (this will only be fired if your client is the host). Return true to accept the connection. Return false to reject it.

    accept all connections
    
    frameDuration?: AnyDuration

    The duration between each frame. This should probably always be smaller than your supported render frame duration (1/FPS). If this is set to undefined, you'll need to manually trigger frames with MultiplayerController.runFrame.

    gameId: string

    Unique string id that represents your game. Your backend will need to know this game id and match it to your frontend's origin.