nx_games_url_check.nx source
↩ module page · 62 lines · 4538 B
1// nx_games_url_check.nx -- sovereign live check of the GAMES URLs via our own TLS client. Fetches each, stores
2// the HTTP status, and prints a CLEAN summary at the END (so it isn't buried under the client's per-request
3// logs). This is how we KNOW which game URLs actually serve. Self-contained; run via the sovereign runner.
4// license_tier: ORIGINAL expect_exit: 0
5import "nx_syscalls.nx"
6import "nx_x509_trust_store.nx"
7import "nx_trust_store_load_from_certdata.nx"
8import "nx_https_fetch_follow.nx"
9const K_MAGIC_8388608: i64 = 8388608
10const K_MAGIC_2026: i64 = 2026
11const K_MAGIC_4194304: i64 = 4194304
12
13func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
14func gn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
15
16func chk(store: *TrustStore, url: *u8, st_out: *i64, by_out: *i64) -> i64 {
17 let cap: i64 = K_MAGIC_8388608 // the EYE must out-read the pages it audits (a 2.3MB /swgpu read exactly 2MiB = this cap, caught K_MAGIC_2026-07-07)
18 let out: *u8 = sys_mmap(cap)
19 let status: *i64 = sys_mmap(8) as *i64
20 let n: i64 = nx_https_fetch_follow(url, store, out, cap, 6, status)
21 st_out[0] = status[0]; by_out[0] = n
22 return 0
23}
24
25func main() -> i64 {
26 let r: i64 = nx_trust_store_load_from_certdata("data/mozilla_certdata.txt" as *u8, 512, K_MAGIC_4194304)
27 if r <= 0 { gw("CHECK: certdata load failed\n"); return 1 }
28 let store: *TrustStore = r as *TrustStore
29 let sb: *i64 = sys_mmap(128) as *i64
30 let bb: *i64 = sys_mmap(128) as *i64
31 chk(store, "https://nishifamily.com/hub" as *u8, (sb as i64 + 0) as *i64, (bb as i64 + 0) as *i64)
32 chk(store, "https://nishifamily.com/gamelab" as *u8, (sb as i64 + 8) as *i64, (bb as i64 + 8) as *i64)
33 chk(store, "https://nishifamily.com/arpg.html" as *u8, (sb as i64 + 16) as *i64, (bb as i64 + 16) as *i64)
34 chk(store, "https://nishifamily.com/gallery" as *u8, (sb as i64 + 24) as *i64, (bb as i64 + 24) as *i64)
35 chk(store, "https://nishifamily.com/games" as *u8, (sb as i64 + 32) as *i64, (bb as i64 + 32) as *i64)
36 chk(store, "https://nishifamily.com/mineworld" as *u8, (sb as i64 + 40) as *i64, (bb as i64 + 40) as *i64)
37 chk(store, "https://nishifamily.com/hub/games" as *u8, (sb as i64 + 48) as *i64, (bb as i64 + 48) as *i64)
38 chk(store, "https://nishifamily.com/mineworld-mp" as *u8, (sb as i64 + 56) as *i64, (bb as i64 + 56) as *i64)
39 chk(store, "https://nishifamily.com/physlab" as *u8, (sb as i64 + 64) as *i64, (bb as i64 + 64) as *i64)
40 chk(store, "https://nishifamily.com/charlab" as *u8, (sb as i64 + 72) as *i64, (bb as i64 + 72) as *i64)
41 chk(store, "https://nishifamily.com/gpulab" as *u8, (sb as i64 + 80) as *i64, (bb as i64 + 80) as *i64)
42 chk(store, "https://nishifamily.com/swgpu" as *u8, (sb as i64 + 88) as *i64, (bb as i64 + 88) as *i64)
43 chk(store, "https://nishifamily.com/gsplat" as *u8, (sb as i64 + 96) as *i64, (bb as i64 + 96) as *i64)
44 chk(store, "https://nishifamily.com/world" as *u8, (sb as i64 + 104) as *i64, (bb as i64 + 104) as *i64)
45 gw("\n===== GAMES URL CHECK (live, our TLS client) =====\n")
46 gw(" /hub HTTP "); gn(sb[0]); gw(" bytes "); gn(bb[0]); gw("\n")
47 gw(" /gamelab HTTP "); gn(sb[1]); gw(" bytes "); gn(bb[1]); gw("\n")
48 gw(" /arpg.html HTTP "); gn(sb[2]); gw(" bytes "); gn(bb[2]); gw("\n")
49 gw(" /gallery HTTP "); gn(sb[3]); gw(" bytes "); gn(bb[3]); gw("\n")
50 gw(" /games HTTP "); gn(sb[4]); gw(" bytes "); gn(bb[4]); gw("\n")
51 gw(" /mineworld HTTP "); gn(sb[5]); gw(" bytes "); gn(bb[5]); gw("\n")
52 gw(" /hub/games HTTP "); gn(sb[6]); gw(" bytes "); gn(bb[6]); gw("\n")
53 gw(" /mineworld-mp HTTP "); gn(sb[7]); gw(" bytes "); gn(bb[7]); gw("\n")
54 gw(" /physlab HTTP "); gn(sb[8]); gw(" bytes "); gn(bb[8]); gw("\n")
55 gw(" /charlab HTTP "); gn(sb[9]); gw(" bytes "); gn(bb[9]); gw("\n")
56 gw(" /gpulab HTTP "); gn(sb[10]); gw(" bytes "); gn(bb[10]); gw("\n")
57 gw(" /swgpu HTTP "); gn(sb[11]); gw(" bytes "); gn(bb[11]); gw("\n")
58 gw(" /gsplat HTTP "); gn(sb[12]); gw(" bytes "); gn(bb[12]); gw("\n")
59 gw(" /world HTTP "); gn(sb[13]); gw(" bytes "); gn(bb[13]); gw("\n")
60 gw("==================================================\n")
61 return 0
62}