Event for when a user joined.

When initially connecting, the transforms are empty. Set custom join data to help us initialize the transforms.

Example:

The below code is run when connecting from the network-configuration-component.ts used in the client code:

connect() {
const customJoinData = {
handTracking: false,
hands: false,
};
console.log("connecting...");

networkManager
.connect(this.roomId, customJoinData, {
host: this.serverHost,
port: this.serverPort,
secure: this.secure,
audio: this.audio,
audioDeviceId: this.inputDeviceId,
debug: this.debug,
path: this.serverPath,
})
.then((serverJoinEvent) => {
...//register the returned transforms from the server
}).catch((err)=>{
...// do error handling
});
}

The data property of a JoinEvent instance received on the server in the onUserJoin event handler is equal to the customJoinData provided on the initial client to server connection

Hierarchy

  • JoinEvent

Constructors

Properties

Methods

Constructors

  • Parameters

    • __namedParameters: {
          data: {
              [key: string]: any;
          };
          peer: PeerBase;
          transforms?: Float32Array;
      }
      • data: {
            [key: string]: any;
        }
        • [key: string]: any
      • peer: PeerBase
      • Optional transforms?: Float32Array

    Returns JoinEvent

Properties

data: {
    [key: string]: any;
}

Custom join data map.

Type declaration

  • [key: string]: any
peer: PeerBase
transforms: Float32Array

Methods

  • Returns {
        data: {
            [key: string]: any;
        };
        peer: {
            id: string;
            user: undefined | {
                eventQueue: WebSocketEvent[];
                id: number;
                lastMessageTimestamp: number;
                objects: number[];
                peer: {
                    id: string;
                };
            };
        };
        transforms: Float32Array;
    }

    • data: {
          [key: string]: any;
      }
      • [key: string]: any
    • peer: {
          id: string;
          user: undefined | {
              eventQueue: WebSocketEvent[];
              id: number;
              lastMessageTimestamp: number;
              objects: number[];
              peer: {
                  id: string;
              };
          };
      }
      • id: string
      • user: undefined | {
            eventQueue: WebSocketEvent[];
            id: number;
            lastMessageTimestamp: number;
            objects: number[];
            peer: {
                id: string;
            };
        }
    • transforms: Float32Array

Generated using TypeDoc