Nocturna
    Preparing search index...

    Interface NetworkObserver

    NetworkObserver defines the interface for objects that want to observe network events, such as room creation/joining, participant changes, connection establishment, and peer messages.

    interface NetworkObserver {
        onConnectionEstablished(remoteId: string): void;
        onParticipantJoined(participantId: string): void;
        onParticipantLeft(participantId: string): void;
        onPeerMessage(participantId: string, action: string, data: any): void;
        onRoomCreated(roomId: string): void;
        onRoomCreationFailed(reason: string): void;
        onRoomJoined(
            roomId: string,
            playerId: string,
            participants: string[],
        ): void;
        onRoomJoinFailed(reason: string): void;
    }

    Implemented by

    Index

    Methods

    • Parameters

      • participantId: string
      • action: string
      • data: any

      Returns void

    • Parameters

      • roomId: string
      • playerId: string
      • participants: string[]

      Returns void