@zhuweiyou/dsh-holdem 0.1.2 → 0.1.4
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/README.md +19 -20
- package/lib/client.js +331 -283
- package/lib/client.js.map +1 -1
- package/lib/index.js +41 -10
- package/lib/index.js.map +1 -1
- package/lib/types/client/ActionBar.d.ts +6 -1
- package/lib/types/client/ActionBar.d.ts.map +1 -1
- package/lib/types/client/Table.d.ts.map +1 -1
- package/lib/types/client/i18n.d.ts.map +1 -1
- package/lib/types/client/store.d.ts.map +1 -1
- package/lib/types/config.d.ts +5 -0
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/invariant.d.ts +6 -1
- package/lib/types/invariant.d.ts.map +1 -1
- package/lib/types/net/ws.d.ts.map +1 -1
- package/lib/types/room/RoomManager.d.ts +10 -0
- package/lib/types/room/RoomManager.d.ts.map +1 -1
- package/lib/types/types.d.ts +2 -0
- package/lib/types/types.d.ts.map +1 -1
- package/lib/worker.js +41 -9
- package/lib/worker.js.map +1 -1
- package/package.json +1 -1
- package/worker/index.ts +3 -0
package/package.json
CHANGED
package/worker/index.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface Env {
|
|
|
22
22
|
ROOMS: DurableObjectNamespace
|
|
23
23
|
/** 房间上限等可选覆盖 */
|
|
24
24
|
MAX_ROOMS?: string
|
|
25
|
+
/** 观战席位上限的可选覆盖 */
|
|
26
|
+
MAX_SPECTATORS?: string
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
const CORS_HEADERS = {
|
|
@@ -103,6 +105,7 @@ export class RoomsDurableObject {
|
|
|
103
105
|
constructor(_state: DurableObjectState, env: Env) {
|
|
104
106
|
const overrides: Record<string, unknown> = {}
|
|
105
107
|
if (env.MAX_ROOMS) overrides.maxRooms = Number(env.MAX_ROOMS)
|
|
108
|
+
if (env.MAX_SPECTATORS) overrides.maxSpectators = Number(env.MAX_SPECTATORS)
|
|
106
109
|
const config = resolveConfig(overrides as never)
|
|
107
110
|
this.manager = new RoomManager({
|
|
108
111
|
config,
|