Compare commits

...
Author SHA1 Message Date
waozi e3481ba30f Release Arcade 0.7.104 with the latest game releases 2026-10-28 17:49:51 +00:00
waozi 5841794413 Release Arcade 0.7.103 with the latest game releases 2026-10-28 16:32:15 +00:00
waozi 549872d581 Align game packages with the new Play Dew releases 2026-10-28 13:00:46 -03:00
waozi 89d356040d Advance Shovey Play release with shared Dew pricing 2026-10-28 12:39:25 -03:00
waozi 02601a6696 Update shared Profile with Play Dew savings 2026-10-28 12:34:48 -03:00
waozi 9216224da7 Include the shared 10 Dew option in hosted Google Play profiles 2026-10-28 11:58:25 -03:00
waozi 70b05d585e Release Arcade 0.7.101 with the latest game releases 2026-10-28 07:05:31 +00:00
waozi 2760ba162a Wait for Arcade's failure signal when the test frame races 2026-10-28 03:43:27 -03:00
waozi 3d5661f1a4 Keep Arcade recoverable after a failed installed game frame 2026-10-28 03:30:52 -03:00
waozi 10feef0941 Release Arcade 0.7.100 with the latest game releases 2026-10-27 22:24:38 +00:00
waozi 4e2119ac22 Pin Kryon that repaints separate changes apart 2026-10-27 18:53:09 -03:00
waozi 2e2bae31f3 Release Arcade 0.7.99 with the latest game releases 2026-10-27 21:48:39 +00:00
waozi 7ccefe55da Pin Kryon with cached canvas text and the last image looked up first 2026-10-27 18:30:37 -03:00
waozi a76516a5d3 Release Arcade 0.7.98 with Shovey 0.6.158
In Shovey's Google Play version, buy Dew in Profile through Google Play.
Pip explains wooden doors when Shovey walks up to one, rather than when
the level starts.
2026-10-27 18:08:04 -03:00
waozi 1b12719e11 Sell Dew through Google Play in Shovey's Google Play bundle
The Play bundle is now Kryon's Google Play edition (app.edition=gplay).
It compiles Kryon's PlayBilling class from the Kryon checkout, adds Play
Billing 9.1.0 with one Kotlin version, uses AndroidX and needs Android 6.
Entity's edition turns Monero funding off there, so the Profile's Top up
opens Entity's Dew page with Play's prices instead of dew.waozi.xyz;
Arcade no longer disables funding itself. The direct download keeps
Monero.
2026-10-27 18:06:50 -03:00
waozi 3a62cd55b6 Release Arcade 0.7.97 with the latest game releases 2026-10-27 21:05:53 +00:00
waozi a0f8946692 Release Arcade 0.7.96 with the latest game releases 2026-10-27 20:48:00 +00:00
waozi fb5d8d0af8 Keep Arcade browser runtime files on one cache revision 2026-10-27 17:26:02 -03:00
waozi 37f11bfe0b Release Arcade 0.7.95 with Shovey 0.6.157
Pip's tips keep what he points at in view: his card moves under the top
bar when it would cover it, such as the home in level 1.
2026-10-27 17:11:36 -03:00
13 changed files with 366 additions and 70 deletions

No files matched your search

+53
View File
@@ -1,5 +1,58 @@
# Arcade changelog
## 0.7.104
- Apfelwurm 0.2.12: Download the Google Play edition as a separate `-gplay.apk`. The standard and F-Droid APKs exclude Google libraries and keep Monero top-ups.
## 0.7.103
- Apfelwurm 0.2.11: Buy a small 10 Dew pack in the Google Play edition and see each larger pack’s savings per Dew.
## 0.7.102
- Update Apfelwurm and Shovey with a small 10 Dew pack and visible larger-pack savings in their Google Play editions.
## 0.7.101
- Apfelwurm 0.2.10: Keep signed-in progress and unfinished runs after closing or updating Apfelwurm inside Arcade and Breeze.
- Apfelwurm 0.2.10: Restore earned unlocks from older account saves without changing completed levels or the current run.
- Apfelwurm 0.2.10: Give Apfelwurm its own Android launcher icon.
## 0.7.100
- Apfelwurm 0.2.9: More portal rooms in the mountains: five more boards have a walled corner room whose doorway closes, so a ring is the only way in, and boards there that bring portals use their room. Seven of the last twenty boards now have a portal room.
## 0.7.99
- Shovey 0.6.158: In the Google Play version, buy Dew in Profile through Google Play.
- Shovey 0.6.158: Pip explains wooden doors when Shovey walks up to one, rather than when the level starts.
- Apfelwurm 0.2.8: After the meadow, a new idea arrives every few dozen levels and keeps coming back: squirrels that dash and sit from level 45, hedgehogs that curl into a spiky ball as you come close from 85, keys that open a gate from 101, frogs that hop two tiles from 125, switch stones that open and close a gate from 141, rolling stones from 165 and portal rooms, reached only through a ring, from 181.
- Apfelwurm 0.2.8: Each new idea takes every other board for ten levels. After that, the ideas you have met take turns, with no more than two plain boards in a row.
- Apfelwurm 0.2.8: A gate closes a doorway up to four tiles wide. Its key opens it for good and is worth 2 points; a switch stone flips it each time you arrive on it. Boards with a gate or a portal room score more.
- Apfelwurm 0.2.8: New pictures for the squirrel, hedgehog, frog, rolling stone, key, switch stone and gate.
## 0.7.98
- Shovey 0.6.158: In the Google Play version, buy Dew in Profile through Google Play.
- Shovey 0.6.158: Pip explains wooden doors when Shovey walks up to one, rather than when the level starts.
## 0.7.97
- Apfelwurm 0.2.6: Glowing portals arrive from level 61: first on a few boards, then more often, with two pairs late in the mountains. Steer into one ring to come out of its partner, keeping your direction. Each ring stands in open ground, so you can always go around it.
- Apfelwurm 0.2.6: See your best run on the Profile leaderboard: the furthest level you reached and your highest score, as separate Level and Score columns ranked against your friends.
- Apfelwurm 0.2.6: Sign in once for every waozi.xyz site: a profile signed in on Arcade, Dew or here is used by the others in the same browser.
- Apfelwurm 0.2.6: Buy Dew inside the Google Play version through Google Play, priced in your own currency. The direct download and F-Droid versions keep buying Dew with Monero.
- Apfelwurm 0.2.6: The privacy page explains Google Play purchases and how to delete your account.
## 0.7.96
- Shovey 0.6.157: Pip's tips keep what he points at in view: his card moves under the top bar when it would cover it, such as the home in level 1.
- Apfelwurm 0.2.4: Play on the whole page at wurm.waozi.xyz, without a title bar above the game.
## 0.7.95
- Shovey 0.6.157: Pip's tips keep what he points at in view: his card moves under the top bar when it would cover it, such as the home in level 1.
## 0.7.94
- The library's game covers download about four times faster.
+1 -1
View File
@@ -1 +1 @@
0.7.94
0.7.104
+6 -6
View File
@@ -13,8 +13,8 @@
"shovey": {
"id": "arcade.shovey",
"title": "Shovey",
"version": "0.6.156",
"sequence": 164,
"version": "0.6.159",
"sequence": 167,
"host_api": 12
},
"shovey-island": {
@@ -34,15 +34,15 @@
"arcade": {
"id": "inbe.arcade",
"title": "Arcade",
"version": "0.7.94",
"sequence": 173,
"version": "0.7.104",
"sequence": 183,
"host_api": 36
},
"wurm": {
"id": "xyz.waozi.wurm",
"title": "Apfelwurm",
"version": "0.2.2",
"sequence": 9,
"version": "0.2.12",
"sequence": 16,
"host_api": 12
}
}
+27 -2
View File
@@ -22,6 +22,17 @@ def ledger = new groovy.json.JsonSlurper().parse(file('../../apps/versions.json'
def appRelease = ledger.node_apps[standaloneShovey ? 'shovey' : 'arcade']
def appCodegen = envOrProp('KRYON_PROJECT_CODEGEN', 'app.codegen') ?: 'c99'
// Kryon's three editions: -Papp.edition=direct (the default), fdroid or gplay.
// The Google Play edition adds Kryon's Play Billing (kryon/play_billing), so
// Entity sells Dew through Google Play; it needs Android 6 and AndroidX
// (-Pandroid.useAndroidX=true). Native code sees GOOGLE_PLAY or FDROID.
def appEdition = (project.findProperty('app.edition') ?:
(project.findProperty('app.googlePlay') == 'true' ? 'gplay' : 'direct')).toString()
if (!(appEdition in ['direct', 'fdroid', 'gplay'])) {
throw new GradleException('app.edition must be direct, fdroid or gplay')
}
def googlePlay = appEdition == 'gplay'
def requestedMinSdk = Integer.parseInt((project.findProperty('app.minSdk') ?: '21').toString())
def verificationOutput = project.findProperty('app.outputDir')
if (verificationOutput != null) { buildDir = file(verificationOutput) }
@@ -32,7 +43,7 @@ android {
defaultConfig {
applicationId project.findProperty('app.id') ?: (standaloneShovey ? 'xyz.waozi.shovey' : 'xyz.waozi.arcade')
minSdk Integer.parseInt((project.findProperty('app.minSdk') ?: '21').toString())
minSdk googlePlay ? Math.max(requestedMinSdk, 23) : requestedMinSdk
targetSdk 36
versionCode Integer.parseInt((project.findProperty('app.versionCode') ?: appRelease.sequence).toString())
versionName project.findProperty('app.versionName') ?: appRelease.version
@@ -48,7 +59,7 @@ android {
'-DRAYLIB_DIR=' + raylibDir,
'-DAPP_CODEGEN=' + appCodegen,
'-DSHOVEY_STANDALONE=' + (standaloneShovey ? 'ON' : 'OFF'),
'-DGOOGLE_PLAY=' + (project.findProperty('app.googlePlay') == 'true' ? 'ON' : 'OFF')
'-DAPP_EDITION=' + appEdition
}
}
}
@@ -74,6 +85,11 @@ android {
sourceSets.release.manifest.srcFile 'src/zx/AndroidManifest.xml'
}
if (googlePlay) {
// Kryon's Play Billing class, from the Kryon checkout this build uses.
sourceSets.main.java.srcDir "${kryonDir}/templates/droid/droid/app/src/gplay/java"
}
buildTypes {
release {
minifyEnabled false
@@ -81,6 +97,15 @@ android {
}
}
dependencies {
if (googlePlay) {
implementation 'com.android.billingclient:billing:9.1.0'
// Billing's AndroidX libraries mix Kotlin 1.6 and 1.8 standard
// libraries; one Kotlin version keeps their classes from colliding.
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.22')
}
}
// The shared profile is a host asset, never a child of a game collection.
tasks.register('prepareEntity', Exec) {
workingDir file('../..')
+4 -1
View File
@@ -26,8 +26,11 @@ set(APP_ZIRAN_DEFINES --define ANDROID_BUILD)
if(SHOVEY_STANDALONE)
list(APPEND APP_ZIRAN_DEFINES --define SHOVEY_STANDALONE)
endif()
if(GOOGLE_PLAY)
# The app's edition (build.gradle app.edition): Google Play or F-Droid.
if(APP_EDITION STREQUAL "gplay")
list(APPEND APP_ZIRAN_DEFINES --define GOOGLE_PLAY)
elseif(APP_EDITION STREQUAL "fdroid")
list(APPEND APP_ZIRAN_DEFINES --define FDROID)
endif()
if(NOT DEFINED APP_CODEGEN)
set(APP_CODEGEN c99)
+5 -2
View File
@@ -17,7 +17,8 @@ def package(name):
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--release', action='store_true', help='Build an unsigned release APK for the release signer')
parser.add_argument('--bundle', action='store_true', help='Build an unsigned release Android App Bundle for Google Play')
parser.add_argument('--bundle', action='store_true',
help="Build the Google Play edition's unsigned release Android App Bundle")
parser.add_argument('--application-id', help='Use an isolated package for device tests')
parser.add_argument('--abis', default='arm64-v8a,armeabi-v7a', help='Native ABIs to build')
parser.add_argument('--build-dir', type=Path, help='Separate Gradle and CMake output for verification')
@@ -49,12 +50,14 @@ def main():
LIBOQS_DIR=str(package('liboqs')), MONOCYPHER_DIR=str(package('monocypher')))
command = ['sh', str(ROOT / 'droid/gradlew'), '-p', str(ROOT / 'droid'), '--no-daemon', '--max-workers=2',
'-Papp.product=shovey', '-Papp.abis=' + args.abis,
'-Papp.googlePlay=' + ('true' if args.bundle else 'false'),
'-Pkryon.dir=' + str(package('kryon')), '-Pziran.dir=' + str(package('ziran')),
'-Praylib.dir=' + str(package('raylib') / 'src'),
'-Papp.versionName=' + metadata['version'], '-Papp.versionCode=' + str(release['sequence']),
'-Pandroid.aapt2FromMavenOverride=' + str(sdk / 'build-tools/36.0.0/aapt2'),
'bundleRelease' if args.bundle else 'assembleRelease' if args.release else 'assembleDebug']
# Kryon's Google Play edition adds Play Billing, so Dew is bought through Play.
if args.bundle:
command[-1:-1] = ['-Papp.edition=gplay', '-Pandroid.useAndroidX=true']
if args.application_id:
command.insert(-1, '-Papp.id=' + args.application_id)
if args.build_dir:
+22
View File
@@ -40,6 +40,27 @@ def compress(path):
packed.write(path.read_bytes())
def version_assets(output, receipt):
"""Keep the runtime, its data and the verified collection on one cache key."""
page = output / 'index.html'
html = page.read_text()
if '__ARCADE_ASSET_REVISION__' not in html:
return
digest = hashlib.sha256()
for name in ('runtime.js', 'runtime.wasm', 'runtime.data', 'arcade.json', 'apps.zx'):
path = output / name
if path.is_file():
digest.update(name.encode() + b'\0')
digest.update(path.read_bytes())
revision = digest.hexdigest()
page.write_text(html.replace('__ARCADE_ASSET_REVISION__', revision))
source = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=ROOT, text=True).strip()
(output / 'build.json').write_text(json.dumps({
'source_revision': source, 'version': receipt['version'],
'assets_sha256': revision,
}, indent=2) + '\n')
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--bundle', type=Path, default=ROOT / 'build/node-apps/arcade.zx')
@@ -93,6 +114,7 @@ def main():
compress(output / 'apps.zx')
else:
print('No matching Apps controller beside the collection; it must pack its own')
version_assets(output, receipt)
print(f'{"Shovey" if args.shovey else "Arcade"} {args.version} for the browser in {output}')
+22 -10
View File
@@ -11,8 +11,8 @@
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="manifest" href="manifest.webmanifest">
<!-- The runtime downloads while the page fetches the collection's files. -->
<link rel="preload" href="runtime.js" as="script">
<link rel="preload" href="runtime.wasm" as="fetch" type="application/wasm" crossorigin>
<link rel="preload" href="runtime.js?v=__ARCADE_ASSET_REVISION__" as="script">
<link rel="preload" href="runtime.wasm?v=__ARCADE_ASSET_REVISION__" as="fetch" type="application/wasm" crossorigin>
<meta property="og:type" content="website">
<meta property="og:url" content="https://arcade.waozi.xyz/">
<meta property="og:title" content="Arcade">
@@ -30,6 +30,8 @@
#loading .failed { display: none; color: #ffb4a8; text-align: center; padding: 0 24px; }
#loading.error .failed { display: block; }
#loading.error .track { display: none; }
#loading.error { opacity: 1; pointer-events: auto; }
#loading button { border: 0; border-radius: 12px; padding: 14px 24px; background: #ffd166; color: #111223; font: inherit; cursor: pointer; }
</style>
</head>
<body>
@@ -38,20 +40,30 @@
<!-- MingCute game_2 gamepad, Apache-2.0 -->
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 9v3M13.5 10.5h3M7 5c1 0 3 1 5 1s4-1 5-1c3 0 7 14 3 14-3 0-4.5-4-8-4s-5 4-8 4C0 19 4 5 7 5Zm3 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"/></svg>
<div class="track"><div class="bar"></div></div>
<p class="failed">Arcade could not start. Reload the page to try again.</p>
<p class="failed">Arcade stopped while opening an app. Your saved games are kept.</p>
<button class="failed" id="retry" type="button">Return to library</button>
</div>
<script>
(function () {
var loading = document.getElementById('loading');
var bar = loading.querySelector('.bar');
function failed() { loading.classList.add('error'); }
// Arcade's Profile reports ready once the library is about to draw.
var assetRevision = '__ARCADE_ASSET_REVISION__';
function assetUrl(name) {
var url = new URL(name, document.baseURI);
url.searchParams.set('v', assetRevision);
return url.href;
}
function failed() { loading.classList.remove('done'); loading.classList.add('error'); }
document.getElementById('retry').addEventListener('click', function () { location.reload(); });
// Keep watching after startup: a later game failure also needs recovery.
function watch() {
if (window.Module && Module.profileReady) { loading.classList.add('done'); return; }
if (window.Module && Module.arcadeFailed) { failed(); return; }
if (window.Module && Module.profileReady) loading.classList.add('done');
requestAnimationFrame(watch);
}
window.Module = {
canvas: document.getElementById('canvas'),
locateFile: assetUrl,
setStatus: function (text) {
var match = /\((\d+(?:\.\d+)?)\/(\d+)\)/.exec(text || '');
if (match) bar.style.width = Math.min(100, 100 * match[1] / match[2]) + '%';
@@ -63,13 +75,13 @@
// does not compress binary files. Browsers without DecompressionStream,
// or a missing .gz, take the plain file; null when neither exists.
function plain(name) {
return fetch(name).then(function (response) {
return fetch(assetUrl(name)).then(function (response) {
return response.ok ? response.arrayBuffer() : null;
});
}
function bundle(name) {
if (typeof DecompressionStream !== 'function') return plain(name);
return fetch(name + '.gz').then(function (response) {
return fetch(assetUrl(name + '.gz')).then(function (response) {
if (!response.ok) throw new Error(response.status);
return response.arrayBuffer();
}).then(function (packed) {
@@ -83,7 +95,7 @@
// The build receipt names the collection's digest and its trusted Apps
// library; Arcade's own copy of that library goes in beside it.
Promise.all([
fetch('arcade.json', { cache: 'no-cache' }).then(function (response) {
fetch(assetUrl('arcade.json'), { cache: 'no-cache' }).then(function (response) {
if (!response.ok) throw new Error(response.status);
return response.text();
}),
@@ -100,7 +112,7 @@
}
function start() {
var script = document.createElement('script');
script.src = 'runtime.js';
script.src = assetUrl('runtime.js');
script.onerror = failed;
document.body.appendChild(script);
watch();
-3
View File
@@ -43,9 +43,6 @@ EntityShoveyTokens :: () {
EntityOpen :: (bytes: string, data: string, shovey: bool = false) -> bool {
entity_shovey = shovey
#if #defined(GOOGLE_PLAY) {
EntityHostAllowFunding(false)
}
if shovey { EntityShoveyTokens() }
root := Join(data, "entity")
defer { EntityFree(root) }
+8 -1
View File
@@ -89,12 +89,19 @@ main :: () -> s32 {
session := SessionOpen()
if !SessionValid(session) { unused CollectionClose(); return 1 }
defer { SessionClose(session) }
WebSet(WebGetObject(WebGlobal, WebName("Module")), WebName("profileReady"), WebBool(true))
saved := PageNow()
ok := true
while ok && PollCanvas() {
scope := WebScope()
ok = ArcadeFrame(session)
// main returning does not notify Emscripten's onExit unless its
// runtime exits too. Tell the page explicitly, so a failed game can
// never leave an apparently live library with no input loop.
if !ok {
WebSet(WebGetObject(WebGlobal, WebName("Module")), WebName("arcadeFailed"), WebBool(true))
} else {
WebSet(WebGetObject(WebGlobal, WebName("Module")), WebName("profileReady"), WebBool(true))
}
// Saves reach the browser's storage about once a second.
if PageNow() - saved >= 1000.0 {
unused BundleStorageSync(false)
+179 -5
View File
@@ -1,5 +1,6 @@
// Open Arcade's browser edition in a private headless browser and require
// its library to draw without a failed frame. Usage: node tests/web_site_test.mjs SITE_DIR
// install, play, reopen and recover from a failed saved-record read.
// Usage: node tests/web_site_test.mjs SITE_DIR
import { spawn } from 'node:child_process';
import { createServer } from 'node:http';
import { access, mkdtemp, readFile, rm } from 'node:fs/promises';
@@ -8,13 +9,32 @@ import { extname, join, normalize } from 'node:path';
import { setTimeout as delay } from 'node:timers/promises';
const site = process.argv[2];
const game = process.env.ARCADE_TEST_GAME || 'Apfelwurm';
if (!site) throw new Error('Usage: node tests/web_site_test.mjs SITE_DIR');
const types = { '.html': 'text/html', '.js': 'text/javascript', '.wasm': 'application/wasm', '.json': 'application/json',
'.svg': 'image/svg+xml', '.png': 'image/png', '.jpg': 'image/jpeg', '.webmanifest': 'application/manifest+json' };
const server = createServer(async (request, response) => {
const path = normalize(decodeURIComponent(new URL(request.url, 'http://x').pathname)).replace(/^\/+/, '') || 'index.html';
const url = new URL(request.url, 'http://x');
const path = normalize(decodeURIComponent(url.pathname)).replace(/^\/+/, '') || 'index.html';
try {
const body = await readFile(join(site, path));
// Model the previous runtime still cached under its unversioned URL.
// A new deployment must request its coherent runtime revision instead.
if (path === 'runtime.js' && !url.searchParams.has('v')) {
response.writeHead(200, { 'Content-Type': 'text/javascript', 'Cache-Control': 'public, max-age=14400' });
response.end('console.error("Stale cached Arcade runtime"); Module.onAbort();');
return;
}
let body = await readFile(join(site, path));
if (path === 'index.html') {
// Enable only the existing widget-tree reader in this disposable page.
// Input still travels through the browser's real pointer and key events.
body = Buffer.from(body.toString().replace('document.body.appendChild(script);', `
Module.preRun = (Module.preRun || []).concat(function () {
FS.mkdir('/arcade-test');
ENV.KRYON_TEST_DRIVER = '/arcade-test';
});
document.body.appendChild(script);`));
}
response.writeHead(200, { 'Content-Type': types[extname(path)] || 'application/octet-stream' });
response.end(body);
} catch { response.writeHead(404); response.end(); }
@@ -23,15 +43,19 @@ await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
const profile = await mkdtemp(join(process.env.TMPDIR || tmpdir(), 'arcade-web-'));
const env = { ...process.env };
for (const key of ['DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY', 'DBUS_SESSION_BUS_ADDRESS']) delete env[key];
env.YUE_DESKTOP_RECOVERY = '0';
const browser = spawn(process.env.CHROMIUM || 'chromium', ['--headless=new', '--no-sandbox', '--use-gl=swiftshader',
'--enable-unsafe-swiftshader', '--no-first-run', '--remote-debugging-port=0', `--user-data-dir=${profile}`, 'about:blank'],
{ env, detached: true, stdio: 'ignore' });
let socket, sequence = 0;
const pending = new Map(), console_lines = [];
const command = (method, params = {}) => new Promise((resolve, reject) => {
const id = ++sequence; pending.set(id, { resolve, reject }); socket.send(JSON.stringify({ id, method, params }));
const id = ++sequence;
const timeout = setTimeout(() => { pending.delete(id); reject(new Error(method + ' timed out')); }, 15000);
pending.set(id, { resolve, reject, timeout }); socket.send(JSON.stringify({ id, method, params }));
});
let failure = '';
let expectedDiagnostics = 0;
try {
const started = Date.now();
while (true) {
@@ -47,9 +71,12 @@ try {
const message = JSON.parse(event.data);
if (message.method === 'Runtime.consoleAPICalled')
console_lines.push(message.params.args.map(arg => arg.value ?? arg.description ?? '').join(' '));
if (message.method === 'Runtime.exceptionThrown')
console_lines.push(message.params.exceptionDetails.exception?.description || message.params.exceptionDetails.text);
const request = pending.get(message.id);
if (!request) return;
pending.delete(message.id);
clearTimeout(request.timeout);
message.error ? request.reject(new Error(JSON.stringify(message.error))) : request.resolve(message.result);
};
await command('Runtime.enable'); await command('Page.enable');
@@ -69,11 +96,158 @@ try {
if (!ready) await delay(250);
}
if (!ready && !failure) failure = 'the library never became ready';
if (ready) {
const resources = await command('Runtime.evaluate', {
expression: 'performance.getEntriesByType("resource").map(entry=>entry.name)', returnByValue: true });
const runtime = resources.result.value.map(name=>new URL(name)).filter(url=>
/\/(runtime\.(js|wasm|data)(\.gz)?|arcade\.json|apps\.zx(\.gz)?)$/.test(url.pathname));
const revisions = new Set(runtime.map(url=>url.searchParams.get('v')));
if (!runtime.some(url=>url.pathname.endsWith('/runtime.js')) ||
!runtime.some(url=>url.pathname.endsWith('/runtime.wasm')) ||
revisions.size !== 1 || !/^[a-f0-9]{64}$/.test([...revisions][0]))
failure = 'the runtime and collection files did not use one coherent cache revision';
}
// Let the library draw several frames before judging them.
await delay(3000);
const failed = console_lines.find(line => /frame failed|portable execution failed/.test(line));
if (ready && !failure) {
const evaluate = async expression => {
const value = await command('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true });
if (value.exceptionDetails) throw new Error(value.exceptionDetails.exception?.description || value.exceptionDetails.text);
return value.result?.value;
};
let serial = 0;
const tree = async () => {
await evaluate(`FS.writeFile('/arcade-test/command', ${JSON.stringify(++serial + '\ttree\n')})`);
const end = Date.now() + 10000;
while (Date.now() < end) {
const failed = console_lines.slice(expectedDiagnostics).find(line => /frame failed|portable execution failed|RuntimeError/.test(line));
if (failed) throw new Error(failed);
const reply = await evaluate(`FS.analyzePath('/arcade-test/reply').exists ? FS.readFile('/arcade-test/reply', {encoding:'utf8'}) : ''`);
if (reply) {
await evaluate(`FS.unlink('/arcade-test/reply')`);
return JSON.parse(reply).nodes;
}
await delay(100);
}
throw new Error('Arcade stopped drawing frames');
};
const click = async node => {
const position = { x: node.visible_x + node.visible_width / 2, y: node.visible_y + node.visible_height / 2 };
await command('Input.dispatchMouseEvent', { type: 'mouseMoved', ...position });
await command('Input.dispatchMouseEvent', { type: 'mousePressed', ...position, button: 'left', buttons: 1, clickCount: 1 });
await delay(80);
await command('Input.dispatchMouseEvent', { type: 'mouseReleased', ...position, button: 'left', buttons: 0, clickCount: 1 });
await delay(250);
};
const button = (nodes, label) => nodes.find(node => node.kind === 'button' && node.label === label && node.visible);
const waitButton = async label => {
let nodes;
for (const end = Date.now() + 60000; Date.now() < end;) {
nodes = await tree();
const found = button(nodes, label);
if (found) return found;
await delay(150);
}
throw new Error('Game did not show ' + label + ': ' + nodes.filter(node => node.kind === 'button').map(node => node.label).join(', '));
};
const pageReady = async () => {
for (const end = Date.now() + 60000; Date.now() < end;) {
if (await evaluate('!!(window.Module && Module.profileReady)')) return;
await delay(150);
}
throw new Error('The library did not reopen');
};
const cover = button(await tree(), game);
if (!cover) throw new Error('Game cover missing');
await click(cover);
const download = (await tree()).findLast(node => node.kind === 'button' && node.label === 'Download');
if (!download) throw new Error('The cover did not offer its download');
await click(download);
await waitButton(game === 'Apfelwurm' ? 'Play' : 'Back');
const play = button(await tree(), 'Play');
if (play) await click(play);
const swipe = button(await tree(), 'Swipe');
if (swipe) await click(swipe);
if (game === 'Apfelwurm') await waitButton('Pause');
// Flush the actual control record before a cold restart.
await evaluate(`new Promise((resolve,reject) => FS.syncfs(false,error => error ? reject(error) : resolve(true)))`);
await command('Page.reload');
await pageReady();
const reloaded = await tree();
const installed = button(reloaded, game);
if (!installed) throw new Error('Installed cover missing after reload');
await click(installed);
await waitButton(game === 'Apfelwurm' ? 'Play' : 'Back');
console.log(game + ' downloaded, opened its game and reopened from its installed cover');
if (game === 'Apfelwurm') {
await command('Page.reload');
await pageReady();
const installed = button(await tree(), game);
const saved = await evaluate(`(() => {
const root='/kryon-apps/arcade/games';
for (const name of FS.readdir(root)) {
const path=root+'/'+name+'/records/controls.dat';
if (FS.analyzePath(path).exists) return {path,text:FS.readFile(path,{encoding:'utf8'})};
}
return null;
})()`);
if (!saved) throw new Error('Playing did not retain the control choice');
await evaluate(`(() => {
const original=FS.open;
FS.open=function(path,...args) {
if (String(path).includes('/games/') && String(path).includes('/records/') && !String(path).endsWith('/.lock')) {
FS.open=original;
throw new FS.ErrnoError(29);
}
return original.call(this,path,...args);
};
})()`);
await click(installed);
// Depending on the game version it first reads records on its title
// or on Play. Either path must expose a usable recovery control.
if (!await evaluate('!!Module.arcadeFailed')) {
try {
const play=button(await tree(),'Play');
if (play) await click(play);
} catch (error) {
// The first game frame can fail between sampling the flag and
// asking for its tree. Require the runtime's failure signal.
let failed=false;
for (const end=Date.now()+1000; Date.now()<end;) {
failed=await evaluate('!!Module.arcadeFailed');
if (failed) break;
await delay(50);
}
if (!failed) throw error;
}
}
let recovered=false;
for (const end=Date.now()+15000; Date.now()<end;) {
recovered=await evaluate(`!!Module.arcadeFailed && document.getElementById('loading').classList.contains('error') && getComputedStyle(document.getElementById('loading')).opacity==='1'`);
if (recovered) break;
await delay(100);
}
if (!recovered) throw new Error('A failed game left the library frozen without recovery');
if (!console_lines.some(line=>/portable execution failed in ReadLevel/.test(line)))
throw new Error('The fixture did not reproduce the reported saved-record failure');
expectedDiagnostics=console_lines.length;
const retry=await evaluate(`(() => {const r=document.getElementById('retry').getBoundingClientRect();return {visible_x:r.x,visible_y:r.y,visible_width:r.width,visible_height:r.height};})()`);
await click(retry);
await pageReady();
if (await evaluate(`FS.readFile(${JSON.stringify(saved.path)},{encoding:'utf8'})`) !== saved.text)
throw new Error('Recovering from a failed game changed its saved record');
await click(button(await tree(),game));
await waitButton('Play');
console.log('The reported ReadLevel failure showed recovery; returning reopened the installed game and retained its saved record');
}
}
const failed = console_lines.slice(expectedDiagnostics).find(line => /frame failed|portable execution failed/.test(line));
if (!failure && failed) failure = failed;
} catch (error) {
console.error(console_lines.slice(-20).join('\n'));
throw error;
} finally {
socket?.close();
try { process.kill(-browser.pid, 'SIGTERM'); } catch {}
server.close();
await rm(profile, { recursive: true, force: true }).catch(() => {});
+37 -37
View File
@@ -18,17 +18,9 @@
"ref": "master",
"url": "https://github.com/ziranlang/qrcode.git"
},
{
"commit": "818916db6cbd42034bf869899feb75be8829d42e",
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p4ce8ea37919db614"},
"id": "p15331309f570593d",
"name": "Apps",
"ref": "master",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "d74348c2e288ac55740461f7e106cda365b4db4a",
"dependencies": {"apps": "p15331309f570593d", "crypto": "pc23fbf455e97614d", "curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p9972fcdd2d5ba999", "entity": "p6feeecb5bfff3686", "game2d": "pf2f54c7603f6e861", "kryon": "p4ce8ea37919db614", "kss": "p1b13dda539ed2a39", "liboqs": "pecdb097af6ab16f7", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p9079dde0fcc11248", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "p1d80baafaa5fa18a"},
"dependencies": {"apps": "pfb2b063c26a84c8b", "crypto": "pc23fbf455e97614d", "curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p9972fcdd2d5ba999", "entity": "p523d96ecdb68b57a", "game2d": "pf2f54c7603f6e861", "kryon": "p34523fe8a5f9e94e", "kss": "p1b13dda539ed2a39", "liboqs": "pecdb097af6ab16f7", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p9079dde0fcc11248", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "p1d80baafaa5fa18a"},
"id": "p183b01bccc6424e7",
"name": "Inbe",
"ref": "master",
@@ -36,20 +28,12 @@
},
{
"commit": "1cb9df183089a77c8a16448a556186f30b261a98",
"dependencies": {"kryon": "p4ce8ea37919db614"},
"dependencies": {"kryon": "p34523fe8a5f9e94e"},
"id": "p1b13dda539ed2a39",
"name": "Kss",
"ref": "master",
"url": "https://github.com/kryonlabs/kss.git"
},
{
"commit": "7d37be6e1f0643c01b35545e42e48c633f19a90d",
"dependencies": {"daochi_client": "p9972fcdd2d5ba999", "kryon": "p4ce8ea37919db614", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
"id": "p6feeecb5bfff3686",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "19b299005fbe2d895f4ad525cfdae62a2220c3ea",
"dependencies": {},
@@ -69,13 +53,29 @@
"url": "https://github.com/sqlite/sqlite.git"
},
{
"commit": "e09f38160d1c0ce14eea886720f46486e4dab65f",
"commit": "47c065576da82689a3b920c5a1576e8b4c0439a3",
"dependencies": {"apps": "pfb2b063c26a84c8b", "entity": "p523d96ecdb68b57a", "kryon": "p34523fe8a5f9e94e", "mingcute": "pe1027b9d16704793"},
"id": "p1e682fc4b769dbed",
"name": "Apfelwurm",
"ref": "47c065576da82689a3b920c5a1576e8b4c0439a3",
"url": "https://github.com/waozixyz/wurm.git"
},
{
"commit": "30e9145274f11f893117e28838f5d30a9122a009",
"dependencies": {"raylib": "p5a77c9c35110e925"},
"id": "p4ce8ea37919db614",
"id": "p34523fe8a5f9e94e",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "2062597cecba5ce1bf54a20e6d5a2bdda148a06b",
"dependencies": {"daochi_client": "p9972fcdd2d5ba999", "kryon": "p34523fe8a5f9e94e", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
"id": "p523d96ecdb68b57a",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
@@ -121,12 +121,20 @@
},
{
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
"dependencies": {"kryon": "p4ce8ea37919db614"},
"dependencies": {"kryon": "p34523fe8a5f9e94e"},
"id": "pab5377a2950368a2",
"name": "plot",
"ref": "master",
"url": "https://github.com/kryonlabs/plot.git"
},
{
"commit": "742d45c1ee04c5ef94d8c2b75605a2081ec94e03",
"dependencies": {"apps": "pfb2b063c26a84c8b", "entity": "p523d96ecdb68b57a", "kryon": "p34523fe8a5f9e94e", "mingcute": "pe1027b9d16704793"},
"id": "pb78ec98f9af772eb",
"name": "Shovey",
"ref": "f6da6517c0886ead17d7fc8dd9471a07299f32b4",
"url": "https://github.com/waozixyz/shovey.git"
},
{
"commit": "944826f70779a6b6cd53f6b06a75b36f4d8a2558",
"dependencies": {},
@@ -143,14 +151,6 @@
"ref": "master",
"url": "https://github.com/kryonlabs/mingcute.git"
},
{
"commit": "3cead1f21720258c0acffa84c8625579d68c3a9e",
"dependencies": {"apps": "p15331309f570593d", "entity": "p6feeecb5bfff3686", "kryon": "p4ce8ea37919db614", "mingcute": "pe1027b9d16704793"},
"id": "peafb3c123b12e97a",
"name": "Apfelwurm",
"ref": "3cead1f21720258c0acffa84c8625579d68c3a9e",
"url": "https://github.com/waozixyz/wurm.git"
},
{
"commit": "4778aa5044bf119c30df54219fa89357080af27f",
"dependencies": {},
@@ -162,23 +162,23 @@
},
{
"commit": "cee04692f3461dcb098833472f071c434980debb",
"dependencies": {"kryon": "p4ce8ea37919db614"},
"dependencies": {"kryon": "p34523fe8a5f9e94e"},
"id": "pf2f54c7603f6e861",
"name": "Game2D",
"ref": "master",
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "82bf0955674c8afc6f6b85df86e59c46cfbe43ee",
"dependencies": {"apps": "p15331309f570593d", "entity": "p6feeecb5bfff3686", "kryon": "p4ce8ea37919db614", "mingcute": "pe1027b9d16704793"},
"id": "pf5159eeee3cf1d66",
"name": "Shovey",
"ref": "82bf0955674c8afc6f6b85df86e59c46cfbe43ee",
"url": "https://github.com/waozixyz/shovey.git"
"commit": "dc6b743b5299318fa74bd32854b0eff0046d24a2",
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p34523fe8a5f9e94e"},
"id": "pfb2b063c26a84c8b",
"name": "Apps",
"ref": "master",
"url": "https://github.com/waozixyz/apps.git"
}
],
"root": {
"dependencies": {"apps": "p15331309f570593d", "entity": "p6feeecb5bfff3686", "inbe": "p183b01bccc6424e7", "kryon": "p4ce8ea37919db614", "mingcute": "pe1027b9d16704793", "shovey": "pf5159eeee3cf1d66", "wurm": "peafb3c123b12e97a"},
"dependencies": {"apps": "pfb2b063c26a84c8b", "entity": "p523d96ecdb68b57a", "inbe": "p183b01bccc6424e7", "kryon": "p34523fe8a5f9e94e", "mingcute": "pe1027b9d16704793", "shovey": "pb78ec98f9af772eb", "wurm": "p1e682fc4b769dbed"},
"name": "Arcade"
},
"toolchain": {
+2 -2
View File
@@ -39,7 +39,7 @@ ref = "master"
# Shovey's editions and editor are available as separate downloads.
[dependencies.shovey]
git = "https://github.com/waozixyz/shovey.git"
ref = "82bf0955674c8afc6f6b85df86e59c46cfbe43ee"
ref = "f6da6517c0886ead17d7fc8dd9471a07299f32b4"
# Compatibility tooling runs Inner Breeze's host checks; releases check its publisher pins.
[dependencies.inbe]
@@ -56,4 +56,4 @@ ref = "master"
[dependencies.wurm]
git = "https://github.com/waozixyz/wurm.git"
ref = "3cead1f21720258c0acffa84c8625579d68c3a9e"
ref = "47c065576da82689a3b920c5a1576e8b4c0439a3"