@zaisma/game-server 1.17.0 → 1.18.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/bench/glass.js CHANGED
@@ -9750,7 +9750,9 @@ var PERFORMANCE_CHECK_LIMITS = {
9750
9750
  /** How much a game page downloads before Play (Game files start before Play). */
9751
9751
  maximumWarmUpSizeBytes: 100 * 1024 ** 2,
9752
9752
  /** On an iPhone, a game page downloads before Play only a game whose start files come to this or less, all of them or none. */
9753
- maximumPhoneWarmUpSizeBytes: 10 * 1e3 ** 2
9753
+ maximumPhoneWarmUpSizeBytes: 10 * 1e3 ** 2,
9754
+ /** How many of a version's redirects to content addresses the warm-up keeps ahead of time in browsers that need it (warm.js). */
9755
+ maximumWarmUpRedirectCount: 5e3
9754
9756
  };
9755
9757
  var RUN_NOTE_CODES = {
9756
9758
  error_at_start: { meaning: "The game threw an error while starting.", fix: "Open the version's preview in Chrome with the console open; fix the error, then upload again." },
@@ -29249,7 +29251,8 @@ function coverFor(game, list, at) {
29249
29251
  let sort = "played";
29250
29252
  function fillContinue() {
29251
29253
  const row = $("home-continue"), list = playedList();
29252
- row.hidden = !list.length;
29254
+ // An account's covers from the server stay while its list is on its way.
29255
+ row.hidden = !list.length && !$("track-continue").querySelector(".cover");
29253
29256
  if (!list.length) return;
29254
29257
  if (sort === "updated") list.sort((a, b) => (bySlug[b.slug].published_at_ms || 0) - (bySlug[a.slug].published_at_ms || 0));
29255
29258
  // What the page already shows (an account's, from the server) stays as it is.
@@ -53067,9 +53070,11 @@ function warmUp() {
53067
53070
  const isComputer = !matchMedia("(pointer: coarse)").matches;
53068
53071
  const isAndroidOnWifi = /Android/.test(navigator.userAgent) && connection && (connection.type === "wifi" || connection.type === "ethernet");
53069
53072
  const isIPhone = /iPhone/.test(navigator.userAgent);
53070
- if (frame || !gamePage.warm_url || (connection && connection.saveData === true) || !(isComputer || isAndroidOnWifi || isIPhone)) return;
53073
+ // An iPad downloads nothing ahead of time: its warm-up only keeps redirects (warm.js), so an update there downloads only what changed.
53074
+ const isIPad = !isComputer && (/iPad/.test(navigator.userAgent) || navigator.platform === "MacIntel");
53075
+ if (frame || !gamePage.warm_url || (connection && connection.saveData === true) || !(isComputer || isAndroidOnWifi || isIPhone || isIPad)) return;
53071
53076
  warming = document.createElement("iframe");
53072
- warming.src = gamePage.warm_url + (isComputer || isAndroidOnWifi ? "" : "?maximum_start_size_bytes=${PERFORMANCE_CHECK_LIMITS.maximumPhoneWarmUpSizeBytes}");
53077
+ warming.src = gamePage.warm_url + (isComputer || isAndroidOnWifi ? "" : "?maximum_start_size_bytes=" + (isIPad ? 0 : ${PERFORMANCE_CHECK_LIMITS.maximumPhoneWarmUpSizeBytes}));
53073
53078
  warming.setAttribute("sandbox", "allow-scripts allow-same-origin");
53074
53079
  warming.hidden = true;
53075
53080
  warming.setAttribute("aria-hidden", "true");
package/bin/local-play.js CHANGED
@@ -36,7 +36,7 @@ export const LOCAL_VERSION_ID = "version_local";
36
36
  export const LOCAL_FOLDER = ".zaisma-local";
37
37
  /** Every _zaisma/ file the games Worker serves, split by whether it works here or only loads and does nothing (test/node/local-play-parity.test.ts holds this to apps/games/src/index.ts). */
38
38
  export const SERVED_ZAISMA_PATHS = ["_zaisma/v1.js", "_zaisma/v1.d.ts", "_zaisma/relay.js", "_zaisma/picture.js", "_zaisma/saves.js", "_zaisma/restore"];
39
- export const ONLY_ON_ZAISMA_PATHS = ["_zaisma/performance.js", "_zaisma/warm", "_zaisma/warm.json", "_zaisma/warm.js"];
39
+ export const ONLY_ON_ZAISMA_PATHS = ["_zaisma/performance.js", "_zaisma/warm", "_zaisma/warm.json", "_zaisma/warm-redirects.json", "_zaisma/warm.js"];
40
40
  const OPTION_NAMES = ["gameFolder", "port", "isOnNetwork", "gameSlug", "zaismaKey", "developerApiUrl", "log"];
41
41
  const SAVE_LIMIT_BYTES = 5 * 1024 * 1024;
42
42
  const PASS_DURATION_SEC = 24 * 3600;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaisma/game-server",
3
- "version": "1.17.0",
3
+ "version": "1.18.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",