@zaisma/game-server 1.35.0 → 1.37.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaisma/game-server",
3
- "version": "1.35.0",
3
+ "version": "1.37.0",
4
4
  "description": "Run your Zaisma game server: the same rooms on Zaisma or on your own server.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://zaisma.com",
package/src/room.d.ts CHANGED
@@ -802,15 +802,20 @@ export declare const GAME_SERVER_OPTIONS: readonly ["maximumPlayerCount", "maxim
802
802
  */
803
803
  export declare const GAME_SERVER_LIMITS: {
804
804
  /**
805
- * Every file of the game server together, code and data files. Cloudflare takes a Worker of 64 MB, but a room holds the
806
- * files in memory (128 MB, shared) while it hands them to the sandbox, so half of that is what a room can carry safely.
805
+ * Every file of the game server together, code and data files. The data files stream from storage straight into the
806
+ * game server's own memory (maximumMemorySizeBytes), so this leaves half of it for the runtime and the rooms' state.
807
807
  */
808
808
  readonly maximumSizeBytes: number;
809
+ /**
810
+ * The code alone (.js, .json and .wasm): a room holds it in its memory (128 MB, shared with other rooms) while it hands
811
+ * it to the sandbox, so this is what a room carries safely.
812
+ */
813
+ readonly maximumCodeSizeBytes: number;
809
814
  /** Files in the zaisma-server/ folder: each is read once whenever a copy of the game server loads. */
810
815
  readonly maximumFileCount: 500;
811
816
  /** CPU for one call: a tick with the messages since the last one, a join, a request, a schedule's run. */
812
817
  readonly maximumCallCpuDurationMs: 50;
813
- /** CPU for one start: loading the game server, setup, onRestored, and a real-time room's first tick after either. */
818
+ /** CPU for one start: loading the game server, setup, onRestored, and a real-time room's first tick after any of them, or after its state is put back in a fresh copy of the game server, onRestored or not. */
814
819
  readonly maximumStartCpuDurationMs: 5000;
815
820
  /** CPU for the game server's top-level code (outside its handlers) as it loads: Cloudflare's own limit. Heavy work goes in the first tick. */
816
821
  readonly maximumLoadCpuDurationMs: 1000;
package/src/room.js CHANGED
@@ -141,15 +141,20 @@ export const GAME_SERVER_OPTIONS = [
141
141
  */
142
142
  export const GAME_SERVER_LIMITS = {
143
143
  /**
144
- * Every file of the game server together, code and data files. Cloudflare takes a Worker of 64 MB, but a room holds the
145
- * files in memory (128 MB, shared) while it hands them to the sandbox, so half of that is what a room can carry safely.
144
+ * Every file of the game server together, code and data files. The data files stream from storage straight into the
145
+ * game server's own memory (maximumMemorySizeBytes), so this leaves half of it for the runtime and the rooms' state.
146
146
  */
147
- maximumSizeBytes: 32 * 1024 * 1024,
147
+ maximumSizeBytes: 64 * 1024 * 1024,
148
+ /**
149
+ * The code alone (.js, .json and .wasm): a room holds it in its memory (128 MB, shared with other rooms) while it hands
150
+ * it to the sandbox, so this is what a room carries safely.
151
+ */
152
+ maximumCodeSizeBytes: 32 * 1024 * 1024,
148
153
  /** Files in the zaisma-server/ folder: each is read once whenever a copy of the game server loads. */
149
154
  maximumFileCount: 500,
150
155
  /** CPU for one call: a tick with the messages since the last one, a join, a request, a schedule's run. */
151
156
  maximumCallCpuDurationMs: 50,
152
- /** CPU for one start: loading the game server, setup, onRestored, and a real-time room's first tick after either. */
157
+ /** CPU for one start: loading the game server, setup, onRestored, and a real-time room's first tick after any of them, or after its state is put back in a fresh copy of the game server, onRestored or not. */
153
158
  maximumStartCpuDurationMs: 5000,
154
159
  /** CPU for the game server's top-level code (outside its handlers) as it loads: Cloudflare's own limit. Heavy work goes in the first tick. */
155
160
  maximumLoadCpuDurationMs: 1000,