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:
+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 };
|
||||
|
||||
Reference in New Issue
Block a user