@hadoku/game-server 0.1.222 → 0.1.223
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.
- package/dist/room/lobby.d.ts +18 -0
- package/dist/room/lobby.js +15 -0
- package/package.json +5 -5
package/dist/room/lobby.d.ts
CHANGED
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
import { FileRoomStore, type RoomCodec } from '@wolffm/rooms-server/store';
|
|
37
37
|
import { type Look } from '@wolffm/platform-wire/look';
|
|
38
38
|
import type { AnyRoomSettings } from '@wolffm/platform-wire/room-settings';
|
|
39
|
+
import type { RoomFloorTier } from '@wolffm/platform-wire/tiers';
|
|
39
40
|
import { type IdMove } from '../erase/anonymise.js';
|
|
40
41
|
import { type AiPersona } from './ai-faces.js';
|
|
41
42
|
import type { Caller } from './caller.js';
|
|
@@ -680,4 +681,21 @@ export interface PlainRoomView {
|
|
|
680
681
|
* membership, so without it the departed id stayed in the seat for good.
|
|
681
682
|
*/
|
|
682
683
|
export declare function plainRoomType<I extends RoomCreateInput>(size: PlainRoomSize): RoomTypeHooks<PlainGame, I>;
|
|
684
|
+
/** What `hostedRoomType` reads of a registered game type: its room's ceiling, its runtime, its match's table, its tier floor. */
|
|
685
|
+
export interface HostedRoomSpec {
|
|
686
|
+
seats: {
|
|
687
|
+
max: number;
|
|
688
|
+
};
|
|
689
|
+
runtime?: string;
|
|
690
|
+
table?: {
|
|
691
|
+
seats: number;
|
|
692
|
+
};
|
|
693
|
+
minTier?: RoomFloorTier;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* The room type of a registered game the host does not play itself: `plainRoomType`, opened at eight
|
|
697
|
+
* seats (or the game's `max`, if smaller) and growing to `max`. A relay game's room is its match, of
|
|
698
|
+
* `table.seats` (every seat, when the game names no table). The game's tier floor is every room's.
|
|
699
|
+
*/
|
|
700
|
+
export declare function hostedRoomType<I extends RoomCreateInput>(spec: HostedRoomSpec): RoomTypeHooks<PlainGame, I>;
|
|
683
701
|
export {};
|
package/dist/room/lobby.js
CHANGED
|
@@ -1212,3 +1212,18 @@ export function plainRoomType(size) {
|
|
|
1212
1212
|
...(size.relaySeats === undefined ? {} : { relaySeats: size.relaySeats }),
|
|
1213
1213
|
};
|
|
1214
1214
|
}
|
|
1215
|
+
/** The most seats a hosted room opens with; one whose game seats fewer opens at its game's `max`. */
|
|
1216
|
+
const HOSTED_OPENING_SEATS = 8;
|
|
1217
|
+
/**
|
|
1218
|
+
* The room type of a registered game the host does not play itself: `plainRoomType`, opened at eight
|
|
1219
|
+
* seats (or the game's `max`, if smaller) and growing to `max`. A relay game's room is its match, of
|
|
1220
|
+
* `table.seats` (every seat, when the game names no table). The game's tier floor is every room's.
|
|
1221
|
+
*/
|
|
1222
|
+
export function hostedRoomType(spec) {
|
|
1223
|
+
const plain = plainRoomType({
|
|
1224
|
+
seats: Math.min(HOSTED_OPENING_SEATS, spec.seats.max),
|
|
1225
|
+
max: spec.seats.max,
|
|
1226
|
+
...(spec.runtime === 'relay' ? { relaySeats: spec.table?.seats ?? spec.seats.max } : {}),
|
|
1227
|
+
});
|
|
1228
|
+
return spec.minTier === undefined ? plain : { ...plain, minTier: spec.minTier };
|
|
1229
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/game-server",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.223",
|
|
4
|
+
"gitHead": "14b716659caabca197ae7ab2d1c613ccb6e05397",
|
|
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,9 +16,9 @@
|
|
|
16
16
|
"play/remote/"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.
|
|
20
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
21
|
-
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.
|
|
19
|
+
"@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.223",
|
|
20
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.223",
|
|
21
|
+
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.256",
|
|
22
22
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.3",
|
|
23
23
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.152",
|
|
24
24
|
"@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.152",
|