Files
herryyun 7c25c89992
CI / test (ubuntu-latest, node 22) (push) Failing after 33m10s
CI / test (ubuntu-latest, node 24) (push) Failing after 34m41s
CI / tooling (lint, imports, typecheck) (push) Failing after 36m11s
CI / test (windows-latest, node 22) (push) Canceled after 0s
CI / test (windows-latest, node 24) (push) Canceled after 0s
实现账号绑定、持久登录与跨设备对局恢复
2026-10-14 23:22:50 +08:00

6 lines
483 B
JavaScript

// A role's UID is unique within its provider-reported server region. Display names are never identity keys.
// gameId is optional provider metadata (the official password API may omit it), so it cannot be part of identity.
export const roleKey = (role) => JSON.stringify([String(role.channelName || '').trim(), String(role.uid).trim()]);
export const hasRoleIdentity = (role) => role?.uid != null && String(role.uid).trim() !== ''
&& String(role.channelName || '').trim() !== '';