PlayerState

Properties

NameTypeDescription
idstringUnique player ID.
getProfile() => PlayerProfileReturns the player’s profile information.
getState(key: string) => anyReturns the value of a key in the player’s state.
setState(key: string, value: any, reliable?: boolean) => voidSets a value in the player’s state.
onQuit(callback: (state: PlayerState) => void) => () => voidRegisters a callback when the player quits the room.
kick() => Promise<void>Kicks the player from the room. Only host can call.
leaveRoom() => Promise<void>Removes the player from the room voluntarily.
isBot() => booleanReturns true if this player is a bot.