Gem Kingdom Royal Charter: /gk/shop charges a paidOnly order from purchased credits only (never the earned pool); chatbot and promo copy carry the new ladder (guests chapters 1-2, free account for 3, $5 Charter for 4-6, taste rewards then Charter-only rewards capped at what the player paid in)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-02 11:27:00 -06:00
parent 4bcc867679
commit ae3a08b991
4 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -3964,7 +3964,8 @@ const server = http.createServer(async (req, res) => {
if (prev && (prev.status === 'paid' || (prev.status === 'paying' && Date.now() - prev.ts < 60000))) { res.writeHead(302, { Location: '/gk/shop?t=' + encodeURIComponent(t) }); return res.end(); }
gkOrders.set(c.order, { status: 'paying', email: s.email, ts: Date.now() });
const { ids } = await myMemberIds(s);
const out = await ads.gamePurchase(s.email, ids, c.credits, 'Gem Kingdom: ' + c.crowns + ' Crowns', GK_URL());
// paidOnly (Royal Charter, 2026-11-02): purchased credits only, the earned viewing pool is never touched, so a Charter is always real money
const out = await ads.gamePurchase(s.email, ids, c.credits, 'Gem Kingdom: ' + (c.paidOnly ? String(c.label || 'Royal Charter') : c.crowns + ' Crowns'), GK_URL(), c.paidOnly ? { purchasedOnly: true } : undefined);
if (out.error) { gkOrders.delete(c.order); if (out.error === 'short') { res.writeHead(302, { Location: '/gk/shop?t=' + encodeURIComponent(t) }); return res.end(); } return gkPage(res, 500, 'Order problem', '<h1>Something went wrong</h1><p class="sub">' + gkEsc(out.error) + '</p>'); }
gkOrders.set(c.order, { status: 'paid', email: s.email, campaignId: out.campaignId, paid: out.paid, ts: Date.now() });
console.log('gemkingdom crowns', s.email, c.crowns, 'for', c.credits, 'credits (' + out.paid + ' purchased), campaign', out.campaignId);