Hierarchy

  • Game

Constructors

Properties

Methods

_startMapDataCheckInterval addInventoryItem addObject banPlayer block chat chatMessageUpdated checkForExits cleanupDeletedObjects clearItem connect craft debug deleteObject deleteObjectByKey disconnect enter enterPortal enterWhisper exit filterObjectsInMap filterObjectsInSpace filterPlayersInSpace filterUidsInSpace fxShakeCamera fxShakeObject getDebugHistory getImpassable getKnownCompletedMaps getKnownPartialMaps getMyPlayer getObject getObjectByKey getPlayer getPlayerUidFromEncId getPlayersInMap getStats ghost highFive hipToBeSquare init interact isPlayerInPrivateSpace kickPlayer leaveWhisper move moveMapObject notify patchGatherEventsSpaceSession playSound pointer publishEvent registerCommand removeInventoryItem requestAccessViaCheckIn requestMute requestToJoinNook requestToLead respawn respondToAccessRequest ring screenPointer sendAction sendAction2 sendCommand sendSubscribe setActivelySpeaking setAffiliation setAllowScreenPointer setAvailability setAway setCity setCountry setCurrentlyEquippedWearables setDescription setDeskFromNextAvailableDesk setDeskInfo setDisplayEmail setEmojiStatus setEmote setEventStatus setFocusModeEndTime setFollowTarget setImpassable setInConversation setIsAlone setIsMobile setItem setManualVideoSrc setMapAnnouncer setMapAreas setMapBackgroundImagePath setMapCollisions setMapDecoration setMapDescription setMapDimensions setMapEnabledChats setMapForegroundImagePath setMapMiniMapImagePath setMapMuteOnEntry setMapName setMapNooks setMapObjects setMapPortals setMapSpawns setMapTutorialTasks setMapUseDrawnBG setName setObject setPersonalImageUrl setPhone setProfileImageUrl setPronouns setSpaceRolePermissionOverride setSpeedModifier setSpotlight setStartDate setSubtitle setTextStatus setTimezone setTitle setVehicleId shootConfetti spawn startRecording stopSound subscribeToConnection subscribeToDisconnection subscribeToEvent subscribeToEventPerf subscriptionFinishedCallback teleport triggerInventoryItem triggerObject updateNookPermission updateObject updateSpaceItems waitForFirstEnter waitForInit wave

Constructors

  • Parameters

    • spaceId: string
    • getAuth: (() => Promise<EngineAuth>)
    • Optional onInput: ((dir, stopped, inputId, txnPromise) => void)
        • (dir, stopped, inputId, txnPromise): void
        • Parameters

          Returns void

    • Optional dispatchGameUpdate: ((delta) => void)
    • Optional dispatchMapUpdate: ((mapId, map) => void)
        • (mapId, map): void
        • Parameters

          • mapId: string
          • map: Readonly<GameMap>

          Returns void

    • Optional options: GameOptions

    Returns Game

Properties

_connectCalledAt: number = 0
_connectedAtMs: number = 0
_initializedAtMs: number = 0
_onMapCounts: {
    [mapId: string]: number;
} = {}

Type declaration

  • [mapId: string]: number
_timeToConnect: number = -1
checkForExitsTimeout: Timeout = ...
completeMaps: {
    [id: string]: GameMap;
} = ...

Type declaration

debugOverrideServer?: string
disconnectHandlers: {
    [uuid: string]: ((code?, reason?) => void);
} = {}

Type declaration

  • [uuid: string]: ((code?, reason?) => void)
      • (code?, reason?): void
      • Parameters

        • Optional code: number
        • Optional reason: string

        Returns void

dispatchGameUpdate?: ((delta) => void)

Type declaration

dispatchMapUpdate?: ((mapId, map) => void)

Type declaration

    • (mapId, map): void
    • Parameters

      • mapId: string
      • map: Readonly<GameMap>

      Returns void

encIdMapping: {
    [encId: number]: string;
} = {}

Type declaration

  • [encId: number]: string
engine?: Engine
eventPerfCallbacks: ((eventId, duration) => void)[] = []
eventSubscriptions: EventSubscriptions = {}
getAuth: (() => Promise<EngineAuth>)

Type declaration

hasSentMapSinceConnect: boolean = false
inputId: number = 1
intendToBeConnected: boolean = false
lastDeployTime: number = 0
lastMapUpdateIds: {
    [id: string]: number;
} = ...

Type declaration

  • [id: string]: number
legacySubscriptionsConnection: {
    [uuid: string]: ((connected) => void);
} = {}

Deprecated

Type declaration

  • [uuid: string]: ((connected) => void)
      • (connected): void
      • Parameters

        • connected: boolean

        Returns void

mapDataCheckInterval: undefined | Timeout
mapDataChecks: number = 0
mapsAccumulator: MapsAccumulator = ...
onInput: undefined | ((dir, stopped, inputId, txnPromise) => void)
partialMaps: {
    [id: string]: Partial<GameMap>;
} = ...

Type declaration

playerUidsSeenOnConnect: Set<string> = ...
players: {
    [uid: string]: Player;
} = {}

Type declaration

putMetric: ((metricName, metricValue) => void) = ...

Type declaration

    • (metricName, metricValue): void
    • Parameters

      • metricName: string
      • metricValue: unknown

      Returns void

spaceId?: string
spaceItems: {
    [id: string]: SpaceItem;
} = {}

Type declaration

subscriptions: GameEventSubscriptionMap = {}
timeToFirstOnMapsMs: Map<string, number> = ...
updateSubscriptionsPromise: Promise<void>

Methods

  • Parameters

    • chatRecipient: string
    • localPlayers: string[]
    • mapId: string
    • data: {
          contents: string;
          id?: string;
          nookId?: string;
      }
      • contents: string
      • Optional id?: string
      • Optional nookId?: string

    Returns void

  • Fires the mapDeleteObjectByKey event for any objects that were deleted while we were disconnected from the GS.

    Parameters

    • mapId: string
    • deletedObjectKeys: Set<string>

    Returns void

  • Parameters

    • mapId: string
    • objId: string
    • createTxnId: boolean = false

    Returns Promise<unknown>

  • Parameters

    • mapId: string
    • key: string
    • createTxnId: boolean = false

    Returns Promise<unknown>

  • Parameters

    • targetUrl: string
    • Optional targetId: string
    • Optional bypassPrompt: boolean

    Returns void

  • Parameters

    • useTxn: boolean = false

    Returns undefined | void | Promise<unknown>

  • Returns a list of all objects in the map matching a condition.

    Requires

    the map to be defined first - use game.waitForInit() to be sure it has been defined.

    Example

    game.filterObjectsInMap("park-legacy", (obj) => obj.id.startsWith("password-door")); // finds all password doors in a map
    

    Parameters

    • mapId: string

      The map you want to filter objects on. If there are no objects in the map, an empty array is returned.

    • filter: ((obj) => undefined | boolean)

      A predicate that returns a truthy value if you want the object to be returned.

        • (obj): undefined | boolean
        • Parameters

          Returns undefined | boolean

    Returns MapObject[]

  • Returns a list of all objects in the entire space matching a condition. See filterObjectsInMap for an example

    Requires

    map data that is being searched to be defined first - use game.waitForInit() to get all known map data

    Parameters

    • filter: ((obj) => undefined | boolean)

      A predicate that returns a truthy value if you want the object to be returned.

        • (obj): undefined | boolean
        • Parameters

          Returns undefined | boolean

    Returns MapObject[]

  • Returns a list of all players in the space based on player critera.

    Requires

    the players to be defined first - use game.waitForInit() to be sure it has been defined.

    Example

    filterPlayersInSpace((player) => player.name === "Evelyn"); // returns the Player object for all players named Evelyn
    

    Parameters

    • filter: ((player) => undefined | boolean)

      A predicate that returns a truthy value if you want the player to be returned

        • (player): undefined | boolean
        • Parameters

          Returns undefined | boolean

    Returns Player[]

  • Returns a list of all uids in the space for players matching a condition.

    Requires

    the players to be defined first - use game.waitForInit() to be sure it has been defined.

    Example

    filterUidsInSpace((player) => player.name === "Evelyn"); // returns the uid for all players named Evelyn
    

    Parameters

    • filter: ((player) => undefined | boolean)

      A predicate that returns a truthy value if you want the uid to be returned

        • (player): undefined | boolean
        • Parameters

          Returns undefined | boolean

    Returns string[]

  • Parameters

    • Optional mapId: string
    • Optional playerId: string
    • intensity: number = 0.1
    • durationMs: number = 1000

    Returns void

  • Adds a "Quake" effect to the given target. This shakes it around a little bit before settling back into position.

    Parameters

    • mapId: string
    • targetObjId: string
    • intensity: number = 0.1
    • durationMs: number = 1000
    • Optional mode: number

    Returns void

  • Returns whether or not the given coordinate on the map is impassable or not

    Parameters

    • mapId: string

      the map to find the impassable in

    • x: number

      x coordinate of the impassable to consider

    • y: number

      y coordinate of the impassable to consider

    Returns boolean

  • Returns the keys for all completed maps. See docstring for getKnownPartialMaps().

    Returns string[]

  • Returns all known maps- i.e the keys of game.partialMaps We add this abstraction for convience and clarity, and because game.partialMaps could be renamed. You should prefer to use this function.

    Returns string[]

  • Returns this game instance's player if they are defined, throwing an error if the client is not connected or the client's player has not be initialized

    Requires

    the game engine to be connected and initialized with the server

    Requires

    the game client to have entered

    Returns Player

  • Parameters

    • objId: string
    • Optional mapId: string

    Returns null | {
        key: string;
        mapId: string;
        obj: MapObject;
    }

  • Returns all players that are in the same map as you.

    Requires

    the map and players to be defined first - use game.waitForInit() to be sure it has been defined.

    Example

    game.getPlayersInMap("new office")
    

    Parameters

    • mapId: string

      The string mapId you want to filter on

    Returns Player[]

  • Puts the currently connected client in ghost mode

    Parameters

    • ghost: number

      ghost value, either 1 or 0; whether you are ghosting or not.

    • Optional targetId: string

      id of player whose ghost value you want to set (must be space owner to set)

    Returns void

  • Parameters

    • spaceId: string
    • Optional _overrideServer: string
    • Optional _overrideHttpServer: string

    Returns void

  • Utility function that returns true if a player is standing inside a given private space. Requires the map to be defined first - use game.waitForInit() to be sure it has been defined. You can pass this directly into filterPlayersInSpace using a thunk.

    Requires

    the map to be defined first - use game.waitForInit() to be sure it has been defined.

    Example

    isPlayerInPrivateSpace(player, "new office", "library") // returns if a given player is in the library
    

    Example

    filterPlayersInSpace((player) => isPlayerInPrivateSpace(player, "new office", "library")); // finds everyone on that tile
    

    Parameters

    • player: Partial<Player>

      A Partial referencing the player

    • mapId: string

      the map the private tile is in

    • privateSpaceId: string

      the name of the private space you put in the mapmaker

    Returns boolean

  • Animates an object moving from its current position to targetWorldPos. Also handles setting the object's new position in the map itself.

    Parameters

    • mapId: string
    • objectId: string
    • targetWorldPos: {
          x: number;
          xOffset?: number;
          y: number;
          yOffset?: number;
      }
      • x: number
      • Optional xOffset?: number
      • y: number
      • Optional yOffset?: number
    • durationMs: number
    • easing: "Linear" | "Cubic" | "Elastic" | "Bounce" | "Back" = "Linear"

    Returns void

  • Utility function for map developers that plays a sound file on the client, once. Use targetId if you are a space owner to play a sound on another client. If no sound is specified, it plays for the entire space. You must be a space owner to play a sound on the whole space.

    Parameters

    • src: string

      HTMl5 compliant audio resource, e.g a URL to a mp3

    • volume: number

      scalar volume from 0 to 1.0

    • Optional targetId: string

      id of another player you want to play the sound on

    Returns void

  • Type Parameters

    • T extends "info" | "warn" | "error" | "ready" | "serverHeartbeat" | "transactionStatus" | "playerMoves" | "playerSetsStatus" | "playerSpotlights" | "playerRings" | "playerChats" | "playerGhosts" | "playerEntersWhisper" | "playerLeavesWhisper" | "playerActivelySpeaks" | "playerSetsName" | "playerSetsTextStatus" | "playerSetsEmojiStatus" | "playerSetsAffiliation" | "playerExits" | "playerSetsIsSignedIn" | "spaceOverwrites" | "spaceIsClosed" | "playerEntersPortal" | "spaceSetsIdMapping" | "playerSetsLastActive" | "playerShootsConfetti" | "playerSetsEventStatus" | "playerSetsInConversation" | "playerSetsCurrentArea" | "playerSetsImagePointer" | "cookieFound" | "playerEntersWhisperV2" | "playerSetsGoKartId" | "mapSetDimensions" | "mapSetBackgroundImagePath" | "mapSetForegroundImagePath" | "mapSetSpawns" | "mapSetPortals" | "mapSetAnnouncer" | "mapSetAssets" | "mapSetName" | "mapSetMuteOnEntry" | "mapSetUseDrawnBG" | "mapSetWalls" | "mapSetFloors" | "mapSetAreas" | "mapSetSpawn" | "playerSetsIsAlone" | "playerJoins" | "mapSetEnabledChats" | "mapSetDescription" | "mapSetDecoration" | "mapSetTutorialTasks" | "mapSetMiniMapImagePath" | "spacePlaysSound" | "mapSetScript" | "playerSetsIsMobile" | "setScreenPointerServer" | "playerSetsEmoteV2" | "playerSetsFocusModeEndTime" | "spaceSetsSpaceMembers" | "spaceSetsSpaceUsers" | "customEvent" | "playerBlocks" | "playerUpdatesFocusModeStatus" | "playerNotifies" | "playerSetsItemString" | "playerSetsFollowTarget" | "playerRequestsToLead" | "playerSetsManualVideoSrc" | "playerSetsIsNpc" | "playerSetsSubtitle" | "mapCommitsChanges" | "mapMoveObject" | "playerEditsChatMessage" | "fxShakeObject" | "fxShakeCamera" | "playerSendsCommand" | "spaceRegistersCommand" | "speakerUpdatesSession" | "playerUpdatesInventory" | "spaceUpdatesItems" | "playerSetsVehicleId" | "playerSetsSpeedModifier" | "playerHighFives" | "spaceStopsSound" | "hipToBeSquare" | "playerCrafts" | "playerTriggersInventoryItem" | "playerSetsAllowScreenPointer" | "precomputedEnterLocation" | "gotRequestMute" | "playerSetsDeskInfo" | "mapSetNooks" | "dynamicGates" | "playerWaves" | "playerSetsPronouns" | "playerSetsTitle" | "playerSetsTimezone" | "playerSetsDescription" | "playerSetsPhone" | "playerSetsPersonalImageUrl" | "playerSetsProfileImageUrl" | "spaceSetsCapacity" | "spaceOverCapacityDeniesUser" | "playerSetsAway" | "mapSetCollisionsBits" | "playerSetsCity" | "playerSetsCountry" | "playerSetsStartDate" | "playerStartsRecording" | "accessRequestsUpdated" | "accessRequestRespondedTo" | "spaceSetsGuestPassStatuses" | "playerSetsAvailability" | "subscriptionsUpdated" | "spaceRolePermissionOverrideUpdated" | "playerSetsLastRaisedHand" | "playerSetsCurrentlyEquippedWearables" | "playerSetsDisplayEmail" | "mapDeleteObjectByKey" | "mapSetObjectsV2" | "playerInteractsWithObject" | "playerTriggersObject" | "chimeSetsUserInfo" | "playerChangesMaps"

    Parameters

    • eventId: T
    • data: GameEventByCase<T>
    • context: ServerClientEventContext

    Returns void

  • Parameters

    • itemId: string
    • delta: number
    • Optional targetId: string

    Returns void

  • Parameters

    • userId: string
    • canceled: boolean
    • Optional name: string
    • Optional currentlyEquippedWearables: DBOutfit

    Returns void

  • Type Parameters

    • TCase extends "mapSetDimensions" | "mapSetBackgroundImagePath" | "mapSetForegroundImagePath" | "mapSetSpawns" | "mapSetPortals" | "mapSetAnnouncer" | "mapSetAssets" | "mapSetName" | "mapSetMuteOnEntry" | "mapSetUseDrawnBG" | "mapSetWalls" | "mapSetFloors" | "mapSetAreas" | "mapSetSpawn" | "mapSetEnabledChats" | "mapSetDescription" | "mapSetDecoration" | "mapSetTutorialTasks" | "mapSetMiniMapImagePath" | "mapSetScript" | "mapMoveObject" | "fxShakeObject" | "fxShakeCamera" | "speakerUpdatesSession" | "hipToBeSquare" | "mapSetNooks" | "mapDeleteObjectByKey" | "clientHeartbeat" | "clientBackupHeartbeat" | "updateSubscriptions" | "move" | "setAffiliation" | "setStatus" | "spotlight" | "ring" | "ban" | "kick" | "setImpassable" | "chat" | "interact" | "enterWhisper" | "leaveWhisper" | "setEmojiStatus" | "activelySpeaking" | "setName" | "setTextStatus" | "teleport" | "exit" | "enter" | "setWorkCondition" | "respawn" | "spawn" | "ghost" | "init" | "setOutfitString" | "shootConfetti" | "setEventStatus" | "setInConversation" | "setCurrentDesk" | "setCurrentArea" | "setImagePointer" | "setGoKartId" | "mapSetCollisions" | "mapSetSprites" | "mapSetSpaces" | "mapSetObjects" | "mapAddObject" | "mapDeleteObject" | "setIsAlone" | "playSound" | "setIsMobile" | "setScreenPointer" | "setEmoteV2" | "setFocusModeEndTime" | "mapDeleteObjectById" | "customAction" | "block" | "setItemString" | "triggerItem" | "notify" | "setFollowTarget" | "requestToLead" | "enterPortal" | "setManualVideoSrc" | "setSubtitle" | "playerUpdatesSession" | "chatMessageUpdated" | "registerCommand" | "sendCommand" | "addInventoryItem" | "removeInventoryItem" | "setVehicleId" | "setSpeedModifier" | "highFive" | "updateSpaceItems" | "stopSound" | "craft" | "triggerInventoryItem" | "setAllowScreenPointer" | "precomputeEnter" | "requestMute" | "setDeskInfo" | "requestToJoinNook" | "updateNookPermission" | "wave" | "setPronouns" | "setTitle" | "setTimezone" | "setPhone" | "setDescription" | "setProfileImageUrl" | "setPersonalImageUrl" | "setAway" | "setCity" | "setCountry" | "setStartDate" | "startRecording" | "requestAccessViaCheckIn" | "respondToAccessRequest" | "setAvailability" | "respawnAtDesk" | "setDeskFromNextAvailableDesk" | "setSpaceRolePermissionOverride" | "setCurrentlyEquippedWearables" | "setDisplayEmail" | "mapUpdateObjects" | "interactWithObject" | "triggerObject" | "joinChimeMeeting"

    Parameters

    • actionId: TCase
    • actionData: ActionDataByCase<TCase>
    • useTxn: true
    • Optional txnTimeoutMs: number

    Returns Promise<unknown>

    A promise if useTxn is true, otherwise nothing.

    This function can ONLY BE CALLED WITH AN EXPLICIT actionId !!! You don't get type safety if it's not! (see below for more)

  • Type Parameters

    • TCase extends "mapSetDimensions" | "mapSetBackgroundImagePath" | "mapSetForegroundImagePath" | "mapSetSpawns" | "mapSetPortals" | "mapSetAnnouncer" | "mapSetAssets" | "mapSetName" | "mapSetMuteOnEntry" | "mapSetUseDrawnBG" | "mapSetWalls" | "mapSetFloors" | "mapSetAreas" | "mapSetSpawn" | "mapSetEnabledChats" | "mapSetDescription" | "mapSetDecoration" | "mapSetTutorialTasks" | "mapSetMiniMapImagePath" | "mapSetScript" | "mapMoveObject" | "fxShakeObject" | "fxShakeCamera" | "speakerUpdatesSession" | "hipToBeSquare" | "mapSetNooks" | "mapDeleteObjectByKey" | "clientHeartbeat" | "clientBackupHeartbeat" | "updateSubscriptions" | "move" | "setAffiliation" | "setStatus" | "spotlight" | "ring" | "ban" | "kick" | "setImpassable" | "chat" | "interact" | "enterWhisper" | "leaveWhisper" | "setEmojiStatus" | "activelySpeaking" | "setName" | "setTextStatus" | "teleport" | "exit" | "enter" | "setWorkCondition" | "respawn" | "spawn" | "ghost" | "init" | "setOutfitString" | "shootConfetti" | "setEventStatus" | "setInConversation" | "setCurrentDesk" | "setCurrentArea" | "setImagePointer" | "setGoKartId" | "mapSetCollisions" | "mapSetSprites" | "mapSetSpaces" | "mapSetObjects" | "mapAddObject" | "mapDeleteObject" | "setIsAlone" | "playSound" | "setIsMobile" | "setScreenPointer" | "setEmoteV2" | "setFocusModeEndTime" | "mapDeleteObjectById" | "customAction" | "block" | "setItemString" | "triggerItem" | "notify" | "setFollowTarget" | "requestToLead" | "enterPortal" | "setManualVideoSrc" | "setSubtitle" | "playerUpdatesSession" | "chatMessageUpdated" | "registerCommand" | "sendCommand" | "addInventoryItem" | "removeInventoryItem" | "setVehicleId" | "setSpeedModifier" | "highFive" | "updateSpaceItems" | "stopSound" | "craft" | "triggerInventoryItem" | "setAllowScreenPointer" | "precomputeEnter" | "requestMute" | "setDeskInfo" | "requestToJoinNook" | "updateNookPermission" | "wave" | "setPronouns" | "setTitle" | "setTimezone" | "setPhone" | "setDescription" | "setProfileImageUrl" | "setPersonalImageUrl" | "setAway" | "setCity" | "setCountry" | "setStartDate" | "startRecording" | "requestAccessViaCheckIn" | "respondToAccessRequest" | "setAvailability" | "respawnAtDesk" | "setDeskFromNextAvailableDesk" | "setSpaceRolePermissionOverride" | "setCurrentlyEquippedWearables" | "setDisplayEmail" | "mapUpdateObjects" | "interactWithObject" | "triggerObject" | "joinChimeMeeting"

    Parameters

    • actionId: TCase
    • actionData: ActionDataByCase<TCase>
    • Optional useTxn: boolean
    • Optional txnTimeoutMs: number

    Returns void | Promise<unknown>

  • Parameters

    • emote: undefined | string
    • Optional targetId: string
    • Optional count: number

    Returns void

  • Parameters

    • focusModeEndTime: string
    • Optional targetId: string

    Returns void

  • Parameters

    • mapId: string
    • x: number
    • y: number
    • impassable: boolean = true

    Returns void

  • Parameters

    • mapId: string
    • x: number
    • y: number
    • w: number
    • h: number
    • mask: string

    Returns void

  • Parameters

    • mapId: string
    • nooks: {
          [key: string]: NookDiff;
      }
    • overwrite: boolean = false
    • useTxn: boolean = false

    Returns void | Promise<unknown>

  • Parameters

    • mapId: string
    • objects: {
          [key: string]: Partial<MapObject>;
      }
    • Optional updatesAreOverwrites: boolean

    Returns void

  • Parameters

    • mapId: string
    • objId: string
    • _obj: Partial<MapObject>
    • useTxnId: boolean = false

    Returns void | Promise<unknown>

  • Parameters

    • personalImageUrl: string
    • Optional targetId: string

    Returns void

  • Parameters

    • role: string
    • permission: string
    • enabled: boolean

    Returns void

  • Parameters

    • vehicleId: string
    • action: string
    • Optional targetId: string

    Returns void

  • Utility function for map developers that stops all sound file matching the src on the client, once. Use targetId if you are a space owner to stop a sound on another client. If no sound is specified, it stops the sounds for the entire space. You must be a space owner to play a sound on the whole space.

    Parameters

    • src: string

      HTMl5 compliant audio resource, e.g a URL to a mp3

    • Optional targetId: string

      id of another player you want to play the sound on

    Returns void

  • Parameters

    • callback: ((connected) => void)
        • (connected): void
        • Parameters

          • connected: boolean

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • callback: ((code?, reason?) => void)
        • (code?, reason?): void
        • Parameters

          • Optional code: number
          • Optional reason: string

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Calls a callback whenever the given event type is received. Does not send the subscription request to the server -- you have to declare those up front (see defaultSubscriptions).

    Type Parameters

    • T extends "info" | "warn" | "error" | "ready" | "serverHeartbeat" | "transactionStatus" | "playerMoves" | "playerSetsStatus" | "playerSpotlights" | "playerRings" | "playerChats" | "playerGhosts" | "playerEntersWhisper" | "playerLeavesWhisper" | "playerActivelySpeaks" | "playerSetsName" | "playerSetsTextStatus" | "playerSetsEmojiStatus" | "playerSetsAffiliation" | "playerExits" | "playerSetsIsSignedIn" | "spaceOverwrites" | "spaceIsClosed" | "playerEntersPortal" | "spaceSetsIdMapping" | "playerSetsLastActive" | "playerShootsConfetti" | "playerSetsEventStatus" | "playerSetsInConversation" | "playerSetsCurrentArea" | "playerSetsImagePointer" | "cookieFound" | "playerEntersWhisperV2" | "playerSetsGoKartId" | "mapSetDimensions" | "mapSetBackgroundImagePath" | "mapSetForegroundImagePath" | "mapSetSpawns" | "mapSetPortals" | "mapSetAnnouncer" | "mapSetAssets" | "mapSetName" | "mapSetMuteOnEntry" | "mapSetUseDrawnBG" | "mapSetWalls" | "mapSetFloors" | "mapSetAreas" | "mapSetSpawn" | "playerSetsIsAlone" | "playerJoins" | "mapSetEnabledChats" | "mapSetDescription" | "mapSetDecoration" | "mapSetTutorialTasks" | "mapSetMiniMapImagePath" | "spacePlaysSound" | "mapSetScript" | "playerSetsIsMobile" | "setScreenPointerServer" | "playerSetsEmoteV2" | "playerSetsFocusModeEndTime" | "spaceSetsSpaceMembers" | "spaceSetsSpaceUsers" | "customEvent" | "playerBlocks" | "playerUpdatesFocusModeStatus" | "playerNotifies" | "playerSetsItemString" | "playerSetsFollowTarget" | "playerRequestsToLead" | "playerSetsManualVideoSrc" | "playerSetsIsNpc" | "playerSetsSubtitle" | "mapCommitsChanges" | "mapMoveObject" | "playerEditsChatMessage" | "fxShakeObject" | "fxShakeCamera" | "playerSendsCommand" | "spaceRegistersCommand" | "speakerUpdatesSession" | "playerUpdatesInventory" | "spaceUpdatesItems" | "playerSetsVehicleId" | "playerSetsSpeedModifier" | "playerHighFives" | "spaceStopsSound" | "hipToBeSquare" | "playerCrafts" | "playerTriggersInventoryItem" | "playerSetsAllowScreenPointer" | "precomputedEnterLocation" | "gotRequestMute" | "playerSetsDeskInfo" | "mapSetNooks" | "dynamicGates" | "playerWaves" | "playerSetsPronouns" | "playerSetsTitle" | "playerSetsTimezone" | "playerSetsDescription" | "playerSetsPhone" | "playerSetsPersonalImageUrl" | "playerSetsProfileImageUrl" | "spaceSetsCapacity" | "spaceOverCapacityDeniesUser" | "playerSetsAway" | "mapSetCollisionsBits" | "playerSetsCity" | "playerSetsCountry" | "playerSetsStartDate" | "playerStartsRecording" | "accessRequestsUpdated" | "accessRequestRespondedTo" | "spaceSetsGuestPassStatuses" | "playerSetsAvailability" | "subscriptionsUpdated" | "spaceRolePermissionOverrideUpdated" | "playerSetsLastRaisedHand" | "playerSetsCurrentlyEquippedWearables" | "playerSetsDisplayEmail" | "mapDeleteObjectByKey" | "mapSetObjectsV2" | "playerInteractsWithObject" | "playerTriggersObject" | "chimeSetsUserInfo" | "playerChangesMaps"

    Parameters

    • eventId: T
    • handler: ((data, context) => void)
        • (data, context): void
        • Parameters

          • data: GameEventByCase<T>
          • context: ServerClientEventContext

          Returns void

    • Optional filter: ((data, context) => boolean)
        • (data, context): boolean
        • Parameters

          • data: GameEventByCase<T>
          • context: ServerClientEventContext

          Returns boolean

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • callback: ((eventId, duration) => void)
        • (eventId, duration): void
        • Parameters

          • eventId: "info" | "warn" | "error" | "ready" | "serverHeartbeat" | "transactionStatus" | "playerMoves" | "playerSetsStatus" | "playerSpotlights" | "playerRings" | "playerChats" | "playerGhosts" | "playerEntersWhisper" | "playerLeavesWhisper" | "playerActivelySpeaks" | "playerSetsName" | "playerSetsTextStatus" | "playerSetsEmojiStatus" | "playerSetsAffiliation" | "playerExits" | "playerSetsIsSignedIn" | "spaceOverwrites" | "spaceIsClosed" | "playerEntersPortal" | "spaceSetsIdMapping" | "playerSetsLastActive" | "playerShootsConfetti" | "playerSetsEventStatus" | "playerSetsInConversation" | "playerSetsCurrentArea" | "playerSetsImagePointer" | "cookieFound" | "playerEntersWhisperV2" | "playerSetsGoKartId" | "mapSetDimensions" | "mapSetBackgroundImagePath" | "mapSetForegroundImagePath" | "mapSetSpawns" | "mapSetPortals" | "mapSetAnnouncer" | "mapSetAssets" | "mapSetName" | "mapSetMuteOnEntry" | "mapSetUseDrawnBG" | "mapSetWalls" | "mapSetFloors" | "mapSetAreas" | "mapSetSpawn" | "playerSetsIsAlone" | "playerJoins" | "mapSetEnabledChats" | "mapSetDescription" | "mapSetDecoration" | "mapSetTutorialTasks" | "mapSetMiniMapImagePath" | "spacePlaysSound" | "mapSetScript" | "playerSetsIsMobile" | "setScreenPointerServer" | "playerSetsEmoteV2" | "playerSetsFocusModeEndTime" | "spaceSetsSpaceMembers" | "spaceSetsSpaceUsers" | "customEvent" | "playerBlocks" | "playerUpdatesFocusModeStatus" | "playerNotifies" | "playerSetsItemString" | "playerSetsFollowTarget" | "playerRequestsToLead" | "playerSetsManualVideoSrc" | "playerSetsIsNpc" | "playerSetsSubtitle" | "mapCommitsChanges" | "mapMoveObject" | "playerEditsChatMessage" | "fxShakeObject" | "fxShakeCamera" | "playerSendsCommand" | "spaceRegistersCommand" | "speakerUpdatesSession" | "playerUpdatesInventory" | "spaceUpdatesItems" | "playerSetsVehicleId" | "playerSetsSpeedModifier" | "playerHighFives" | "spaceStopsSound" | "hipToBeSquare" | "playerCrafts" | "playerTriggersInventoryItem" | "playerSetsAllowScreenPointer" | "precomputedEnterLocation" | "gotRequestMute" | "playerSetsDeskInfo" | "mapSetNooks" | "dynamicGates" | "playerWaves" | "playerSetsPronouns" | "playerSetsTitle" | "playerSetsTimezone" | "playerSetsDescription" | "playerSetsPhone" | "playerSetsPersonalImageUrl" | "playerSetsProfileImageUrl" | "spaceSetsCapacity" | "spaceOverCapacityDeniesUser" | "playerSetsAway" | "mapSetCollisionsBits" | "playerSetsCity" | "playerSetsCountry" | "playerSetsStartDate" | "playerStartsRecording" | "accessRequestsUpdated" | "accessRequestRespondedTo" | "spaceSetsGuestPassStatuses" | "playerSetsAvailability" | "subscriptionsUpdated" | "spaceRolePermissionOverrideUpdated" | "playerSetsLastRaisedHand" | "playerSetsCurrentlyEquippedWearables" | "playerSetsDisplayEmail" | "mapDeleteObjectByKey" | "mapSetObjectsV2" | "playerInteractsWithObject" | "playerTriggersObject" | "chimeSetsUserInfo" | "playerChangesMaps"
          • duration: number

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • mapId: string
    • key: string
    • obj: Partial<MapObject>
    • useTxn: boolean = false

    Returns void | Promise<unknown>

  • for a summary of the init flow, see the top of gather-game-client/src/Engine.ts

    Returns Promise<void>

    a Promise that resolves when connection, initialization, and full state sync are complete

Generated using TypeDoc