@wvdsh/api 0.1.115 → 0.1.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -410,6 +410,7 @@ export declare const GameplaySubdomain: {
410
410
  gameCloudId: string;
411
411
  userId: string;
412
412
  gameBuildId: string;
413
+ isAnonymous: boolean;
413
414
  }) => string;
414
415
  };
415
416
  export declare const PAID_CONTENT_PICOMATCH_OPTIONS: {
@@ -280,9 +280,10 @@ export const GameplaySubdomain = {
280
280
  }
281
281
  return (h >>> 0).toString(16).padStart(8, '0');
282
282
  },
283
- // `{gameCloudId}-{hashPart(userId)}-{hashPart(gameBuildId)}`
283
+ // `{gameCloudId}-{hashPart(userId)}-{hashPart(gameBuildId)}`, with `guest` in place of the user hash for anonymous users
284
284
  build(args) {
285
- const subdomain = `${args.gameCloudId}-${GameplaySubdomain.hashPart(args.userId)}-${GameplaySubdomain.hashPart(args.gameBuildId)}`;
285
+ const userPart = args.isAnonymous ? 'guest' : GameplaySubdomain.hashPart(args.userId);
286
+ const subdomain = `${args.gameCloudId}-${userPart}-${GameplaySubdomain.hashPart(args.gameBuildId)}`;
286
287
  if (subdomain.length > GameplaySubdomain.MAX_LENGTH) {
287
288
  throw new Error(`Gameplay subdomain exceeds ${GameplaySubdomain.MAX_LENGTH} characters`);
288
289
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wvdsh/api",
3
- "version": "0.1.115",
3
+ "version": "0.1.116",
4
4
  "description": "Public API types and shared constants for the Wavedash platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",