Skip to content

Commit

Permalink
🗑️ Remove custom game identifier format
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdodo committed Dec 17, 2024
1 parent 90d6379 commit 88fec56
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
12 changes: 2 additions & 10 deletions core/types/playsig.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import type { FromSchema } from "json-schema-to-ts";
import type { JsonSchemaRecommended } from "json-schema-policies";
import { uidSchema } from "./uid.js";

export type Playsig = string;

export const playsigSchema = {
type: "string",
title: "Playsig",
description:
"Unique identifier for a game. Also a digest that " +
"can be computed from from it's public keys.",
minLength: 8,
maxLength: 64,
pattern: "^[0-9a-fA-F]+$",
} as const;
export const playsigSchema = uidSchema;

const a: Playsig = {} as FromSchema<typeof playsigSchema>;
const b: FromSchema<typeof playsigSchema> = {} as Playsig;
Expand Down
10 changes: 0 additions & 10 deletions core/utils/create-playsig.ts

This file was deleted.

4 changes: 2 additions & 2 deletions core/workflows/matchmake.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Subscription } from "rxjs";
import { createPlaysig } from "../utils/create-playsig.js";
import type { BackContext } from "../types/back-context.js";
import { filter } from "rxjs";
import type { Hero } from "../types/hero.js";
Expand All @@ -9,6 +8,7 @@ import { Phase } from "../types/phase.js";
import { getRandomAppellation } from "../utils/get-random-appellation.js";
import { createPool } from "../utils/create-pool.js";
import type { Level } from "../types/level.js";
import { uid } from "uid";

export function matchmake({
dataMapper: { queuers$, createGameWithPoolAndDeleteQueuers },
Expand Down Expand Up @@ -36,7 +36,7 @@ export function matchmake({
const playerLevel: Record<string, Level> = {};
const playerBenches: Record<string, Record<number, Hero>> = {};
const playerHealths: Record<string, number> = {};
const playsig = createPlaysig(players);
const playsig = uid();
const pool = createPool(playsig);

for (const player of players) {
Expand Down

0 comments on commit 88fec56

Please sign in to comment.