@hadoku/game-server 0.1.71 → 0.1.73

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.
@@ -11,6 +11,7 @@ declare const EventRecordSchema: z.ZodObject<{
11
11
  eventId: z.ZodString;
12
12
  sent: z.ZodString;
13
13
  }, z.core.$strip>>;
14
+ removed: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
15
  createdAt: z.ZodNumber;
15
16
  }, z.core.$strip>;
16
17
  export type EventRecord = z.infer<typeof EventRecordSchema>;
@@ -46,6 +47,8 @@ export interface Events {
46
47
  create(event: NewEvent, now: number): EventRecord;
47
48
  reschedule(id: string, callerId: string, startsAt: number): EventChange;
48
49
  cancel(id: string, callerId: string): EventChange;
50
+ /** The organizer takes `signupId` off the event's sign-ups (`EventRecord.removed`). */
51
+ removeSignup(id: string, callerId: string, signupId: string): EventChange;
49
52
  /** Record what Discord's calendar now holds for an event, or that it holds nothing (`undefined`). No-op for an event since cancelled. */
50
53
  setDiscord(id: string, discord: EventRecord['discord']): void;
51
54
  /** Every attached form, oldest first. */
@@ -25,6 +25,11 @@ const EventRecordSchema = z.object({
25
25
  formId: z.string().optional(),
26
26
  /** What the Discord server's calendar holds for it, as last sent (`discord-events.ts`): absent while it has none. */
27
27
  discord: z.object({ eventId: z.string(), sent: z.string() }).optional(),
28
+ /**
29
+ * Sign-ups the organizer removed, by `EventSignup.id`: a form answer under one of these is not
30
+ * listed. Someone removed from the room who joins it again is signed up again, as a member.
31
+ */
32
+ removed: z.array(z.string()).optional(),
28
33
  createdAt: z.number(),
29
34
  });
30
35
  const FormRecordSchema = z.object({
@@ -121,6 +126,19 @@ export async function openEvents(file, log, now = Date.now) {
121
126
  void save();
122
127
  return found;
123
128
  },
129
+ removeSignup(id, callerId, signupId) {
130
+ const found = owned(id, callerId);
131
+ if (!found.ok)
132
+ return found;
133
+ const removed = found.event.removed ?? [];
134
+ if (removed.includes(signupId))
135
+ return found;
136
+ const event = { ...found.event, removed: [...removed, signupId] };
137
+ events = events.map((e) => (e.id === id ? event : e));
138
+ log({ event: 'event-signup-removed', id });
139
+ void save();
140
+ return { ok: true, event };
141
+ },
124
142
  setDiscord(id, discord) {
125
143
  const found = events.find((e) => e.id === id);
126
144
  if (found === undefined)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/game-server",
3
- "version": "0.1.71",
4
- "gitHead": "eb198fb94e7021c2f65fa71802c1dab746741a1b",
3
+ "version": "0.1.73",
4
+ "gitHead": "2ada02180afff2e2d5f9e4c28ee9b97be29d3c66",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "The server parts any hosted game shares, above the kernel: the app config and edge auth, the room core (identity, seats, sessions, membership, the room list, the generic room routes), match hosting (the host contract, local and remote JVMs, placement, the start queue, recordings, the in-process and relay runtimes), streams, erase, telemetry and usage. Knows no game; Magic plugs in from apps/server. MIT; imports only node built-ins, express, socket.io, @wolffm/* and the platform packages.",
@@ -16,12 +16,12 @@
16
16
  "play/remote/"
17
17
  ],
18
18
  "dependencies": {
19
- "@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.71",
20
- "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.71",
21
- "@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.104",
19
+ "@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.73",
20
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.73",
21
+ "@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.106",
22
22
  "@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.30",
23
- "@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.121",
24
- "@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.121",
23
+ "@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.122",
24
+ "@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.122",
25
25
  "express": "^5.1.0",
26
26
  "socket.io": "^4.8.3",
27
27
  "zod": "4.5.4"