Network Tour (Marty 2026-11-17): mission rotation per hunter + free-tier tour stops
- lib/rotation.js: a round = every active house mission; the board offers only missions not found this round, never-visited first, then least recently found; mid-round additions join as not found, paused missions are skipped; the start gate refuses a mission found earlier this round. State per member in rotation.json (start, rounds); everyone starts at 0 so round 1 = their whole history. Paid missions keep their rules; daily limits, draws, pool and tiers unchanged. Setting rotationOn (default 1). - Board: "Network tour: X of Y sites this round" with a progress bar and the sites left; New to you tag. - Badge sweep renamed Full Network Tour (art unchanged), earned by the old rule or a closed round; celebrated on the board every round, round count on the card, Telegram posts it once. - Free tier: POL only for discovery (first find of a mission). A repeat find is a tour stop: counts as the day's hunt and for the tour, 0 POL, ad credits through a signed call to InstantAdPay (polgrant.credits -> POST /api/partner/credits, idempotent on ref tour:<row id>); settings tourStopCredits 10 / tourStopCreditsDailyMax 10; unconfirmed stops stay owed and retry every 2 min. Game Pass holders unchanged. Toured free members see the Game Pass line on the board. - Admin: Network Tour section (settings, rounds per hunter, credits sent/owed), GET /api/admin/rotation. - Board daily line now passes the tier (a Pass holder saw 3, not 5). - fridaybank: http for a local stub IAP (tests). Tests: test/rotation.js (27 checks), run.js waits for /health instead of a fixed 1.2 s. Guides: how-a-hunt-works, faq, free-account explain the tour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -21,7 +21,8 @@ const TTL = 3 * 60 * 1000;
|
||||
|
||||
function fetchJson(url) {
|
||||
return new Promise((resolve) => {
|
||||
const rq = https.get(url, { timeout: 8000 }, r => {
|
||||
// plain http only for a local stub InstantAdPay (tests)
|
||||
const rq = (String(url).startsWith('http:') ? require('http') : https).get(url, { timeout: 8000 }, r => {
|
||||
let raw = ''; r.setEncoding('utf8'); r.on('data', d => { raw += d; });
|
||||
r.on('end', () => { try { resolve(r.statusCode === 200 ? JSON.parse(raw) : null); } catch (e) { resolve(null); } });
|
||||
});
|
||||
|
||||
+10
-1
@@ -163,4 +163,13 @@ async function tournamentPaid(row, tx) {
|
||||
catch (e) { return { ok: false, error: String(e && e.message || e).slice(0, 120) }; }
|
||||
}
|
||||
|
||||
module.exports = { use, on, whoOf, grant, voidGrant, passOf, rememberPass, fetchPass, view, note, enqueue, queue, queued, dequeue, retry, startRetry, stopRetry, tournamentPending, tournamentPaid, PASS_URL, RETRY_MS, GIVE_UP_MS, ctDay, r4, _cfg: () => cfg };
|
||||
// ad credits for a player (PolHunter tour stops, 2026-11-17; other games may use it later): IAP grants earned-grade credits
|
||||
// with a credit-activity line, once per ref (a retry answers repeat: true). -> { ok, credits, repeat } or { ok: false, error }. Never throws.
|
||||
async function credits({ memberId, email, credits: n, ref, note }) {
|
||||
const body = { memberId: Number(memberId) || 0, email: String(email || '').trim().toLowerCase() || undefined, credits: Math.max(0, Math.round(Number(n) || 0)), ref: String(ref || ''), note: String(note || '').slice(0, 120) };
|
||||
if (!whoOf(body.memberId, body.email) || !body.ref || !body.credits) return { ok: false, error: 'bad request' };
|
||||
if (!ready()) return { ok: false, error: 'polgrant not configured' };
|
||||
try { const { status, json } = await post('/api/partner/credits', body); if (status === 200 && json && json.ok) return { ok: true, credits: Number(json.credits) || 0, repeat: !!json.repeat }; return { ok: false, error: 'http ' + status + (json && json.error ? ': ' + json.error : '') }; }
|
||||
catch (e) { return { ok: false, error: String(e && e.message || e).slice(0, 120) }; }
|
||||
}
|
||||
module.exports = { use, on, whoOf, grant, voidGrant, credits, passOf, rememberPass, fetchPass, view, note, enqueue, queue, queued, dequeue, retry, startRetry, stopRetry, tournamentPending, tournamentPaid, PASS_URL, RETRY_MS, GIVE_UP_MS, ctDay, r4, _cfg: () => cfg };
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
// The Network Tour (Marty 2026-11-17): mission rotation per hunter, and the free tier's tour stops.
|
||||
//
|
||||
// Measured 11-03 to 11-17: hunters repeated favorites (old sites 57-73 finds each, the rebuilt network sites 0-6).
|
||||
// So each hunter works through ROUNDS. A round = every active house mission (advertiser-paid missions are extra
|
||||
// allowance and stay outside the round). The board offers only the missions this hunter has not found in the
|
||||
// current round; once every one is found, the round closes and a new one starts. Never-visited missions sort
|
||||
// first, then the least recently found. A mission added mid-round joins the current round as not found; a paused
|
||||
// one is skipped and never blocks a round. Daily limits, draws, the pool and the tiers are untouched.
|
||||
//
|
||||
// State per member, on the volume (rotation.json): { start, rounds, closed: [ts...] }. `start` = the round began
|
||||
// after this instant; finds (member id OR wallet, the same rule as doneToday) at or after it count to the round.
|
||||
// Everyone starts at start 0, so a hunter's first round is their whole history: the sites they never visited are
|
||||
// exactly what is left, which is the point.
|
||||
//
|
||||
// Tour stops (free tier, Marty 2026-11-17): a free member (no active Game Pass, GAMEPASS on) is paid POL only for
|
||||
// DISCOVERY, a find on a house mission they have never found before. A repeat find is a "tour stop": it counts as
|
||||
// their hunt for the day, for the round and for the Full Network Tour badge, pays no POL, and grants a few
|
||||
// InstantAdPay ad credits (settings tourStopCredits / tourStopCreditsDailyMax) through a signed call. A new
|
||||
// mission pays POL again on each free member's first find of it. Game Pass holders are unchanged.
|
||||
'use strict';
|
||||
const store = require('./store');
|
||||
const missions = require('./missions');
|
||||
|
||||
const DEFAULTS = { rotationOn: 1, tourStopCredits: 10, tourStopCreditsDailyMax: 10 };
|
||||
function cfg() { const s = Object.assign({}, DEFAULTS, store.read('settings', {})); return { on: !!Number(s.rotationOn), credits: Math.max(0, Math.round(Number(s.tourStopCredits) || 0)), dailyMax: Math.max(0, Math.round(Number(s.tourStopCreditsDailyMax) || 0)) }; }
|
||||
|
||||
// the missions that make up a round: active house missions (paid ones are extra allowance, not part of the tour)
|
||||
function roundMissions() { return missions.list().filter(m => m.active && !m.paid); }
|
||||
// a hunter's house finds, all time, oldest first: non-failed, not prizes / referral drips / detective cases / paid missions
|
||||
function findsOf(memberId, wallet) {
|
||||
const w = wallet ? String(wallet).toLowerCase() : null; const id = Number(memberId);
|
||||
return store.read('payouts', []).filter(p => p.status !== 'failed' && !p.prize && !p.ref && !p.detective && !p.paid && (p.memberId === id || (w && p.wallet && String(p.wallet).toLowerCase() === w)))
|
||||
.sort((a, b) => (a.at || 0) - (b.at || 0));
|
||||
}
|
||||
// has this hunter ever found this mission (all time)? the discovery test
|
||||
function everFound(memberId, wallet, missionId) { return findsOf(memberId, wallet).some(p => p.missionId === missionId); }
|
||||
|
||||
// the round as it stands; closes any finished round on the way (persisted), so every caller sees the same thing
|
||||
function state(me) {
|
||||
const key = String(Number(me.memberId)); const finds = findsOf(me.memberId, me.wallet);
|
||||
const all = store.read('rotation', {}); let st = Object.assign({ start: 0, rounds: 0, closed: [] }, all[key] || {}); let changed = false;
|
||||
const round = roundMissions(); const ids = new Set(round.map(m => m.id));
|
||||
for (let guard = 0; guard < 100 && ids.size; guard++) {
|
||||
const got = new Set(); let closeAt = null;
|
||||
for (const p of finds) { if ((p.at || 0) < st.start || !ids.has(p.missionId)) continue; got.add(p.missionId); if (got.size === ids.size) { closeAt = p.at || 0; break; } }
|
||||
if (closeAt == null) break;
|
||||
st = { start: closeAt + 1, rounds: st.rounds + 1, closed: st.closed.concat([closeAt]).slice(-50) }; changed = true;
|
||||
}
|
||||
if (changed) store.update('rotation', {}, a => { a[key] = st; return a; });
|
||||
const done = new Set(finds.filter(p => (p.at || 0) >= st.start && ids.has(p.missionId)).map(p => p.missionId));
|
||||
const last = new Map(); for (const p of finds) last.set(p.missionId, p.at || 0); // last find per mission, all time
|
||||
const left = round.filter(m => !done.has(m.id));
|
||||
const toured = round.length > 0 && round.every(m => last.has(m.id)); // every active house mission found at least once, ever
|
||||
return { on: cfg().on, round: st.rounds + 1, rounds: st.rounds, total: round.length, done: round.length - left.length, doneIds: done, left, last, toured, start: st.start };
|
||||
}
|
||||
const rounds = memberId => { const st = store.read('rotation', {})[String(Number(memberId))]; return st ? Number(st.rounds) || 0 : 0; };
|
||||
|
||||
// the board's order: missions open this round (or every mission with rotation off), never-visited first, then the
|
||||
// least recently found; the member's daily shuffle (forMember) breaks ties. Paid missions keep their place in the mix.
|
||||
function order(me, st) {
|
||||
st = st || state(me); const base = missions.forMember(me.memberId);
|
||||
const open = st.on ? base.filter(m => m.paid || !st.doneIds.has(m.id)) : base;
|
||||
const rank = m => st.last.has(m.id) ? st.last.get(m.id) + 1 : 0; // 0 = never found, sorts first
|
||||
return open.map((m, i) => ({ m, i, r: rank(m) })).sort((a, b) => a.r - b.r || a.i - b.i).map(x => x.m);
|
||||
}
|
||||
// may this hunter start this mission? (rotation on: not if it was found earlier in this round; paid missions always)
|
||||
function blocked(me, m, st) { st = st || state(me); return !!(st.on && !m.paid && st.doneIds.has(m.id)); }
|
||||
|
||||
// ---- tour stops --------------------------------------------------------------------------------------------------
|
||||
// credits already granted (or owed) to this member today for tour stops
|
||||
function creditsToday(memberId) { const day = missions.ctDay(); return store.read('payouts', []).filter(p => p.memberId === Number(memberId) && p.day === day && p.tourStop).reduce((n, p) => n + (Number(p.tourStop.credits) || 0), 0); }
|
||||
// a free member's repeat find: the payout row (pol 0, status 'tour') carrying the credits to deliver
|
||||
function tourStop(me, m) {
|
||||
const c = cfg(); const credits = Math.max(0, Math.min(c.credits, c.dailyMax - creditsToday(me.memberId)));
|
||||
const rec = { id: Date.now().toString(36) + Math.random().toString(36).slice(2, 8), memberId: Number(me.memberId), email: me.email, wallet: me.wallet, username: me.username || null,
|
||||
missionId: m.id, site: m.site, pol: 0, day: missions.ctDay(), at: Date.now(), status: 'tour', tx: null, paidAt: null, error: null,
|
||||
tourStop: { credits, state: credits > 0 ? 'due' : 'none', tries: 0, sentAt: null } };
|
||||
store.update('payouts', [], all => { all.push(rec); return all; });
|
||||
return rec;
|
||||
}
|
||||
function markStop(id, patch) { let row = null; store.update('payouts', [], all => { const p = all.find(x => x.id === id); if (p && p.tourStop) { Object.assign(p.tourStop, patch); row = p; } return all; }); return row; }
|
||||
// deliver one stop's credits through InstantAdPay (polgrant.credits, signed, idempotent on ref 'tour:<row id>')
|
||||
async function deliver(row, gp) {
|
||||
if (!row || !row.tourStop || row.tourStop.state !== 'due' || !gp || !gp.credits) return null;
|
||||
const r = await gp.credits({ memberId: row.memberId, email: row.email, credits: row.tourStop.credits, ref: 'tour:' + row.id, note: 'PolHunter tour stop: ' + row.site });
|
||||
if (r && r.ok) return markStop(row.id, { state: 'sent', sentAt: Date.now(), granted: r.credits != null ? r.credits : row.tourStop.credits, error: null });
|
||||
return markStop(row.id, { tries: (row.tourStop.tries || 0) + 1, error: String((r && r.error) || 'no answer').slice(0, 120) }); // stays 'due' (owed): the tick retries
|
||||
}
|
||||
// the 2-minute tick: owed credits go out (a stop stays owed until InstantAdPay confirms it)
|
||||
async function retryDue(gp) { let n = 0; for (const p of store.read('payouts', []).filter(x => x.tourStop && x.tourStop.state === 'due').slice(0, 20)) { const r = await deliver(p, gp); if (r && r.tourStop.state === 'sent') n++; } return n; }
|
||||
|
||||
// admin: round stats per hunter (anyone with a house find)
|
||||
function adminView() {
|
||||
const seen = new Map(); for (const p of store.read('payouts', [])) if (!p.prize && !p.ref && !p.detective && !p.paid && p.status !== 'failed') seen.set(p.memberId, { memberId: p.memberId, wallet: p.wallet || (seen.get(p.memberId) || {}).wallet, who: p.username ? '@' + p.username : '#' + p.memberId });
|
||||
const rows = [...seen.values()].map(h => { const s = state(h); return { memberId: h.memberId, who: h.who, round: s.round, rounds: s.rounds, done: s.done, total: s.total, toured: s.toured, left: s.left.map(m => m.site), lastFind: s.last.size ? Math.max(...s.last.values()) : null }; });
|
||||
rows.sort((a, b) => b.rounds - a.rounds || b.done - a.done);
|
||||
const stops = store.read('payouts', []).filter(p => p.tourStop);
|
||||
return { settings: cfg(), hunters: rows, tourStops: { total: stops.length, sent: stops.filter(p => p.tourStop.state === 'sent').length, owed: stops.filter(p => p.tourStop.state === 'due').length, creditsSent: stops.filter(p => p.tourStop.state === 'sent').reduce((n, p) => n + (Number(p.tourStop.granted) || 0), 0), creditsOwed: stops.filter(p => p.tourStop.state === 'due').reduce((n, p) => n + (Number(p.tourStop.credits) || 0), 0) } };
|
||||
}
|
||||
|
||||
module.exports = { DEFAULTS, cfg, roundMissions, findsOf, everFound, state, rounds, order, blocked, creditsToday, tourStop, deliver, retryDue, markStop, adminView };
|
||||
+3
-2
@@ -15,7 +15,7 @@ const BADGES = [
|
||||
{ id: 'first', name: 'First Find', icon: '\u{1F3AF}', why: 'your first code claimed' },
|
||||
{ id: 'hunter', name: 'Hunter', icon: '\u{1F9ED}', why: 'five finds' },
|
||||
{ id: 'tracker', name: 'Tracker', icon: '\u{1F526}', why: 'twenty finds' },
|
||||
{ id: 'sweep', name: 'Full Sweep', icon: '\u{1F5FA}️', why: 'a find on every site' },
|
||||
{ id: 'sweep', name: 'Full Network Tour',icon: '\u{1F5FA}️', why: 'a find on every site in one round of the network tour' }, // renamed 2026-11-17 (the art still reads FULL SWEEP; only the title changed)
|
||||
{ id: 'lucky', name: 'Lucky Find', icon: '\u{1F48E}', why: 'one drip of 0.4 POL or more' },
|
||||
{ id: 'streak', name: 'On a Streak', icon: '\u{1F525}', why: 'finds on three days in a row' },
|
||||
{ id: 'top', name: 'Top Hunter', icon: '\u{1F3C6}', why: 'won a weekly prize as #1' },
|
||||
@@ -60,7 +60,8 @@ function badgesFor(memberId, list) {
|
||||
if (mine.length >= 5) out.add('hunter');
|
||||
if (mine.length >= 20) out.add('tracker');
|
||||
const sites = new Set(missions.list().filter(m => m.active !== false).map(m => m.site));
|
||||
if (sites.size && [...sites].every(s => mine.some(p => p.site === s))) out.add('sweep');
|
||||
if (sites.size && [...sites].every(s => mine.some(p => p.site === s))) out.add('sweep'); // the original rule, so nobody loses it
|
||||
try { if (require('./rotation').rounds(memberId) >= 1) out.add('sweep'); } catch (e) {} // a closed round of the Network Tour (once per round, count on the card)
|
||||
if (mine.some(p => p.pol >= 0.4)) out.add('lucky');
|
||||
const days = new Set(mine.map(p => p.day));
|
||||
for (const d of days) { if (days.has(dayMinus(d, 1)) && days.has(dayMinus(d, 2))) { out.add('streak'); break; } }
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
"scripts": {
|
||||
"start": "node server.js",
|
||||
"dev": "node --watch server.js",
|
||||
"test": "node test/gamepass.js && node test/run.js"
|
||||
"test": "node test/gamepass.js && node test/run.js && node test/rotation.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
|
||||
+14
-1
@@ -31,6 +31,11 @@
|
||||
<div style="margin-top:12px"><button class="btn sm" id="saveMission">Save mission</button> <span id="missionMsg" style="font-size:13px;color:var(--muted)"></span></div></div>
|
||||
<table id="missions" style="margin-top:14px"></table>
|
||||
</section>
|
||||
<section class="section"><h2>Network Tour</h2>
|
||||
<div class="sub" id="tourLine"></div>
|
||||
<div class="card"><div class="two"><div><label>Rotation (1 = on, 0 = off)</label><input id="rotationOn"></div><div><label>Tour stop ad credits (free tier repeat)</label><input id="tourStopCredits"></div><div><label>Tour stop credits, daily max per member</label><input id="tourStopCreditsDailyMax"></div></div><div style="margin-top:12px"><button class="btn sm" id="saveTour">Save tour settings</button></div></div>
|
||||
<table id="tourRows" style="margin-top:10px"></table>
|
||||
</section>
|
||||
<section class="section"><h2>Ad Detective</h2>
|
||||
<div class="sub" id="detLine"></div>
|
||||
<table id="detQs" style="margin-top:10px"></table>
|
||||
@@ -63,7 +68,15 @@
|
||||
$('detQs').innerHTML = '<tr><th>site</th><th>question</th><th>right answer</th><th>asked</th><th>right</th><th></th></tr>' + d.questions.map(q => '<tr style="' + (q.active === false ? 'opacity:.45' : '') + '"><td class="num">' + esc(q.missionId) + '</td><td>' + esc(q.q) + '</td><td>' + esc(q.options[0]) + '</td><td class="num">' + q.asked + '</td><td class="num">' + (q.asked ? Math.round(100 * q.correct / q.asked) + '%' : '—') + '</td><td><button class="btn ghost sm" data-qa="' + esc(q.id) + '" data-on="' + (q.active === false ? '1' : '0') + '">' + (q.active === false ? 'restore' : 'retire') + '</button></td></tr>').join('');
|
||||
document.querySelectorAll('[data-qa]').forEach(b => b.addEventListener('click', async () => { await api('/api/admin/detective/question', { method: 'POST', body: JSON.stringify({ id: b.dataset.qa, active: b.dataset.on === '1' }) }); loadDetective(); }));
|
||||
}
|
||||
$('go').addEventListener('click', () => { KEY = $('key').value.trim(); load(); loadDetective(); });
|
||||
// the Network Tour (2026-11-17): rounds per hunter, where each one stands this round, tour-stop credits sent and owed
|
||||
async function loadTour() {
|
||||
const t = await api('/api/admin/rotation'); if (!t || !t.hunters) return;
|
||||
for (const k of ['rotationOn', 'tourStopCredits', 'tourStopCreditsDailyMax']) $(k).value = k === 'rotationOn' ? (t.settings.on ? 1 : 0) : (k === 'tourStopCredits' ? t.settings.credits : t.settings.dailyMax);
|
||||
const ts = t.tourStops; $('tourLine').textContent = 'Rotation ' + (t.settings.on ? 'ON' : 'OFF') + ' · ' + t.hunters.length + ' hunters · ' + t.hunters.filter(h => h.rounds > 0).length + ' finished a round · tour stops ' + ts.total + ' (' + ts.creditsSent + ' credits sent, ' + ts.creditsOwed + ' owed)';
|
||||
$('tourRows').innerHTML = '<tr><th>hunter</th><th>rounds done</th><th>this round</th><th>toured all</th><th>left this round</th><th>last find</th></tr>' + t.hunters.map(h => '<tr><td>' + esc(h.who) + '</td><td class="num">' + h.rounds + '</td><td class="num">' + h.done + ' / ' + h.total + '</td><td>' + (h.toured ? 'yes' : '') + '</td><td style="font-size:12px">' + esc(h.left.join(', ')) + '</td><td>' + (h.lastFind ? new Date(h.lastFind).toLocaleString('en-US', { timeZone: 'America/Chicago' }) : '') + '</td></tr>').join('');
|
||||
}
|
||||
$('saveTour').addEventListener('click', async () => { const b = {}; for (const k of ['rotationOn', 'tourStopCredits', 'tourStopCreditsDailyMax']) b[k] = Number($(k).value); const r = await api('/api/admin/settings', { method: 'POST', body: JSON.stringify(b) }); if (r.error) alert(r.error); loadTour(); });
|
||||
$('go').addEventListener('click', () => { KEY = $('key').value.trim(); load(); loadDetective(); loadTour(); });
|
||||
$('key').addEventListener('keydown', e => { if (e.key === 'Enter') $('go').click(); });
|
||||
$('saveSettings').addEventListener('click', async () => { const b = {}; for (const k of ['minPol', 'maxPol', 'dailyCapPol', 'lowBalancePol']) b[k] = Number($(k).value); const r = await api('/api/admin/settings', { method: 'POST', body: JSON.stringify(b) }); if (r.error) alert(r.error); load(); });
|
||||
$('tickFaucet').addEventListener('click', async () => { $('faucetLine').textContent = 'running…'; const r = await api('/api/admin/faucet/tick', { method: 'POST' }); $('faucetLine').textContent = r.error ? r.error : 'paid ' + r.paid + ' · balance ' + (r.balance == null ? '—' : Number(r.balance).toFixed(4) + ' POL'); load(); });
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Your board · PolHunter</title>
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="stylesheet" href="/style.css?v=19">
|
||||
<link rel="stylesheet" href="/style.css?v=20">
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
@@ -58,7 +58,7 @@
|
||||
<div class="modal" id="shareModal" hidden><div class="modal-card"><button class="modal-x" id="shareClose" type="button" aria-label="Close">×</button><div id="shareBody"></div></div></div>
|
||||
<script src="https://instantadpay.com/assets/game-strip.js?v=20261003a"></script>
|
||||
<script>if (window.IAPGames) IAPGames.strip(document.getElementById('moreGames'), { current: 'polhunter', title: ' ' }).then(function (n) { var m = document.getElementById('moreGames'), h = m.querySelector('.gs-h'); if (h) h.remove(); document.getElementById('moreGamesSec').hidden = !n; });</script>
|
||||
<script src="/app.js?v=22"></script>
|
||||
<script src="/app.js?v=23"></script>
|
||||
<script src="/nas.js?v=20261024" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+20
-7
@@ -35,9 +35,9 @@
|
||||
const isOpen = open && open.missionId === m.id;
|
||||
const r = m.reward || {};
|
||||
return '<div class="card' + (isOpen ? ' mission-open' : '') + '" data-id="' + esc(m.id) + '">'
|
||||
+ '<span class="tag' + (m.done ? ' done' : '') + '">' + (m.done ? 'Done today' : esc(m.site)) + '</span>'
|
||||
+ '<span class="tag' + (m.done ? ' done' : '') + '">' + (m.done ? 'Done today' : esc(m.site)) + '</span>' + (!m.done && m.fresh ? ' <span class="tag gold">New to you</span>' : '')
|
||||
+ '<h3>' + esc(m.name) + '</h3><p>' + esc(m.brief) + '</p>'
|
||||
+ '<p style="margin-top:10px"><span class="range">' + r.minPol + ' to ' + r.maxPol + ' POL</span> <span style="color:var(--dim);font-size:12px">· ' + m.dwell + 's on the site</span></p>'
|
||||
+ '<p style="margin-top:10px"><span class="range">' + (m.tourStop ? 'Tour stop: +' + m.tourStop.credits + ' ad credits' : r.minPol + ' to ' + r.maxPol + ' POL') + '</span> <span style="color:var(--dim);font-size:12px">· ' + m.dwell + 's on the site</span></p>'
|
||||
+ (m.done ? '' : (board.pool && board.pool.spent && !isOpen) ? '<div class="cardact"><span class="tag gold">Closed until midnight Central</span></div>' : (board.daily && !board.daily.left && !isOpen) ? '<div class="cardact"><span class="tag">Back tomorrow</span></div>' : isOpen
|
||||
? '<div class="timer" id="timer">Your code appears on the site after <b>' + m.dwell + 's</b>. Keep that tab open.</div>'
|
||||
+ '<div class="codebox"><input id="code" maxlength="6" placeholder="6 CHARACTERS" autocomplete="off" spellcheck="false" inputmode="text" autocapitalize="characters"><button class="btn pol" id="submit">Claim</button></div><div class="site" style="font-size:12px;margin-top:6px">Six characters. On the site, tap the code to copy it, then paste it here.</div>'
|
||||
@@ -97,7 +97,7 @@
|
||||
// badge cards: art, lock state, share
|
||||
function badgeStrip() {
|
||||
const el = $('badgeStrip'); if (!el || !board.badgeCards) return;
|
||||
el.innerHTML = board.badgeCards.map(b => '<div class="badge-a' + (b.earned ? '' : ' locked') + '"><img src="' + b.art + '" alt="' + esc(b.name) + '" loading="lazy"><div class="bl">' + b.icon + ' ' + esc(b.name) + '</div><div class="bs">' + esc(b.why) + '</div>' + (b.earned ? '<button class="btn pol sm" data-share="' + b.id + '">Share</button>' : '<div class="bs">\u{1F512} locked</div>') + '</div>').join('');
|
||||
el.innerHTML = board.badgeCards.map(b => '<div class="badge-a' + (b.earned ? '' : ' locked') + '"><img src="' + b.art + '" alt="' + esc(b.name) + '" loading="lazy"><div class="bl">' + b.icon + ' ' + esc(b.name) + (b.count ? ' \u00d7' + b.count : '') + '</div><div class="bs">' + esc(b.why) + '</div>' + (b.earned ? '<button class="btn pol sm" data-share="' + b.id + '">Share</button>' : '<div class="bs">\u{1F512} locked</div>') + '</div>').join('');
|
||||
el.querySelectorAll('[data-share]').forEach(x => x.addEventListener('click', () => shareBadge(x.dataset.share, false)));
|
||||
}
|
||||
function shareBadge(id, unlocked) {
|
||||
@@ -112,16 +112,27 @@
|
||||
$('shareCopy').onclick = async () => { try { await navigator.clipboard.writeText(b.page); } catch (e) {} $('shareCopy').textContent = 'Copied'; setTimeout(() => { $('shareCopy').textContent = 'Copy link'; }, 1200); };
|
||||
}
|
||||
document.addEventListener('click', e => { if (e.target.id === 'shareClose' || e.target.id === 'shareModal') $('shareModal').hidden = true; });
|
||||
// the Network Tour (2026-11-17): how far through this round, which sites are left; a free member who has toured
|
||||
// everything is told what a repeat pays now (ad credits) and how POL comes back (new sites, or the Game Pass)
|
||||
function tourPanel() {
|
||||
const t = board.tour; if (!t || !t.on || !t.total) return '';
|
||||
const pct = Math.round(100 * t.done / t.total);
|
||||
const free = t.free && t.toured ? '<p class="tour-free">You\u2019ve toured the whole network. New sites pay POL when they launch. Want POL on every hunt? ' + (board.gamepass && board.gamepass.url ? '<a href="' + esc(board.gamepass.url) + '" target="_blank" rel="noopener">Get the Game Pass</a>.' : 'Get the Game Pass.') + ' Until then each hunt is a tour stop worth +' + t.tourStopCredits + ' InstantAdPay ad credits.</p>' : '';
|
||||
return '<div class="tour" style="grid-column:1/-1"><div class="tour-hd"><b>\u{1F5FA}\uFE0F Network tour:</b> ' + t.done + ' of ' + t.total + ' sites this round' + (t.rounds ? ' <span class="tour-r">\u00b7 ' + t.rounds + ' round' + (t.rounds === 1 ? '' : 's') + ' done</span>' : '') + '</div>'
|
||||
+ '<div class="tour-bar" role="progressbar" aria-valuemin="0" aria-valuemax="' + t.total + '" aria-valuenow="' + t.done + '"><i style="width:' + pct + '%"></i></div>'
|
||||
+ (t.left.length ? '<div class="tour-left">Left this round: ' + t.left.map(esc).join(' \u00b7 ') + '</div>' : '')
|
||||
+ free + '</div>';
|
||||
}
|
||||
function render() {
|
||||
badgeStrip();
|
||||
$('who').innerHTML = '<i></i> ' + esc(board.me.username ? '@' + board.me.username : '#' + board.me.memberId) + (board.me.wallet ? '' : ' · no wallet linked')
|
||||
// Game Pass (InstantAdPay, all nine games): active until <date>, or the link to get it; opens a new tab (the game may be framed)
|
||||
+ (board.gamepass && board.gamepass.on ? ' · ' + (board.gamepass.active ? '\u{1F3AB} Game Pass active' + (board.gamepass.untilText ? ' until ' + esc(board.gamepass.untilText) : '') + ' (5 missions a day, 2 Ad Detective cases)' : '\u{1F3AB} <a href="' + esc(board.gamepass.url) + '" target="_blank" rel="noopener">Get the Game Pass</a>: higher daily POL caps, 5 missions a day, 2 cases') : '');
|
||||
const r = board.missions[0] && board.missions[0].reward;
|
||||
if (r) $('rangeLine').textContent = 'Each find pays a random drip between ' + r.minPol + ' and ' + r.maxPol + ' POL. Your codes are yours alone.';
|
||||
if (r) $('rangeLine').textContent = (board.tour && board.tour.free && board.tour.toured) ? 'A site new to you pays a random drip of POL; a repeat is a tour stop worth ' + board.tour.tourStopCredits + ' ad credits. Your codes are yours alone.' : 'Each find pays a random drip between ' + r.minPol + ' and ' + r.maxPol + ' POL. Your codes are yours alone.';
|
||||
const pool = board.pool || {};
|
||||
if (!board.me.wallet) $('missions').innerHTML = onboarding();
|
||||
else $('missions').innerHTML = (pool.spent ? '<div class="notice" style="grid-column:1/-1"><b>Today\u2019s POL pool is spent.</b> No more claims today. Claims reopen at midnight Central' + (pool.resetsAt ? ', in ' + until(pool.resetsAt) : '') + '.</div>' : '')
|
||||
else $('missions').innerHTML = tourPanel() + (pool.spent ? '<div class="notice" style="grid-column:1/-1"><b>Today\u2019s POL pool is spent.</b> No more claims today. Claims reopen at midnight Central' + (pool.resetsAt ? ', in ' + until(pool.resetsAt) : '') + '.</div>' : '')
|
||||
+ (board.missions.length ? board.missions.map(card).join('') : '<div class="card"><p>No missions are open right now. Check back soon.</p></div>');
|
||||
if ($('refSlot')) $('refSlot').innerHTML = board.me.wallet ? referralCard() : '';
|
||||
wireRefVideo();
|
||||
@@ -156,7 +167,7 @@
|
||||
fridayCard(board.fridayBank);
|
||||
boxCard(board.box);
|
||||
const dl = board.daily; if (dl && $('rangeLine')) $('rangeLine').innerHTML = ($('rangeLine').textContent.replace(/\s*·\s*You have.*$/, '')) + ' \u00b7 ' + (dl.left ? 'You have <b>' + dl.left + ' of ' + dl.limit + '</b> missions left today.' : '<b>That is your ' + dl.limit + ' for today.</b> Fresh missions at midnight Central.');
|
||||
$('mine').innerHTML = board.drips.length ? board.drips.map(d => '<div class="row"><span>' + (String(d.missionId || '').startsWith('detective:') ? '\u{1F50E} ' : '') + esc(d.site) + '</span><span class="site">' + ({ paid: 'paid', sent: 'sending', due: 'paying next', queued: 'queued for the next pool', failed: 'held, being looked at' }[d.status] || d.status) + '</span><span class="pol">+' + d.pol + ' POL</span>' + (d.tx ? '<a class="when" target="_blank" rel="noopener" href="' + explorer + '/tx/' + d.tx + '">verify ↗</a>' : '<span class="when"></span>') + '</div>').join('')
|
||||
$('mine').innerHTML = board.drips.length ? board.drips.map(d => '<div class="row"><span>' + (String(d.missionId || '').startsWith('detective:') ? '\u{1F50E} ' : '') + esc(d.site) + '</span><span class="site">' + ({ paid: 'paid', sent: 'sending', due: 'paying next', queued: 'queued for the next pool', failed: 'held, being looked at', tour: 'tour stop' + (d.tourStop && d.tourStop.credits ? ': +' + d.tourStop.credits + ' ad credits' + (d.tourStop.state === 'sent' ? '' : ' (sending)') : '') }[d.status] || d.status) + '</span><span class="pol">' + (d.status === 'tour' ? '0' : '+' + d.pol) + ' POL</span>' + (d.tx ? '<a class="when" target="_blank" rel="noopener" href="' + explorer + '/tx/' + d.tx + '">verify ↗</a>' : '<span class="when"></span>') + '</div>').join('')
|
||||
: '<div class="row"><span class="site">Nothing yet. Your first find goes here.</span></div>';
|
||||
document.querySelectorAll('[data-start]').forEach(b => b.addEventListener('click', () => start(b.dataset.start)));
|
||||
const s = $('submit'); if (s) { s.addEventListener('click', submit); $('code').addEventListener('keydown', e => { if (e.key === 'Enter') submit(); }); tick(); }
|
||||
@@ -268,7 +279,9 @@
|
||||
const m = $('msg'); m.className = 'msg ' + (r.error ? 'bad' : 'ok'); m.textContent = r.error || r.message;
|
||||
if (!r.error && r.gamepass) board.gamepass = r.gamepass; // the Game Pass flag refreshes with every grant answer
|
||||
if (!r.error && /Get the Pass/.test(r.message || '') && board.gamepass && board.gamepass.on && !board.gamepass.active) m.innerHTML = esc(r.message) + ' <a href="' + esc(board.gamepass.url) + '" target="_blank" rel="noopener">Get the Game Pass</a>'; // the cap-hit nudge, in a new tab (the page may be framed)
|
||||
if (r.error) toast(esc(r.error), 'bad'); else toast('\u{1F389} <b>Found it!</b> ' + r.pol + ' POL is on its way to your wallet.', 'big');
|
||||
if (r.error) toast(esc(r.error), 'bad'); else if (r.tourStop) toast('\u{1F5FA}\uFE0F <b>Tour stop!</b> ' + (r.tourStop.credits ? '+' + r.tourStop.credits + ' ad credits to your InstantAdPay account.' : 'Logged for your network tour.'), 'big'); else toast('\u{1F389} <b>Found it!</b> ' + r.pol + ' POL is on its way to your wallet.', 'big');
|
||||
if (!r.error && r.tourStop && board.gamepass && board.gamepass.on && !board.gamepass.active) m.innerHTML = esc(r.message) + ' <a href="' + esc(board.gamepass.url) + '" target="_blank" rel="noopener">Get the Game Pass</a>';
|
||||
if (!r.error && r.round) toast('\u{1F5FA}\uFE0F <b>Full Network Tour!</b> Round ' + r.round + ' done. A new round starts now.', 'big');
|
||||
if (!r.error) { const a = document.createElement('a'); a.href = '#share'; a.textContent = ' Share this find \u2197'; a.style.marginLeft = '6px'; m.appendChild(a); delete $('sharetext').dataset.touched; }
|
||||
// an achievement unlocked by this find: celebrate it once the board has reloaded
|
||||
if (!r.error && r.unlocked && r.unlocked.length) { const id = r.unlocked[0]; toast('\u{1F3C6} <b>Achievement unlocked!</b>', 'big'); setTimeout(async () => { await load(); shareBadge(id, true); }, 1200); }
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="small"><a href="/guides">Guides</a> · PolHunter FAQ</div>
|
||||
<h2>PolHunter FAQ</h2>
|
||||
<div class="sub">Short answers on cost, wallets, codes a day, what a find pays, the Central-time reset, the daily pool and the Game Pass.</div>
|
||||
<h3 style="margin:22px 0 6px;font-size:19px">Does PolHunter cost anything?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. You hunt with a free InstantAdPay account. The Game Pass is optional and sold on InstantAdPay.</p><h3 style="margin:22px 0 6px;font-size:19px">Do I need a new account?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. You sign in with your InstantAdPay account. No separate account or password is created here.</p><h3 style="margin:22px 0 6px;font-size:19px">Which wallet do I need?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">SafePal or any other crypto wallet that works on Polygon. Link it in your InstantAdPay dashboard under Wallet; drips go to that address.</p><h3 style="margin:22px 0 6px;font-size:19px">How many codes can I find a day?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">A free account finds 1 code a day. Game Pass holders find 5. Advertiser missions and Friday Bonus Hunts can add more.</p><h3 style="margin:22px 0 6px;font-size:19px">How much does a find pay?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">A free find pays a random 0.02 to 0.10 POL. With the Game Pass a find pays a random 0.05 to 1 POL. Both lean toward the low end. Advertiser missions pay the amount the advertiser set.</p><h3 style="margin:22px 0 6px;font-size:19px">When does the day reset?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">At midnight Central time. The missions, your codes and the daily pool all reset then.</p><h3 style="margin:22px 0 6px;font-size:19px">Why does my board say claims are closed?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The daily pool is spent. Claims reopen at midnight Central, and a find that went over the pool can be paid on a later day.</p><h3 style="margin:22px 0 6px;font-size:19px">How fast am I paid?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The reward wallet sends due drips every couple of minutes. Each one shows up with a Polygonscan link you can open.</p><h3 style="margin:22px 0 6px;font-size:19px">Can I use a code a friend found?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. Every code is made for one hunter and one visit. Someone else’s code will not work for you.</p><h3 style="margin:22px 0 6px;font-size:19px">Can I run two accounts?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. One person, one account. Two accounts that share a wallet get one drip per mission per day between them.</p><h3 style="margin:22px 0 6px;font-size:19px">What are Friday Bonus Hunts?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Each day from Saturday through Thursday that you open an inbox ad and watch a video on InstantAdPay banks one extra hunt, usable on the Friday that follows.</p><h3 style="margin:22px 0 6px;font-size:19px">What is the Mystery Hunt Box?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">A Game Pass perk. Finish the day’s hunts and a box opens an Ad Detective case: visit a network site and answer one question about it. The reward is fixed and shown before you start.</p><h3 style="margin:22px 0 6px;font-size:19px">How do the weekly prizes work?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The leaderboard ranks hunters by finds from Monday to Sunday, Central time. Ties go to the most POL, then to whoever got there first. The weekly prizes go to Game Pass holders and are paid on chain.</p><h3 style="margin:22px 0 6px;font-size:19px">Do I earn for bringing people?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">New members you bring can earn you referral rewards, paid from their own pool. Only people who were never members before count.</p><h3 style="margin:22px 0 6px;font-size:19px">Is this income?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. PolHunter rewards completed missions. Rewards are not income and are not guaranteed, and the price of POL moves.</p><h3 style="margin:22px 0 6px;font-size:19px">Where do I get help?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Use <a href="https://instantadpay.com/support" rel="noopener">network support</a>.</p>
|
||||
<h3 style="margin:22px 0 6px;font-size:19px">Does PolHunter cost anything?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. You hunt with a free InstantAdPay account. The Game Pass is optional and sold on InstantAdPay.</p><h3 style="margin:22px 0 6px;font-size:19px">Do I need a new account?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. You sign in with your InstantAdPay account. No separate account or password is created here.</p><h3 style="margin:22px 0 6px;font-size:19px">Which wallet do I need?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">SafePal or any other crypto wallet that works on Polygon. Link it in your InstantAdPay dashboard under Wallet; drips go to that address.</p><h3 style="margin:22px 0 6px;font-size:19px">How many codes can I find a day?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">A free account finds 1 code a day. Game Pass holders find 5. Advertiser missions and Friday Bonus Hunts can add more.</p><h3 style="margin:22px 0 6px;font-size:19px">How much does a find pay?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">A free find pays a random 0.02 to 0.10 POL the first time you find each site; after you have found them all, a repeat find is a tour stop worth 10 InstantAdPay ad credits instead, and a new site pays POL again on your first find. With the Game Pass a find pays a random 0.05 to 1 POL. Both lean toward the low end. Advertiser missions pay the amount the advertiser set.</p><h3 style="margin:22px 0 6px;font-size:19px">What is the network tour?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Your board offers only the sites you have not found yet this round, the ones new to you first. Find every site and a new round starts, and each finished round counts toward the Full Network Tour badge.</p><h3 style="margin:22px 0 6px;font-size:19px">When does the day reset?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">At midnight Central time. The missions, your codes and the daily pool all reset then.</p><h3 style="margin:22px 0 6px;font-size:19px">Why does my board say claims are closed?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The daily pool is spent. Claims reopen at midnight Central, and a find that went over the pool can be paid on a later day.</p><h3 style="margin:22px 0 6px;font-size:19px">How fast am I paid?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The reward wallet sends due drips every couple of minutes. Each one shows up with a Polygonscan link you can open.</p><h3 style="margin:22px 0 6px;font-size:19px">Can I use a code a friend found?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. Every code is made for one hunter and one visit. Someone else’s code will not work for you.</p><h3 style="margin:22px 0 6px;font-size:19px">Can I run two accounts?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. One person, one account. Two accounts that share a wallet get one drip per mission per day between them.</p><h3 style="margin:22px 0 6px;font-size:19px">What are Friday Bonus Hunts?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Each day from Saturday through Thursday that you open an inbox ad and watch a video on InstantAdPay banks one extra hunt, usable on the Friday that follows.</p><h3 style="margin:22px 0 6px;font-size:19px">What is the Mystery Hunt Box?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">A Game Pass perk. Finish the day’s hunts and a box opens an Ad Detective case: visit a network site and answer one question about it. The reward is fixed and shown before you start.</p><h3 style="margin:22px 0 6px;font-size:19px">How do the weekly prizes work?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The leaderboard ranks hunters by finds from Monday to Sunday, Central time. Ties go to the most POL, then to whoever got there first. The weekly prizes go to Game Pass holders and are paid on chain.</p><h3 style="margin:22px 0 6px;font-size:19px">Do I earn for bringing people?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">New members you bring can earn you referral rewards, paid from their own pool. Only people who were never members before count.</p><h3 style="margin:22px 0 6px;font-size:19px">Is this income?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">No. PolHunter rewards completed missions. Rewards are not income and are not guaranteed, and the price of POL moves.</p><h3 style="margin:22px 0 6px;font-size:19px">Where do I get help?</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Use <a href="https://instantadpay.com/support" rel="noopener">network support</a>.</p>
|
||||
</section>
|
||||
<section class="section"><h2>More guides</h2><div class="steps"><div class="step"><b><a href="/guides/how-a-hunt-works">How a hunt works</a></b><br>Missions, codes, the daily reset, and what each find pays.</div><div class="step"><b><a href="/guides/is-polhunter-legit">Is PolHunter legit?</a></b><br>The reward wallet, every payout with a transaction, and the public ledger.</div><div class="step"><b><a href="/guides/free-account">Getting the most from your free account</a></b><br>Set up once, hunt every day, and the extras that cost nothing.</div></div></section>
|
||||
<footer class="foot">PolHunter rewards completed missions. Rewards are not income and are not guaranteed. Cryptocurrency involves risk of loss.<br>© 2026 TrustClickz · <a href="/guides">Guides</a> · <a href="/terms">Terms</a> · <a href="/disclaimer">Rewards disclaimer</a> · <a href="/privacy">Privacy</a> · <a href="https://instantadpay.com/support" rel="noopener">Support</a> · <a href="https://instantadpay.com">InstantAdPay</a></footer>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="small"><a href="/guides">Guides</a> · Getting the most from your free account</div>
|
||||
<h2>Getting the most from your free account</h2>
|
||||
<div class="sub">Set up your InstantAdPay account and wallet first, then the free extras: daily hunts, Friday Bonus Hunts, advertiser missions and sharing.</div>
|
||||
<h3 style="margin:22px 0 6px;font-size:19px">Set it up once</h3><div class="steps"><div class="step"><b>Create your free InstantAdPay account</b> at <a href="https://instantadpay.com/?from=polhunter" target="_blank" rel="noopener">instantadpay.com</a>. Email first, no wallet needed to sign up.</div><div class="step"><b>Link your wallet.</b> In your InstantAdPay dashboard open <a href="https://instantadpay.com/my#wallet" target="_blank" rel="noopener">Wallet</a> and connect SafePal or any other crypto wallet. Every drip lands at that address, on Polygon.</div><div class="step"><b>Open your board</b> with <a href="https://instantadpay.com/api/my/polhunter">Open my board</a>. No new password: InstantAdPay signs you straight in.</div></div><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Without a linked wallet you can see your board, but you cannot start a mission. That is the most common thing that stops a new hunter, so do it first.</p><h3 style="margin:22px 0 6px;font-size:19px">Hunt every day</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">A free account gets one code a day, and missions reset at midnight Central. One find a day, every day, is the habit that counts. Your finds also earn badges and put you on the <a href="/leaders">leaderboard</a>.</p><h3 style="margin:22px 0 6px;font-size:19px">Bank Friday Bonus Hunts</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">From Saturday through Thursday, each day you open an inbox ad and watch a video on InstantAdPay banks one extra hunt for Friday. You can also earn ad credits while you are there. Ad credits buy advertising, not income.</p><h3 style="margin:22px 0 6px;font-size:19px">Look for advertiser missions</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">When an advertiser mission is live and you have not done it today, it adds one extra hunt to your day and pays the amount the advertiser set.</p><h3 style="margin:22px 0 6px;font-size:19px">Share PolHunter</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Your board has your own share link. People who join InstantAdPay from it are your referrals there, and new members you bring can also earn you referral rewards here, paid from their own pool. Only people who were never members before count.</p><h3 style="margin:22px 0 6px;font-size:19px">When you want more</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The Game Pass on InstantAdPay is optional. With it you hunt 5 codes a day on the full draw, and you get the Mystery Hunt Box, the Ad Detective cases and the weekly prizes. Hunting free is fine too.</p>
|
||||
<h3 style="margin:22px 0 6px;font-size:19px">Set it up once</h3><div class="steps"><div class="step"><b>Create your free InstantAdPay account</b> at <a href="https://instantadpay.com/?from=polhunter" target="_blank" rel="noopener">instantadpay.com</a>. Email first, no wallet needed to sign up.</div><div class="step"><b>Link your wallet.</b> In your InstantAdPay dashboard open <a href="https://instantadpay.com/my#wallet" target="_blank" rel="noopener">Wallet</a> and connect SafePal or any other crypto wallet. Every drip lands at that address, on Polygon.</div><div class="step"><b>Open your board</b> with <a href="https://instantadpay.com/api/my/polhunter">Open my board</a>. No new password: InstantAdPay signs you straight in.</div></div><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Without a linked wallet you can see your board, but you cannot start a mission. That is the most common thing that stops a new hunter, so do it first.</p><h3 style="margin:22px 0 6px;font-size:19px">Hunt every day</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">A free account gets one code a day, and missions reset at midnight Central. Each site pays POL the first time you find it; once you have toured them all, a repeat find is a tour stop worth 10 InstantAdPay ad credits, and new sites pay POL again. One find a day, every day, is the habit that counts. Your finds also earn badges and put you on the <a href="/leaders">leaderboard</a>.</p><h3 style="margin:22px 0 6px;font-size:19px">Bank Friday Bonus Hunts</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">From Saturday through Thursday, each day you open an inbox ad and watch a video on InstantAdPay banks one extra hunt for Friday. You can also earn ad credits while you are there. Ad credits buy advertising, not income.</p><h3 style="margin:22px 0 6px;font-size:19px">Look for advertiser missions</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">When an advertiser mission is live and you have not done it today, it adds one extra hunt to your day and pays the amount the advertiser set.</p><h3 style="margin:22px 0 6px;font-size:19px">Share PolHunter</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Your board has your own share link. People who join InstantAdPay from it are your referrals there, and new members you bring can also earn you referral rewards here, paid from their own pool. Only people who were never members before count.</p><h3 style="margin:22px 0 6px;font-size:19px">When you want more</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The Game Pass on InstantAdPay is optional. With it you hunt 5 codes a day on the full draw, and you get the Mystery Hunt Box, the Ad Detective cases and the weekly prizes. Hunting free is fine too.</p>
|
||||
</section>
|
||||
<section class="section"><h2>More guides</h2><div class="steps"><div class="step"><b><a href="/guides/how-a-hunt-works">How a hunt works</a></b><br>Missions, codes, the daily reset, and what each find pays.</div><div class="step"><b><a href="/guides/is-polhunter-legit">Is PolHunter legit?</a></b><br>The reward wallet, every payout with a transaction, and the public ledger.</div><div class="step"><b><a href="/guides/faq">PolHunter FAQ</a></b><br>Short answers to the questions hunters ask most.</div></div></section>
|
||||
<footer class="foot">PolHunter rewards completed missions. Rewards are not income and are not guaranteed. Cryptocurrency involves risk of loss.<br>© 2026 TrustClickz · <a href="/guides">Guides</a> · <a href="/terms">Terms</a> · <a href="/disclaimer">Rewards disclaimer</a> · <a href="/privacy">Privacy</a> · <a href="https://instantadpay.com/support" rel="noopener">Support</a> · <a href="https://instantadpay.com">InstantAdPay</a></footer>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="small"><a href="/guides">Guides</a> · How a hunt works</div>
|
||||
<h2>How a hunt works</h2>
|
||||
<div class="sub">Missions, personal codes, once per mission per Central day, and what a find pays on a free account and with the Game Pass.</div>
|
||||
<h3 style="margin:22px 0 6px;font-size:19px">The short version</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">PolHunter is a scavenger hunt across the network. A mission sends you to one of our sites. You spend the time on the page, your personal code shows up somewhere on it, and you type that code into your board. A correct code pays a random drip of POL on Polygon to the wallet on your InstantAdPay account.</p><h3 style="margin:22px 0 6px;font-size:19px">Step by step</h3><div class="steps"><div class="step"><b>Pick a mission</b> on your board. Each one names a site and what to find there.</div><div class="step"><b>Go find it.</b> Stay on the page for the time the mission asks. Your code only appears after that.</div><div class="step"><b>Type the code.</b> If it is yours, the drip is recorded right away and the reward wallet sends it to your wallet, with a Polygonscan link to prove it.</div></div><h3 style="margin:22px 0 6px;font-size:19px">Your code is yours alone</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Each code is made for you and for that one visit, and it only shows on the mission site after the wait. A code copied from someone else will not work for you, and the hiding place moves.</p><h3 style="margin:22px 0 6px;font-size:19px">How many codes a day</h3><table style="width:100%;max-width:640px;border-collapse:collapse;margin:6px 0 14px;font-size:15px"><tr style="text-align:left;border-bottom:1px solid var(--edge)"><th style="padding:8px 6px">Account</th><th style="padding:8px 6px">Codes a day</th><th style="padding:8px 6px">Each find pays</th></tr><tr style="border-bottom:1px solid var(--edge)"><td style="padding:8px 6px">Free InstantAdPay account</td><td style="padding:8px 6px">1</td><td style="padding:8px 6px">0.02 to 0.10 POL</td></tr><tr><td style="padding:8px 6px">Game Pass holder</td><td style="padding:8px 6px">5</td><td style="padding:8px 6px">0.05 to 1 POL</td></tr></table><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The drip is random inside that range and weighted toward the low end, so small drips are common and big ones are rare. Advertiser missions, when there are any, pay the amount the advertiser set and add one extra hunt each.</p><h3 style="margin:22px 0 6px;font-size:19px">Once per mission per Central day</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Each mission can be found once per day, and the day runs on Central time. At midnight Central the codes, the missions and the daily pool all reset. Two accounts that share a wallet get one drip per mission per day between them.</p><h3 style="margin:22px 0 6px;font-size:19px">The daily pool</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Finds are paid from a daily pool. If it is spent before the day ends, your board says so and claims reopen at midnight Central. A find that would go over the pool can be queued and paid on a later day instead.</p><h3 style="margin:22px 0 6px;font-size:19px">The extras</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65"><b>Friday Bonus Hunts.</b> On InstantAdPay, each day from Saturday through Thursday that you open an inbox ad and watch a video there banks one extra hunt for the Friday that follows.</p><p style="margin:0 0 12px;max-width:70ch;line-height:1.65"><b>Mystery Hunt Box and Ad Detective.</b> Game Pass holders who finish the day’s hunts unlock a box with an Ad Detective case: visit a network site, then answer one question about it. The reward is fixed and shown before you start.</p><p style="margin:0 0 12px;max-width:70ch;line-height:1.65"><b>Weekly prizes.</b> The <a href="/leaders">leaderboard</a> ranks hunters by finds, Monday to Sunday Central time. The weekly prizes go to Game Pass holders and are paid on chain from the same reward wallet.</p><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Nothing here is promised. Rewards are not income, and the range, the number of hunts and the pools can change. See the <a href="/disclaimer">Rewards disclaimer</a>.</p>
|
||||
<h3 style="margin:22px 0 6px;font-size:19px">The short version</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">PolHunter is a scavenger hunt across the network. A mission sends you to one of our sites. You spend the time on the page, your personal code shows up somewhere on it, and you type that code into your board. A correct code pays a random drip of POL on Polygon to the wallet on your InstantAdPay account.</p><h3 style="margin:22px 0 6px;font-size:19px">Step by step</h3><div class="steps"><div class="step"><b>Pick a mission</b> on your board. Each one names a site and what to find there.</div><div class="step"><b>Go find it.</b> Stay on the page for the time the mission asks. Your code only appears after that.</div><div class="step"><b>Type the code.</b> If it is yours, the drip is recorded right away and the reward wallet sends it to your wallet, with a Polygonscan link to prove it.</div></div><h3 style="margin:22px 0 6px;font-size:19px">Your code is yours alone</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Each code is made for you and for that one visit, and it only shows on the mission site after the wait. A code copied from someone else will not work for you, and the hiding place moves.</p><h3 style="margin:22px 0 6px;font-size:19px">How many codes a day</h3><table style="width:100%;max-width:640px;border-collapse:collapse;margin:6px 0 14px;font-size:15px"><tr style="text-align:left;border-bottom:1px solid var(--edge)"><th style="padding:8px 6px">Account</th><th style="padding:8px 6px">Codes a day</th><th style="padding:8px 6px">Each find pays</th></tr><tr style="border-bottom:1px solid var(--edge)"><td style="padding:8px 6px">Free InstantAdPay account</td><td style="padding:8px 6px">1</td><td style="padding:8px 6px">0.02 to 0.10 POL on a site new to you; a repeat is a tour stop worth 10 InstantAdPay ad credits</td></tr><tr><td style="padding:8px 6px">Game Pass holder</td><td style="padding:8px 6px">5</td><td style="padding:8px 6px">0.05 to 1 POL</td></tr></table><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">The drip is random inside that range and weighted toward the low end, so small drips are common and big ones are rare. Advertiser missions, when there are any, pay the amount the advertiser set and add one extra hunt each.</p><h3 style="margin:22px 0 6px;font-size:19px">Once per mission per Central day</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Each mission can be found once per day, and the day runs on Central time. At midnight Central the codes, the missions and the daily pool all reset. Two accounts that share a wallet get one drip per mission per day between them.</p><h3 style="margin:22px 0 6px;font-size:19px">The network tour</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Your board walks you around the whole network. Each round, it only offers the sites you have not found yet this round, newest to you first; find them all and a new round starts, with the Full Network Tour badge for every round you finish.</p><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">On a free account, a find pays POL while you are discovering: the first time you find each site. Once you have found every site, a repeat find is a tour stop that pays 10 InstantAdPay ad credits instead of POL, and each new site that joins the network pays POL again on your first find. Game Pass holders are paid POL on every find.</p><h3 style="margin:22px 0 6px;font-size:19px">The daily pool</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Finds are paid from a daily pool. If it is spent before the day ends, your board says so and claims reopen at midnight Central. A find that would go over the pool can be queued and paid on a later day instead.</p><h3 style="margin:22px 0 6px;font-size:19px">The extras</h3><p style="margin:0 0 12px;max-width:70ch;line-height:1.65"><b>Friday Bonus Hunts.</b> On InstantAdPay, each day from Saturday through Thursday that you open an inbox ad and watch a video there banks one extra hunt for the Friday that follows.</p><p style="margin:0 0 12px;max-width:70ch;line-height:1.65"><b>Mystery Hunt Box and Ad Detective.</b> Game Pass holders who finish the day’s hunts unlock a box with an Ad Detective case: visit a network site, then answer one question about it. The reward is fixed and shown before you start.</p><p style="margin:0 0 12px;max-width:70ch;line-height:1.65"><b>Weekly prizes.</b> The <a href="/leaders">leaderboard</a> ranks hunters by finds, Monday to Sunday Central time. The weekly prizes go to Game Pass holders and are paid on chain from the same reward wallet.</p><p style="margin:0 0 12px;max-width:70ch;line-height:1.65">Nothing here is promised. Rewards are not income, and the range, the number of hunts and the pools can change. See the <a href="/disclaimer">Rewards disclaimer</a>.</p>
|
||||
</section>
|
||||
<section class="section"><h2>More guides</h2><div class="steps"><div class="step"><b><a href="/guides/is-polhunter-legit">Is PolHunter legit?</a></b><br>The reward wallet, every payout with a transaction, and the public ledger.</div><div class="step"><b><a href="/guides/free-account">Getting the most from your free account</a></b><br>Set up once, hunt every day, and the extras that cost nothing.</div><div class="step"><b><a href="/guides/faq">PolHunter FAQ</a></b><br>Short answers to the questions hunters ask most.</div></div></section>
|
||||
<footer class="foot">PolHunter rewards completed missions. Rewards are not income and are not guaranteed. Cryptocurrency involves risk of loss.<br>© 2026 TrustClickz · <a href="/guides">Guides</a> · <a href="/terms">Terms</a> · <a href="/disclaimer">Rewards disclaimer</a> · <a href="/privacy">Privacy</a> · <a href="https://instantadpay.com/support" rel="noopener">Support</a> · <a href="https://instantadpay.com">InstantAdPay</a></footer>
|
||||
|
||||
@@ -157,3 +157,10 @@ textarea{width:100%;padding:12px 14px;border-radius:12px;border:1px solid var(--
|
||||
|
||||
/* cross-promo strip (2026-10-03) */
|
||||
.moreGames{--gs-ink:var(--ink);--gs-muted:var(--muted);--gs-card:var(--glass);--gs-line:var(--edge);--gs-hot:var(--gold);--gs-font:var(--font);margin-top:12px}
|
||||
/* the Network Tour (2026-11-17): round progress on the board */
|
||||
.tour{padding:14px 18px;border-radius:16px;border:1px solid var(--edge-hi);background:rgba(130,71,229,.10)}
|
||||
.tour-hd{font-size:15px;color:var(--ink)} .tour-r{color:var(--dim);font-size:13px}
|
||||
.tour-bar{height:8px;border-radius:999px;background:rgba(255,255,255,.08);margin:10px 0 8px;overflow:hidden}
|
||||
.tour-bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--pol-hi),var(--gold-hi))}
|
||||
.tour-left{font-size:13px;color:var(--muted);line-height:1.5}
|
||||
.tour-free{margin:10px 0 0;font-size:14px;color:var(--gold-hi)}
|
||||
|
||||
@@ -57,6 +57,9 @@ const passExtra = me => passActive(me) ? 2 : 0; // the perk: 5 missions a day in
|
||||
// a free account gets the free tier (lib/rewards.js freeMissionsPerDay / freeMinPol / freeMaxPol). With GAMEPASS off there is no
|
||||
// pass to buy, so everyone stays on the full tier as before.
|
||||
const fullTier = me => !gp.on() || passActive(me);
|
||||
// the Network Tour (Marty 2026-11-17, lib/rotation.js): rounds per hunter; a free member's repeat find is a tour stop (ad credits, no POL)
|
||||
const rotation = require('./lib/rotation');
|
||||
const isTourStop = (me, m) => !fullTier(me) && !m.paid && rotation.everFound(me.memberId, me.wallet, m.id);
|
||||
// one reward through IAP: ask(pol, ref) -> IAP's answer (+ the player-facing note), wait(rowId, pol, ref) -> queue the ref (fail closed)
|
||||
const gpGate = me => ({
|
||||
ask: async (pol, ref) => { const r = await gp.grant({ memberId: me.memberId, email: me.email, kind: 'daily', pol, ref }); r.note = gp.note(r, 'daily', pol); return r; },
|
||||
@@ -269,7 +272,7 @@ const server = http.createServer(async (req, res) => {
|
||||
if (p === '/api/badges') return json(res, 200, { badges: social.BADGES.map(b => Object.assign({ art: '/badges/badge-' + b.id + '.jpg' }, b)) });
|
||||
if (p === '/api/prizes') return json(res, 200, social.prizes(), { 'Cache-Control': 'public, max-age=60' });
|
||||
if (p === '/leaders') return sendFile(res, path.join(PUBLIC_DIR, 'leaders.html'));
|
||||
if (p === '/promo') return sendFile(res, path.join(PUBLIC_DIR, 'promo.html'));
|
||||
if (p === '/promo') return sendFile(res, path.join(PUBLIC_DIR, 'promo.html'));
|
||||
if (p === '/terms' || p === '/privacy' || p === '/disclaimer') return sendFile(res, path.join(PUBLIC_DIR, p.slice(1) + '.html')); // legal pages (2026-11-17)
|
||||
// evergreen Guides (Marty 2026-11-17): /guides and four pages, static files in public/guides
|
||||
const GUIDES = ['how-a-hunt-works', 'is-polhunter-legit', 'free-account', 'faq'];
|
||||
@@ -291,9 +294,14 @@ const server = http.createServer(async (req, res) => {
|
||||
const fbank = await fbFor(me);
|
||||
if (gp.on()) gp.fetchPass(me.memberId, me.email).catch(() => {}); // keep the Game Pass flag fresh (display + perks; grant answers carry the truth)
|
||||
referrals.seen(me); // hunters already signed in never pass through /auth again, so keep the directory fresh here too
|
||||
const done = rewards.doneToday(me.memberId, me.wallet); const wdone = done; // today's finds, by member id or wallet
|
||||
return json(res, 200, { me: { memberId: me.memberId, username: me.username, wallet: me.wallet }, missions: missions.forMember(me.memberId).map(m => Object.assign(pubMission(m), { done: done.has(m.id) || wdone.has(m.id) })), drips: rewards.mine(me.memberId).slice(0, 20), faucet: { on: faucetOn }, pool: rewards.pool(), daily: rewards.daily(me.memberId, rewards.doneToday(me.memberId, me.wallet), fbank.bonus, passExtra(me)), fridayBank: fbank, gamepass: gp.view(me.memberId, me.email),
|
||||
badges: social.badgesFor(me.memberId), badgeCards: (() => { const got = new Set(social.badgesFor(me.memberId).map(b => b.id)); const who = social.nameOf(me); return social.BADGES.map(b => ({ id: b.id, name: b.name, icon: b.icon, why: b.why, art: '/badges/badge-' + b.id + '.jpg', earned: got.has(b.id), page: got.has(b.id) ? SITE + '/b/' + who + '/' + b.id : null, image: got.has(b.id) ? SITE + '/badge-img/' + who + '/' + b.id + '.jpg' : null })); })(), rank: { week: social.rankOf(me.memberId, 'week'), month: social.rankOf(me.memberId, 'month'), all: social.rankOf(me.memberId, 'all') },
|
||||
const done = rewards.doneToday(me.memberId, me.wallet); // today's finds, by member id or wallet
|
||||
// the Network Tour: open this round first (never visited, then least recently found), then today's finds marked done
|
||||
const rot = rotation.state(me), free = !fullTier(me), rc = rotation.cfg();
|
||||
const offered = rotation.order(me, rot).filter(m => !done.has(m.id)), doneList = missions.forMember(me.memberId).filter(m => done.has(m.id));
|
||||
const boardMissions = offered.concat(doneList).map(m => Object.assign(pubMission(m), { done: done.has(m.id), fresh: !m.paid && !rot.last.has(m.id), tourStop: free && !m.paid && rot.last.has(m.id) ? { credits: rc.credits } : undefined }));
|
||||
const tour = { on: rot.on, round: rot.round, rounds: rot.rounds, done: rot.done, total: rot.total, left: [...new Set(rot.left.map(m => m.site))], toured: rot.toured, free, tourStopCredits: rc.credits };
|
||||
return json(res, 200, { me: { memberId: me.memberId, username: me.username, wallet: me.wallet }, missions: boardMissions, tour, drips: rewards.mine(me.memberId).slice(0, 20), faucet: { on: faucetOn }, pool: rewards.pool(), daily: rewards.daily(me.memberId, rewards.doneToday(me.memberId, me.wallet), fbank.bonus, passExtra(me), fullTier(me)), /* the tier, as start/submit pass it (the board showed a Pass holder 3, not 5) */ fridayBank: fbank, gamepass: gp.view(me.memberId, me.email),
|
||||
badges: social.badgesFor(me.memberId), badgeCards: (() => { const got = new Set(social.badgesFor(me.memberId).map(b => b.id)); const who = social.nameOf(me); return social.BADGES.map(b => ({ id: b.id, name: b.name, icon: b.icon, why: b.why, count: b.id === 'sweep' && rot.rounds > 1 ? rot.rounds : undefined, art: '/badges/badge-' + b.id + '.jpg', earned: got.has(b.id), page: got.has(b.id) ? SITE + '/b/' + who + '/' + b.id : null, image: got.has(b.id) ? SITE + '/badge-img/' + who + '/' + b.id + '.jpg' : null })); })(), rank: { week: social.rankOf(me.memberId, 'week'), month: social.rankOf(me.memberId, 'month'), all: social.rankOf(me.memberId, 'all') },
|
||||
share: { link: social.shareLink(SITE, me), joinUrl: 'https://instantadpay.com/join/' + encodeURIComponent(String(me.username || me.memberId)) + '?from=polhunter' },
|
||||
referral: referrals.state(me), box: detective.view(me, fullTier(me)) });
|
||||
}
|
||||
@@ -301,6 +309,7 @@ const server = http.createServer(async (req, res) => {
|
||||
const b = await readBody(req); const m = missions.get(String(b.missionId || '')); if (!m || !m.active) return json(res, 404, { error: 'That mission is not open.' });
|
||||
if (!me.wallet) return json(res, 400, { error: 'Link a wallet on InstantAdPay first so the drip has somewhere to land, then open PolHunter again.' });
|
||||
if (rewards.completed(me.memberId, m.id, me.wallet)) return json(res, 400, { error: 'You already completed this one.' });
|
||||
if (rotation.blocked(me, m)) return json(res, 400, { error: 'You found this one already this round. The rest of the network tour comes first.', tour: true });
|
||||
{ const pool = rewards.pool(); if (pool.spent) return json(res, 400, { error: SPENT_MSG, spent: true, resetsAt: pool.resetsAt }); }
|
||||
{ const fb = await fbFor(me); const d = rewards.daily(me.memberId, rewards.doneToday(me.memberId, me.wallet), fb.bonus, passExtra(me), fullTier(me)); if (!d.left) return json(res, 400, { error: dailyMsg(d), dailyDone: true, resetsAt: rewards.pool().resetsAt }); }
|
||||
if (limited('start:' + me.memberId, 20, 3600000)) return json(res, 429, { error: 'Easy. Twenty starts an hour is plenty.' });
|
||||
@@ -319,7 +328,18 @@ const server = http.createServer(async (req, res) => {
|
||||
if (rewards.completed(me.memberId, m.id, me.wallet)) return json(res, 400, { error: 'You already completed this one.' });
|
||||
{ const pool = rewards.pool(); if (pool.spent) return json(res, 400, { error: SPENT_MSG, spent: true, resetsAt: pool.resetsAt }); }
|
||||
{ const fb = await fbFor(me); const d = rewards.daily(me.memberId, rewards.doneToday(me.memberId, me.wallet), fb.bonus, passExtra(me), fullTier(me)); if (!d.left) return json(res, 400, { error: dailyMsg(d), dailyDone: true, resetsAt: rewards.pool().resetsAt }); }
|
||||
const before = new Set(social.badgesFor(me.memberId).map(b => b.id));
|
||||
const before = new Set(social.badgesFor(me.memberId).map(b => b.id)); const roundsBefore = rotation.state(me).rounds;
|
||||
// a free member's repeat find (Marty 2026-11-17): a tour stop, ad credits instead of POL; counts as the day's hunt and for the tour
|
||||
if (isTourStop(me, m)) {
|
||||
const row = rotation.tourStop(me, m); const roundsNow = rotation.state(me).rounds;
|
||||
const unlocked = social.badgesFor(me.memberId).filter(b => !before.has(b.id));
|
||||
for (const b of unlocked) notify('badge', { me, id: b.id }).catch(() => {});
|
||||
const show = unlocked.map(b => b.id); if (roundsNow > roundsBefore && !show.includes('sweep')) show.push('sweep'); // a new round closed: celebrate again
|
||||
rotation.deliver(row, gp).catch(e => console.error('tour stop', e.message)); // signed call to InstantAdPay; owed and retried if it fails
|
||||
const cr = row.tourStop.credits;
|
||||
return json(res, 200, { ok: true, pol: 0, tourStop: { credits: cr }, unlocked: show, round: roundsNow > roundsBefore ? roundsNow : null, gamepass: gp.view(me.memberId, me.email),
|
||||
message: 'Tour stop logged. ' + (cr > 0 ? '+' + cr + ' ad credits are on their way to your InstantAdPay account.' : 'Today\u2019s tour-stop ad credits are already yours.') + ' New sites pay POL on your first find, and the Game Pass pays POL on every hunt.' });
|
||||
}
|
||||
let g, note = null;
|
||||
if (gp.on() && !m.paid) { // the Game Pass: IAP's account-wide daily cap first (a paid mission is the advertiser's money, not gated)
|
||||
const quote = rewards.quote(m, fullTier(me)), ref = 'find:' + m.id + ':' + missions.ctDay(), r = await gpGate(me).ask(quote, ref); note = r.note;
|
||||
@@ -332,9 +352,11 @@ const server = http.createServer(async (req, res) => {
|
||||
try { refDrips = referrals.onFind(me, g.rec); } catch (e) { console.error('referral', e.message); }
|
||||
for (const d of refDrips) if (d.ref.kind === 'bounty' || d.ref.kind === 'first-bonus') notify(d.ref.kind === 'bounty' ? 'referral' : 'firstbonus', { drip: d }).catch(() => {});
|
||||
// achievements unlocked by this find: told to the board, posted to Telegram (gated)
|
||||
const roundsNow = rotation.state(me).rounds;
|
||||
const unlocked = social.badgesFor(me.memberId).filter(b => !before.has(b.id));
|
||||
for (const b of unlocked) notify('badge', { me, id: b.id }).catch(() => {});
|
||||
return json(res, 200, { ok: true, pol: g.waiting ? 0 : g.rec.pol, nominal: g.rec.nominal, queued: g.queued, capped: g.capped, waiting: g.waiting, note, unlocked: unlocked.map(b => b.id), gamepass: gp.view(me.memberId, me.email),
|
||||
const show = unlocked.map(b => b.id); if (roundsNow > roundsBefore && !show.includes('sweep')) show.push('sweep'); // Full Network Tour again: board only, Telegram posts a badge once
|
||||
return json(res, 200, { ok: true, pol: g.waiting ? 0 : g.rec.pol, nominal: g.rec.nominal, queued: g.queued, capped: g.capped, waiting: g.waiting, note, unlocked: show, round: roundsNow > roundsBefore ? roundsNow : null, gamepass: gp.view(me.memberId, me.email),
|
||||
message: g.waiting ? 'Found it. ' + note : g.capped ? 'Found it. ' + note : g.queued ? 'Found it. Today’s POL is spoken for, so yours is queued and pays out next.' : 'Found it. ' + fmt(g.rec.pol) + ' POL is on its way to your wallet.' + (note ? ' ' + note : '') });
|
||||
}
|
||||
// ---- Mystery Hunt Box + Ad Detective
|
||||
@@ -371,10 +393,11 @@ const server = http.createServer(async (req, res) => {
|
||||
return json(res, 200, { ok: true, missions: missions.list() });
|
||||
}
|
||||
if (p === '/api/admin/mission' && req.method === 'DELETE') { const b = await readBody(req); missions.remove(String(b.id || '')); return json(res, 200, { ok: true, missions: missions.list() }); }
|
||||
if (p === '/api/admin/settings' && req.method === 'POST') { const b = await readBody(req); const patch = {}; for (const k of ['minPol', 'maxPol', 'dailyCapPol', 'lowBalancePol', 'weeklyMinFinds', 'drawSkew', 'missionsPerDay', 'freeMissionsPerDay', 'freeMinPol', 'freeMaxPol', 'detectiveOn', 'detectivePol', 'refEnabled', 'refBountyPol', 'refMatchPct', 'refMatchDays', 'refNewDays', 'refCapPol', 'refMatchMinPol']) if (b[k] != null && Number(b[k]) >= 0) patch[k] = Number(b[k]); for (const k of ['weeklyPrizes', 'leaderboardExclude']) if (Array.isArray(b[k])) patch[k] = b[k].map(Number).filter(n => n >= 0); return json(res, 200, { ok: true, settings: rewards.setSettings(patch) }); }
|
||||
if (p === '/api/admin/settings' && req.method === 'POST') { const b = await readBody(req); const patch = {}; for (const k of ['minPol', 'maxPol', 'dailyCapPol', 'lowBalancePol', 'weeklyMinFinds', 'drawSkew', 'missionsPerDay', 'freeMissionsPerDay', 'freeMinPol', 'freeMaxPol', 'detectiveOn', 'detectivePol', 'refEnabled', 'refBountyPol', 'refMatchPct', 'refMatchDays', 'refNewDays', 'refCapPol', 'refMatchMinPol', 'rotationOn', 'tourStopCredits', 'tourStopCreditsDailyMax']) if (b[k] != null && Number(b[k]) >= 0) patch[k] = Number(b[k]); for (const k of ['weeklyPrizes', 'leaderboardExclude']) if (Array.isArray(b[k])) patch[k] = b[k].map(Number).filter(n => n >= 0); return json(res, 200, { ok: true, settings: rewards.setSettings(patch) }); }
|
||||
// award a week by hand (its Monday key); already-awarded weeks are skipped
|
||||
if (p === '/api/admin/prizes/award' && req.method === 'POST') { const b = await readBody(req); const r = social.awardWeek(String(b.week || '')); if (r && r.winners && r.winners.length) notify('prize', r).catch(() => {}); return json(res, r && r.error ? 400 : 200, r); }
|
||||
// Ad Detective question bank: stats per question, add or edit one, retire or restore one
|
||||
if (p === '/api/admin/rotation') return json(res, 200, rotation.adminView()); // the Network Tour: rounds per hunter, tour-stop credits sent / owed
|
||||
if (p === '/api/admin/detective') return json(res, 200, detective.stats());
|
||||
if (p === '/api/admin/detective/question' && req.method === 'POST') { const b = await readBody(req); if (b.id && b.active != null && !b.q) return json(res, detective.setActive(String(b.id), !!b.active) ? 200 : 404, { ok: true }); const r = detective.saveQuestion(b); return json(res, r.error ? 400 : 200, r); }
|
||||
if (p === '/api/admin/drip/retry' && req.method === 'POST') { const b = await readBody(req); rewards.mark(String(b.id || ''), { status: 'due', error: null }); return json(res, 200, { ok: true }); }
|
||||
@@ -401,6 +424,8 @@ if (faucetOn) setInterval(() => faucet.tick(notify).catch(e => console.error('fa
|
||||
// Game Pass: refs that could not reach InstantAdPay retry every 5 minutes (lib/polgrant.js); the weekly Pass Tournament prizes are
|
||||
// paid from this faucet every 10 minutes (lib/tournament.js). Both are inert unless GAMEPASS=on; prizes need the faucet wallet too.
|
||||
gp.startRetry(payQueued); if (faucetOn) tournament.start();
|
||||
// tour-stop ad credits InstantAdPay has not confirmed yet are retried every two minutes (owed until then)
|
||||
setInterval(() => { if (gp.on()) rotation.retryDue(gp).catch(e => console.error('tour stops', e.message)); }, 2 * 60000);
|
||||
// Every completed mission reaches Telegram (Marty, 2026-09-21): a find is posted when its drip is paid, and
|
||||
// this sweep posts any paid find that is not marked posted yet (the pre-live gate, Telegram down, a restart).
|
||||
// Only finds made after HUNT_POST_SINCE count, so rehearsal drips from before the doors opened stay quiet.
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
// The Network Tour (Marty 2026-11-17): mission rotation per hunter and the free tier's tour stops, end to end on a local
|
||||
// boot with GAMEPASS=on against a stub InstantAdPay (player, polgrant, credits). Production is never contacted.
|
||||
// Covers: round progression and reset, a mission added mid-round, a paused mission, never-visited first then least
|
||||
// recently found, the start gate, the Full Network Tour badge once per round, discovery pays POL for a free member,
|
||||
// a repeat after the full tour is a tour stop (credits, no POL), a new mission pays POL once, Game Pass holders
|
||||
// unchanged, tour-stop credits capped per day and idempotent on ref, daily limits unchanged.
|
||||
// Run: node test/rotation.js
|
||||
'use strict';
|
||||
const { spawn } = require('child_process');
|
||||
const http = require('http'), crypto = require('crypto'), path = require('path'), fs = require('fs');
|
||||
|
||||
const PORT = 8897, DIR = path.join(__dirname, '..', 'data-test-rot'), SECRET = 'r'.repeat(48);
|
||||
fs.rmSync(DIR, { recursive: true, force: true });
|
||||
let fails = 0;
|
||||
const eq = (a, b, m) => { const ok = JSON.stringify(a) === JSON.stringify(b); console.log((ok ? ' ok ' : ' FAIL ') + m + (ok ? '' : ' -> got ' + JSON.stringify(a) + ' want ' + JSON.stringify(b))); if (!ok) fails++; };
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
||||
const B = 'http://127.0.0.1:' + PORT, ORG = { Origin: 'http://127.0.0.1:' + PORT };
|
||||
const DAY = 86400000, ctDay = t => new Date(t).toLocaleDateString('en-CA', { timeZone: 'America/Chicago' });
|
||||
|
||||
// ---- the stub InstantAdPay: pass flags per member, polgrant answers allowed = pol, credits once per ref
|
||||
const PASS = { 102: true }; const creditCalls = []; const granted = new Map();
|
||||
const stub = http.createServer((req, res) => { let raw = ''; req.on('data', c => raw += c); req.on('end', () => {
|
||||
const u = new URL(req.url, 'http://x'); const send = (c, o) => { res.writeHead(c, { 'Content-Type': 'application/json' }); res.end(JSON.stringify(o)); };
|
||||
if (req.method === 'GET') { const m = Number(u.searchParams.get('m')); return send(200, { ok: true, memberId: m, pass: { active: !!PASS[m], until: PASS[m] ? Date.now() + 7 * DAY : null } }); }
|
||||
const sig = crypto.createHmac('sha256', SECRET).update(req.headers['x-game-ts'] + '\n' + raw).digest('hex');
|
||||
if (sig !== req.headers['x-game-sig']) return send(401, { error: 'bad signature' });
|
||||
const b = JSON.parse(raw);
|
||||
if (u.pathname === '/api/partner/credits') { creditCalls.push(b); if (granted.has(b.ref)) return send(200, { ok: true, repeat: true, credits: granted.get(b.ref) }); granted.set(b.ref, b.credits); return send(200, { ok: true, credits: b.credits }); }
|
||||
if (u.pathname === '/api/partner/polgrant') return send(200, { allowed: b.pol, deferred: 0, carried: 0, pass: !!PASS[b.memberId], day: ctDay(Date.now()) });
|
||||
send(404, { error: 'no' });
|
||||
}); });
|
||||
|
||||
let child; const jars = {};
|
||||
const call = async (who, p, opt = {}) => {
|
||||
const res = await fetch(B + p, Object.assign({ redirect: 'manual' }, opt, { headers: Object.assign({ Cookie: jars[who] || '', 'Content-Type': 'application/json' }, opt.headers || {}) }));
|
||||
const sc = res.headers.get('set-cookie'); if (sc && /ph\.sid=/.test(sc)) jars[who] = sc.split(';')[0];
|
||||
let body = null; try { body = await res.json(); } catch (e) {} return { status: res.status, body };
|
||||
};
|
||||
const admin = (p, body) => call('admin', p, { method: body ? 'POST' : 'GET', body: body ? JSON.stringify(body) : undefined, headers: { 'X-Admin-Key': 'adminkey123' } });
|
||||
const mission = (id, extra) => admin('/api/admin/mission', Object.assign({ id, site: 'Site ' + id.toUpperCase(), name: 'Find ' + id, brief: 'x', url: B + '/index.html', dwell: 5, slots: 1 }, extra || {}));
|
||||
const PF = path.join(DIR, 'payouts.json');
|
||||
const readP = () => { try { return JSON.parse(fs.readFileSync(PF, 'utf8')); } catch (e) { return []; } };
|
||||
const writeP = all => fs.writeFileSync(PF, JSON.stringify(all));
|
||||
// a past find, written straight onto the ledger (history the hunter already has)
|
||||
const past = (memberId, missionId, daysAgo, wallet) => { const all = readP(); const at = Date.now() - daysAgo * DAY; all.push({ id: 'h' + memberId + missionId + daysAgo, memberId, wallet, missionId, site: 'Site ' + missionId.toUpperCase(), pol: 0.05, day: ctDay(at), at, status: 'paid' }); writeP(all); };
|
||||
// move a member's finds of a mission to yesterday (so the once-a-day rule does not hide what the rotation does)
|
||||
const toYesterday = (memberId, missionId) => { const all = readP(); for (const p of all) if (p.memberId === memberId && p.missionId === missionId) p.day = ctDay(Date.now() - DAY); writeP(all); };
|
||||
// a real find: start, wait the dwell, read the code from the embed, submit
|
||||
async function find(who, missionId) {
|
||||
const st = await call(who, '/api/my/start', { method: 'POST', body: JSON.stringify({ missionId }) }); if (st.status !== 200) return st;
|
||||
await sleep(5300); const code = await (await fetch(B + '/api/embed/code?t=' + st.body.token, { headers: ORG })).json();
|
||||
return call(who, '/api/my/submit', { method: 'POST', body: JSON.stringify({ token: st.body.token, code: code.code }) });
|
||||
}
|
||||
const signIn = (who, memberId, pass) => call(who, '/auth?t=' + sso.mint({ memberId, email: 'h' + memberId + '@example.com', wallet: '0x' + String(memberId).padStart(40, '0'), username: 'hunter' + memberId, gamePass: { active: !!pass, until: pass ? Date.now() + 7 * DAY : null } }));
|
||||
let sso;
|
||||
|
||||
(async () => {
|
||||
await new Promise(r => stub.listen(0, '127.0.0.1', r));
|
||||
const env = Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DIR, HUNT_SSO_SECRET: SECRET, ADMIN_KEY: 'adminkey123', SIGNUPS: 'open', SITE_URL: B, GAMEPASS: 'on', IAP_URL: 'http://127.0.0.1:' + stub.address().port });
|
||||
delete env.CURTAIN; delete env.OUTBOUND; delete env.HUNT_WALLET_KEY; delete env.HUNT_RPC;
|
||||
child = spawn(process.execPath, [path.join(__dirname, '..', 'server.js')], { env, stdio: ['ignore', 'pipe', 'pipe'] });
|
||||
child.stderr.on('data', d => process.stderr.write(d));
|
||||
for (let i = 0; i < 120; i++) { try { await fetch(B + '/health'); break; } catch (e) { await sleep(500); } }
|
||||
process.env.HUNT_SSO_SECRET = SECRET; sso = require('../lib/sso');
|
||||
|
||||
for (const id of ['a', 'b', 'c']) await mission(id);
|
||||
await signIn('free', 101, false); await signIn('pass', 102, true);
|
||||
|
||||
// ---- limits unchanged: the free tier is 1 a day, the Game Pass 3 + 2 = 5, rotation on by default
|
||||
let bf = await call('free', '/api/my/board'), bp = await call('pass', '/api/my/board');
|
||||
eq([bf.body.daily.limit, bp.body.daily.limit, bf.body.tour.on, bf.body.tour.total, bf.body.tour.done, bf.body.tour.round], [1, 5, true, 3, 0, 1], 'limits unchanged (free 1, Pass 5); rotation on; tour 0 of 3, round 1');
|
||||
eq(bf.body.tour.left.slice().sort(), ['Site A', 'Site B', 'Site C'], 'the board lists the sites left this round by name');
|
||||
await admin('/api/admin/settings', { freeMissionsPerDay: 10 }); // room for several finds in one test day (restored below)
|
||||
|
||||
// ---- discovery pays POL for a free member
|
||||
let r = await find('free', 'a');
|
||||
eq([r.status, r.body.pol >= 0.02 && r.body.pol <= 0.1, !!r.body.tourStop], [200, true, false], 'free member, first find of a mission: POL on the free draw, not a tour stop');
|
||||
bf = await call('free', '/api/my/board');
|
||||
eq([bf.body.tour.done, bf.body.tour.left.includes('Site A'), bf.body.missions.find(m => m.id === 'a').done], [1, false, true], 'round progress: 1 of 3, Site A off the list, shown as done today');
|
||||
|
||||
// ---- the start gate: found earlier in this round = refused, even on a new day
|
||||
toYesterday(101, 'a');
|
||||
r = await call('free', '/api/my/start', { method: 'POST', body: JSON.stringify({ missionId: 'a' }) });
|
||||
eq([r.status, r.body.tour], [400, true], 'a mission found earlier this round cannot be started again (rotation)');
|
||||
bf = await call('free', '/api/my/board'); eq(bf.body.missions.map(m => m.id).includes('a'), false, 'and the board does not offer it');
|
||||
|
||||
// ---- a paused mission is skipped and never blocks the round; finishing the rest closes it
|
||||
const ms = (await admin('/api/admin/state')).body.missions; const mc = ms.find(m => m.id === 'c');
|
||||
await mission('c', { active: false, dwell: mc.dwell, slots: mc.slots });
|
||||
bf = await call('free', '/api/my/board'); eq([bf.body.tour.total, bf.body.tour.left], [2, ['Site B']], 'paused mission c is out of the round: 1 of 2, only Site B left');
|
||||
r = await find('free', 'b');
|
||||
eq([r.status, r.body.round, r.body.unlocked.includes('sweep')], [200, 1, true], 'finishing the round: round 1 closed, Full Network Tour celebrated');
|
||||
bf = await call('free', '/api/my/board');
|
||||
eq([bf.body.tour.round, bf.body.tour.rounds, bf.body.tour.done, bf.body.badges.some(b => b.id === 'sweep' && b.name === 'Full Network Tour')], [2, 1, 0, true], 'reset: round 2 starts at 0, the badge reads Full Network Tour');
|
||||
|
||||
// ---- a mission added (or back) mid-round joins as not done, never-visited first
|
||||
await mission('c', { active: true });
|
||||
bf = await call('free', '/api/my/board');
|
||||
eq([bf.body.tour.total, bf.body.missions[0].id, bf.body.missions[0].fresh], [3, 'c', true], 'mission c back mid-round: part of round 2, offered first as never visited');
|
||||
eq(bf.body.tour.toured, false, 'not toured yet: c was never found');
|
||||
r = await find('free', 'c');
|
||||
eq([r.status, r.body.pol > 0, !!r.body.tourStop], [200, true, false], 'a mission new to this free member pays POL on the first find');
|
||||
bf = await call('free', '/api/my/board');
|
||||
eq([bf.body.tour.toured, bf.body.tour.free, bf.body.missions.filter(m => !m.done).every(m => m.tourStop && m.tourStop.credits === 10)], [true, true, true], 'every active mission found once: toured; the open cards read as tour stops worth 10 credits');
|
||||
|
||||
// ---- after the full tour a free member's repeat is a tour stop: credits, not POL; capped at the daily max
|
||||
toYesterday(101, 'b');
|
||||
const before = creditCalls.length;
|
||||
r = await find('free', 'a');
|
||||
eq([r.status, r.body.pol, r.body.tourStop && r.body.tourStop.credits, /Tour stop/.test(r.body.message)], [200, 0, 10, true], 'repeat after the full tour: a tour stop, 0 POL, +10 ad credits');
|
||||
await sleep(400);
|
||||
const stopRow = readP().find(p => p.memberId === 101 && p.tourStop);
|
||||
eq([creditCalls.length - before, creditCalls.at(-1) && creditCalls.at(-1).credits, creditCalls.at(-1) && creditCalls.at(-1).ref, stopRow.status, stopRow.pol, stopRow.tourStop.state], [1, 10, 'tour:' + stopRow.id, 'tour', 0, 'sent'], 'one signed credits call, ref tour:<row id>, row is a 0 POL tour stop marked sent');
|
||||
eq(readP().filter(p => p.memberId === 101 && p.missionId === 'a').map(p => p.status), ['due', 'tour'], 'mission a: the discovery drip (due) and the tour stop, no second POL drip');
|
||||
r = await find('free', 'b');
|
||||
eq([r.status, r.body.pol, r.body.tourStop.credits, r.body.round], [200, 0, 0, 2], 'second tour stop the same day: credits capped at the daily max (0 more), and it closes round 2');
|
||||
await sleep(300); eq(creditCalls.length - before, 1, 'no credits call for a capped stop');
|
||||
// idempotent on ref: a stop sent again (a retry) is answered as a repeat and never granted twice
|
||||
{ process.env.GAMEPASS = 'on'; const store = require('../lib/store'); store.init(DIR); const gp = require('../lib/polgrant'); const rot = require('../lib/rotation');
|
||||
gp.use({ game: 'polhunter', secret: SECRET, iap: 'http://127.0.0.1:' + stub.address().port, store });
|
||||
rot.markStop(stopRow.id, { state: 'due' }); const again = await rot.deliver(readP().find(p => p.id === stopRow.id), gp);
|
||||
eq([again.tourStop.state, granted.get('tour:' + stopRow.id), [...granted.values()].reduce((a, b) => a + b, 0)], ['sent', 10, 10], 'a retried stop reuses its ref: 10 credits granted once in total');
|
||||
const capped = rot.tourStop({ memberId: 101, email: 'h101@example.com', wallet: '0x' + '101'.padStart(40, '0') }, { id: 'zz', site: 'Z' });
|
||||
eq([capped.tourStop.credits, capped.tourStop.state], [0, 'none'], 'the daily max holds at the library too (10 already granted today)'); }
|
||||
|
||||
// ---- a newly added mission pays POL again to a toured free member, once
|
||||
await mission('d');
|
||||
bf = await call('free', '/api/my/board'); eq([bf.body.tour.toured, bf.body.missions[0].id], [false, 'd'], 'new mission d: no longer toured, d offered first');
|
||||
r = await find('free', 'd'); eq([r.status, r.body.pol > 0, !!r.body.tourStop], [200, true, false], 'the new mission pays POL on the first find');
|
||||
|
||||
// ---- never visited first, then least recently found (member 103, history only)
|
||||
past(103, 'a', 4, '0x' + '103'.padStart(40, '0')); past(103, 'b', 3, '0x' + '103'.padStart(40, '0')); past(103, 'c', 2, '0x' + '103'.padStart(40, '0')); past(103, 'd', 5, '0x' + '103'.padStart(40, '0'));
|
||||
await signIn('h103', 103, true); await call('h103', '/api/my/board'); await mission('e');
|
||||
const b3 = await call('h103', '/api/my/board');
|
||||
eq([b3.body.tour.rounds, b3.body.missions.map(m => m.id)], [1, ['e', 'd', 'a', 'b', 'c']], 'a whole history closes round 1; round 2 order: never visited (e), then least recently found (d, a, b, c)');
|
||||
|
||||
// ---- Game Pass holders unchanged: a repeat pays POL on the full draw
|
||||
past(102, 'a', 3, '0x' + '102'.padStart(40, '0')); past(102, 'b', 3, '0x' + '102'.padStart(40, '0')); past(102, 'c', 3, '0x' + '102'.padStart(40, '0')); past(102, 'd', 3, '0x' + '102'.padStart(40, '0')); past(102, 'e', 3, '0x' + '102'.padStart(40, '0'));
|
||||
r = await find('pass', 'a');
|
||||
eq([r.status, r.body.pol >= 0.05 && r.body.pol <= 1, !!r.body.tourStop], [200, true, false], 'Game Pass holder repeat: POL on the full draw, never a tour stop');
|
||||
|
||||
// ---- rotation off: everything is offered again (the old board), the badge stays
|
||||
toYesterday(101, 'd'); const on1 = await call('free', '/api/my/board');
|
||||
await admin('/api/admin/settings', { rotationOn: 0 });
|
||||
bf = await call('free', '/api/my/board'); eq([on1.body.missions.some(m => m.id === 'd'), bf.body.tour.on, bf.body.missions.some(m => m.id === 'd' && !m.done)], [false, true && false, true], 'rotationOn 0: no progress panel, a mission found this round is offered again');
|
||||
await admin('/api/admin/settings', { rotationOn: 1, freeMissionsPerDay: 1 });
|
||||
bf = await call('free', '/api/my/board'); eq(bf.body.daily.limit, 1, 'free tier back to 1 a day');
|
||||
|
||||
// ---- admin: round stats per hunter
|
||||
const av = await admin('/api/admin/rotation'); const h101 = av.body.hunters.find(h => h.memberId === 101);
|
||||
eq([av.status, h101.rounds, av.body.settings.credits, av.body.settings.dailyMax, av.body.tourStops.creditsSent], [200, 2, 10, 10, 10], 'admin: rounds per hunter, settings 10 / 10, 10 credits sent');
|
||||
|
||||
console.log(fails ? '\nFAILURES: ' + fails : '\nALL ROTATION CHECKS PASS');
|
||||
child.kill(); stub.close(); fs.rmSync(DIR, { recursive: true, force: true }); process.exit(fails ? 1 : 0);
|
||||
})().catch(e => { console.error('CRASH', e); if (child) child.kill(); process.exit(1); });
|
||||
+2
-1
@@ -24,7 +24,8 @@ const admin = (p, opt = {}) => call(p, Object.assign(opt, { headers: { 'X-Admin-
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
||||
|
||||
(async () => {
|
||||
await sleep(1200);
|
||||
// wait for the server to listen (a busy machine can take well over a second to load ethers)
|
||||
for (let i = 0; i < 120; i++) { try { await fetch(B + '/health'); break; } catch (e) { await sleep(500); } }
|
||||
process.env.HUNT_SSO_SECRET = env.HUNT_SSO_SECRET; const sso = require('../lib/sso');
|
||||
const h = await call('/health'); eq([h.body.outbound, h.body.signups, h.body.faucet, h.body.sso], [false, true, false, true], 'posture: outbound off, signups open, faucet off, sso on');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user