跳转到内容

IdentityAPI

此内容尚不支持你的语言。

Defined in: services/identity.ts:37

new IdentityAPI(): IdentityAPI

IdentityAPI

get available(): boolean

Defined in: services/identity.ts:40

Whether this platform can sign a player in at all — what a menu reads to hide its sign-in button rather than offer one that cannot work.

boolean

login(): Promise<LoginResult>

Defined in: services/identity.ts:52

Begin a sign-in.

Rejects with the host’s own words when it fails — this is a network round trip, and “it failed” without a reason is not something a game can act on. Rejects immediately where the platform has no sign-in, so a caller that skipped available hears about it rather than hanging.

Promise<LoginResult>


sessionValid(): Promise<boolean>

Defined in: services/identity.ts:63

Whether the host still regards the last sign-in as current.

The reason to ask is to SKIP a login: if the session your server holds is still good, exchanging a fresh code buys nothing. False where there is no sign-in at all — there is nothing current about nothing.

Promise<boolean>