Daily snapshot gains a Games block: members handed into each game (counted at hand-off, per hour) and payouts read from each game wallet on Polygon in the last 24 h, launches of the day called out

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-08 09:13:44 -05:00
parent d07a32a837
commit af5a53b833
3 changed files with 275 additions and 203 deletions
+11 -9
View File
@@ -40,6 +40,7 @@ const videosweep = require('./videosweep');
const sbcheck = require('./sbcheck');
const reach = require('./reach');
const lssync = require('./lssync');
const gamestats = require('./gamestats');
const marks = require('./marks');
const feedgroup = require('./feedgroup'); // one proof-feed message per purchase: buyer, package, then the tier payouts // one-time claims shared across running instances (deploy overlap) // Google Safe Browsing screen on advertiser destinations
const updates = require('./updates');
@@ -506,7 +507,8 @@ async function boot() {
coach.init({ dataDir: DATA_DIR, chain, accounts, mailer, ads, tank, lb: () => leaderboard, siteConfig });
pipeline.init({ dataDir: DATA_DIR, accounts, coach, chain });
badge.init({ publicDir: PUBLIC_DIR });
snapshot.init({ dataDir: DATA_DIR, db, chain, siteConfig, publicDir: PUBLIC_DIR,
gamestats.init({ dataDir: DATA_DIR });
snapshot.init({ dataDir: DATA_DIR, db, chain, siteConfig, publicDir: PUBLIC_DIR, games: gamestats, launchesToday: () => GAMES().filter(g => (g.soon && g.soon.opens === todayCT()) || (g.season && g.season.start === todayCT())).map(g => g.name),
send: async (c, t, th) => { await telegramSend(c, t, th); return true; },
sendPhoto: (c, jpeg, cap, th) => telegramSendPhoto(c, jpeg, cap, th) });
fridaybank.init({ db });
@@ -2928,7 +2930,7 @@ const server = http.createServer(async (req, res) => {
return json(res, 200, await fridaybank.bankFor(email));
}
// -- PolHunter hand-off (2026-09-19): sign the member across; polhunter.com verifies with the shared secret
if (p === '/api/my/polhunter' && req.method === 'GET') {
if (p === '/api/my/polhunter' && req.method === 'GET') { gamestats.handoff('polhunter');
const s = await auth.fromRequest(req);
// not signed in: to sign-in, keeping a PolHunter share link's ?ref so the newcomer's sponsor holds (the viral-link rule on /my sets it)
if (!s || !s.email) { const ref = String(u.searchParams.get('ref') || '').trim().toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20); res.writeHead(302, { Location: '/my' + (ref ? '?ref=' + ref : '') }); return res.end(); }
@@ -2949,7 +2951,7 @@ const server = http.createServer(async (req, res) => {
res.writeHead(302, { Location: huntUrl + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': 'iap.return=; Path=/; SameSite=Lax; Max-Age=0' + (IS_PROD ? '; Secure' : '') }); return res.end(); // the loop is closed
}
// -- Drip Runner hand-off (2026-09-30): sign the member across, the game verifies with the shared secret
if (p === '/api/my/driprunner' && req.method === 'GET') {
if (p === '/api/my/driprunner' && req.method === 'GET') { gamestats.handoff('driprunner');
const s = await auth.fromRequest(req);
if (!s || !s.email) { res.writeHead(302, { Location: '/my' + refQ(u), 'Set-Cookie': 'iap.return=driprunner; Path=/; SameSite=Lax; Max-Age=1800' + (IS_PROD ? '; Secure' : ''), 'Cache-Control': 'no-store' }); return res.end(); } // sign in first, then straight back into the game
if (DR_SECRET().length < 32) return json(res, 503, { error: 'Drip Runner is not connected yet.' });
@@ -2986,7 +2988,7 @@ const server = http.createServer(async (req, res) => {
console.log('polywarriors weekly prize', k, acct.email, credits);
return json(res, 200, { ok: true, credits });
}
if (p === '/api/my/polywarriors' && req.method === 'GET') {
if (p === '/api/my/polywarriors' && req.method === 'GET') { gamestats.handoff('polywarriors');
const s = await auth.fromRequest(req);
if (!s || !s.email) { res.writeHead(302, { Location: '/my' + refQ(u), 'Set-Cookie': gkCookie('iap.return', 'polywarriors', 1800), 'Cache-Control': 'no-store' }); return res.end(); }
if (PW_SECRET().length < 32) return json(res, 503, { error: 'PolyWarriors is not connected yet.' });
@@ -2995,7 +2997,7 @@ const server = http.createServer(async (req, res) => {
res.writeHead(302, { Location: PW_URL() + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': gkCookie('iap.return', '', 0) }); return res.end();
}
// -- SpellWheel hand-off (2026-10-04): sign the member across; the game verifies with SW_SSO_SECRET
if (p === '/api/my/spellwheel' && req.method === 'GET') {
if (p === '/api/my/spellwheel' && req.method === 'GET') { gamestats.handoff('spellwheel');
const s = await auth.fromRequest(req);
if (!s || !s.email) { res.writeHead(302, { Location: '/my' + refQ(u), 'Set-Cookie': gkCookie('iap.return', 'spellwheel', 1800), 'Cache-Control': 'no-store' }); return res.end(); }
if (SW_SECRET().length < 32) return json(res, 503, { error: 'SpellWheel is not connected yet.' });
@@ -3004,7 +3006,7 @@ const server = http.createServer(async (req, res) => {
res.writeHead(302, { Location: SW_URL() + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': gkCookie('iap.return', '', 0) }); return res.end();
}
// -- ClutterHunt hand-off (2026-10-03): sign the member across; the game verifies with SEEK_SSO_SECRET
if (p === '/api/my/clutterhunt' && req.method === 'GET') {
if (p === '/api/my/clutterhunt' && req.method === 'GET') { gamestats.handoff('clutterhunt');
const s = await auth.fromRequest(req);
if (!s || !s.email) { res.writeHead(302, { Location: '/my' + refQ(u), 'Set-Cookie': gkCookie('iap.return', 'clutterhunt', 1800), 'Cache-Control': 'no-store' }); return res.end(); }
if (SEEK_SECRET().length < 32) return json(res, 503, { error: 'ClutterHunt is not connected yet.' });
@@ -3013,7 +3015,7 @@ const server = http.createServer(async (req, res) => {
res.writeHead(302, { Location: SEEK_URL() + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': gkCookie('iap.return', '', 0) }); return res.end();
}
// -- Gem Kingdom hand-off (2026-10-01): sign the member across; the game verifies with GK_SSO_SECRET
if (p === '/api/my/gemkingdom' && req.method === 'GET') {
if (p === '/api/my/gemkingdom' && req.method === 'GET') { gamestats.handoff('gemkingdom');
const s = await auth.fromRequest(req);
// a newcomer from a Gem Kingdom feed post carries the poster's ?ref through to /my, where the viral-link rule sets the sponsor
const gkRef = String(u.searchParams.get('ref') || '').trim().toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20);
@@ -3129,7 +3131,7 @@ const server = http.createServer(async (req, res) => {
if (ss === 'hidden') return json(res, 200, { show: false });
return json(res, 200, { show: true, preview: ss === 'preview', base: SD_URL(), image: SD_URL() + '/og-spookydoors.jpg', season: { start: SD_SEASON.start, end: SD_SEASON.end } });
}
if (p === '/api/my/spookydoors' && req.method === 'GET') {
if (p === '/api/my/spookydoors' && req.method === 'GET') { gamestats.handoff('spookydoors');
const s = await auth.fromRequest(req);
// a newcomer from a Spooky Doors post carries the poster's ?ref through to /my, where the viral-link rule sets the sponsor
const sdRef = String(u.searchParams.get('ref') || '').trim().toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20);
@@ -3141,7 +3143,7 @@ const server = http.createServer(async (req, res) => {
res.writeHead(302, { Location: SD_URL() + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': gkCookie('iap.return', '', 0) }); return res.end();
}
// -- Road Agent hand-off (2026-10-07): sign the member across; the game verifies with RA_SSO_SECRET
if (p === '/api/my/roadagent' && req.method === 'GET') {
if (p === '/api/my/roadagent' && req.method === 'GET') { gamestats.handoff('roadagent');
const s = await auth.fromRequest(req);
const raRef = String(u.searchParams.get('ref') || '').trim().toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20);
if (!s || !s.email) { res.writeHead(302, { Location: '/my' + (raRef ? '?ref=' + encodeURIComponent(raRef) : ''), 'Set-Cookie': gkCookie('iap.return', 'roadagent', 1800), 'Cache-Control': 'no-store' }); return res.end(); }