@energy8platform/game-engine 0.43.0 → 0.43.3
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/host.cjs.js +12 -4
- package/dist/host.cjs.js.map +1 -1
- package/dist/host.d.ts +1 -1
- package/dist/host.esm.js +12 -4
- package/dist/host.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/host/autoplay.ts +12 -4
- package/src/host/shellConfig.ts +3 -3
package/src/host/autoplay.ts
CHANGED
|
@@ -25,8 +25,9 @@ export interface AutoplayDeps {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface Autoplay {
|
|
28
|
-
/** Begin an autoplay run of `count` rounds (no-op if already
|
|
29
|
-
* halted run RESUMES: the shell sends the preserved count back (`start(remaining)`)
|
|
28
|
+
/** Begin an autoplay run of `count` rounds (no-op if a run is already active, or count ≤ 0).
|
|
29
|
+
* Also how a halted run RESUMES: the shell sends the preserved count back (`start(remaining)`),
|
|
30
|
+
* and how a player restarts straight after STOP, while the stopped round is still playing out. */
|
|
30
31
|
start(count: number): void;
|
|
31
32
|
/** Stop the run and clear the counter — the player pressed STOP, or the budget ran out. */
|
|
32
33
|
stop(): void;
|
|
@@ -86,11 +87,18 @@ export function createAutoplayLoop(deps: AutoplayDeps): Autoplay {
|
|
|
86
87
|
|
|
87
88
|
return {
|
|
88
89
|
start(count: number): void {
|
|
89
|
-
if (active ||
|
|
90
|
+
if (active || count <= 0) return;
|
|
90
91
|
active = true;
|
|
91
92
|
remaining = count;
|
|
92
93
|
deps.onState({ active: true, remaining });
|
|
93
|
-
|
|
94
|
+
// `running` bars a SECOND loop, not a new run. After stop(), the round already in flight keeps
|
|
95
|
+
// animating and the loop stays parked on `await playRound`, so `running` is still true for as
|
|
96
|
+
// long as that takes — several seconds through a win. Bailing here made the restart a silent
|
|
97
|
+
// no-op, and silent is what hurt: ShellController.startAutoplay has already lit the disc with
|
|
98
|
+
// the chosen count, so the player saw autoplay running with a counter that never moved.
|
|
99
|
+
// The parked loop re-reads `active`/`remaining` on its next turn and simply carries on with
|
|
100
|
+
// the new budget — no second loop, nothing dropped.
|
|
101
|
+
if (!running) void loop();
|
|
94
102
|
},
|
|
95
103
|
stop,
|
|
96
104
|
halt,
|
package/src/host/shellConfig.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface ShellRuntime {
|
|
|
61
61
|
/** Social-casino mode from initData (`config.socialMode`); swaps shell vocabulary. */
|
|
62
62
|
social?: boolean;
|
|
63
63
|
/** Disclaimer lines the PLATFORM supplied (`initData.config.disclaimerLines` — in practice the
|
|
64
|
-
* Stake bridge, which appends its own "TM and © {year}
|
|
64
|
+
* Stake bridge, which appends its own "TM and © {year} Engine." to the mandated body).
|
|
65
65
|
* They outrank the default. When absent — Artube, dev, any other host — the shell's canonical
|
|
66
66
|
* `DISCLAIMER_LINES` are used: the same mandated wording, minus a mark that isn't theirs. The
|
|
67
67
|
* disclaimer is required legal copy, so there is no case where the section is simply missing. */
|
|
@@ -260,8 +260,8 @@ function winsSection(model: GameModel): GameInfoSection | null {
|
|
|
260
260
|
/** Title of the legal disclaimer section — used to build it and to exempt it from socialization. */
|
|
261
261
|
const DISCLAIMER_TITLE = 'DISCLAIMER';
|
|
262
262
|
|
|
263
|
-
/** The copyright/brand line ("TM and © {year}
|
|
264
|
-
* lines localize. Detecting the brand keeps "
|
|
263
|
+
/** The copyright/brand line ("TM and © {year} Engine.") is shown verbatim; the legal body
|
|
264
|
+
* lines localize. Detecting the brand keeps " Engine" out of the translation lookup entirely. */
|
|
265
265
|
function isBrandLine(line: string): boolean {
|
|
266
266
|
return /stake\s+engine/i.test(line);
|
|
267
267
|
}
|