TeleportDataServiceClient
Client half of the symmetric teleport-data surface, mirroring TeleportDataService. Same build API (via a shared TeleportDataBuilder) and the same Promise-based read API, so a system queries arrived data the same way on either realm and gets the same answer.
The client holds the full arrived payload natively: TeleportService:GetLocalPlayerTeleportData()
returns everything the player teleported in with, regardless of which realm set it. So the unified
read (TeleportDataServiceClient.PromiseArrivedData) resolves immediately from local data -- no
round-trip. Two things still cross the network:
- the client replicates its raw arrived payload to the server on start, because the server's join data is blind to a client-initiated teleport; and
- the client pulls its trusted band from the server (TeleportDataServiceClient.PromiseTrustedArrivedData), because the client cannot tell, from its own local data alone, which keys were server-authored.
Functions
RegisterTeleportDataProvider
Registers a shared provider. See TeleportDataBuilder.RegisterTeleportDataProvider.
RegisterPerPlayerTeleportDataProvider
TeleportDataServiceClient.RegisterPerPlayerTeleportDataProvider(provider: PerPlayerTeleportDataProvider) → () → ()Registers a per-player provider. See TeleportDataBuilder.RegisterPerPlayerTeleportDataProvider.
PromiseBuildTeleportData
Builds the teleport data envelope for a teleport (typically { Players.LocalPlayer }, since a client
can only teleport itself), awaiting any provider that returns a Promise. See
TeleportDataBuilder.PromiseBuildTeleportData.
_getLocalUserId
Resolves the UserId used to select the local player's envelope slice. A method so tests can stand in a
fixed id (a headless client has no Players.LocalPlayer), mirroring the server's _getUserId.
PromiseArrivedData
TeleportDataServiceClient.PromiseArrivedData(self: TeleportDataServiceClient) → Promise<{[string]: any}?>Returns the unified teleport data the local player arrived with, or nil. Resolves immediately: the client's local teleport data already contains everything the player arrived with (trusted keys included), so the merge is a no-op here. Mirrors TeleportDataService.PromiseArrivedData.
PromiseTrustedArrivedData
TeleportDataServiceClient.PromiseTrustedArrivedData(self: TeleportDataServiceClient) → Promise<{[string]: any}?>Returns the trusted-band teleport data the local player arrived with (server-authored), or nil. Pulled from the server, which alone knows which keys came through its join data. Mirrors TeleportDataService.PromiseTrustedArrivedData.
PromiseNonTrustedArrivedData
TeleportDataServiceClient.PromiseNonTrustedArrivedData(self: TeleportDataServiceClient) → Promise<{[string]: any}?>Returns the non-trusted-band teleport data the local player arrived with (its own local data), or nil. This is the band the client replicates to the server. Mirrors TeleportDataService.PromiseNonTrustedArrivedData.
PromiseArrivedValue
Returns the unified value the local player arrived with under key, or nil.
PromiseHasArrivedValue
Returns whether the local player arrived with a unified value under key.
PromiseTrustedArrivedValue
Returns the trusted-band value the local player arrived with under key, or nil.
PromiseHasTrustedArrivedValue
Returns whether the local player arrived with a trusted-band value under key.
PromiseArrivedValueIsTrusted
Returns whether the unified value for key came from the trusted band. Mirrors
TeleportDataService.PromiseArrivedValueIsTrusted.
SetNonTrustedArrivedTeleportDataForTesting
TeleportDataServiceClient.SetNonTrustedArrivedTeleportDataForTesting(data: {[string]: any}?) → ()Overrides the local (non-trusted) arrived band. Test seam -- headless test clients have no real teleport data. Must be called before anything reads.
SetTrustedArrivedTeleportDataForTesting
TeleportDataServiceClient.SetTrustedArrivedTeleportDataForTesting(data: {[string]: any}?) → ()Overrides the trusted band the client would otherwise pull from the server. Test seam -- headless test clients have no server to invoke. Must be called before anything reads.
SetTrustedFetchTimeoutForTesting
TeleportDataServiceClient.SetTrustedFetchTimeoutForTesting(seconds: number) → ()Sets the bounded wait for the server's trusted-band response. Test seam.