push
This commit is contained in:
@@ -145,6 +145,77 @@ const PRODUCTS = [
|
||||
sortOrder: 90,
|
||||
metaJson: JSON.stringify({ cooldownMs: 60000, maxDurationMs: 5000 }),
|
||||
},
|
||||
// ── Cosmetics: IP color + send button skins ──────────────────────────────
|
||||
{
|
||||
id: "ip-colors",
|
||||
category: "cosmetiques",
|
||||
name: "Palette IP",
|
||||
subtitle: "Personnalise la couleur de ton adresse IP dans le chat",
|
||||
kind: "unlock",
|
||||
basePrice: 299,
|
||||
sortOrder: 46,
|
||||
metaJson: JSON.stringify({}),
|
||||
},
|
||||
{
|
||||
id: "send-skin-honker",
|
||||
category: "cosmetiques",
|
||||
name: "Doigt d'honneur",
|
||||
subtitle: "Bouton d'envoi qui exprime tout",
|
||||
kind: "send-skin",
|
||||
basePrice: 149,
|
||||
sortOrder: 47,
|
||||
metaJson: JSON.stringify({ char: "🖕", label: "Doigt d'honneur" }),
|
||||
},
|
||||
{
|
||||
id: "send-skin-skull",
|
||||
category: "cosmetiques",
|
||||
name: "Crâne",
|
||||
subtitle: "Envoyer avec style... macabre",
|
||||
kind: "send-skin",
|
||||
basePrice: 149,
|
||||
sortOrder: 48,
|
||||
metaJson: JSON.stringify({ char: "💀", label: "Crâne" }),
|
||||
},
|
||||
{
|
||||
id: "send-skin-rocket",
|
||||
category: "cosmetiques",
|
||||
name: "Fusée",
|
||||
subtitle: "Tes messages décollent",
|
||||
kind: "send-skin",
|
||||
basePrice: 149,
|
||||
sortOrder: 49,
|
||||
metaJson: JSON.stringify({ char: "🚀", label: "Fusée" }),
|
||||
},
|
||||
{
|
||||
id: "send-skin-ghost",
|
||||
category: "cosmetiques",
|
||||
name: "Fantôme",
|
||||
subtitle: "Boo !",
|
||||
kind: "send-skin",
|
||||
basePrice: 149,
|
||||
sortOrder: 50,
|
||||
metaJson: JSON.stringify({ char: "👻", label: "Fantôme" }),
|
||||
},
|
||||
{
|
||||
id: "send-skin-bomb",
|
||||
category: "cosmetiques",
|
||||
name: "Bombe",
|
||||
subtitle: "Message explosif",
|
||||
kind: "send-skin",
|
||||
basePrice: 149,
|
||||
sortOrder: 51,
|
||||
metaJson: JSON.stringify({ char: "💣", label: "Bombe" }),
|
||||
},
|
||||
{
|
||||
id: "send-skin-sword",
|
||||
category: "cosmetiques",
|
||||
name: "Épée",
|
||||
subtitle: "Tranche le silence",
|
||||
kind: "send-skin",
|
||||
basePrice: 149,
|
||||
sortOrder: 52,
|
||||
metaJson: JSON.stringify({ char: "⚔️", label: "Épée" }),
|
||||
},
|
||||
] as const;
|
||||
|
||||
// ── Ad inventory (the 4 hardcoded joke ads, now real data) ──────────────────
|
||||
|
||||
@@ -163,7 +163,7 @@ export async function purchase(
|
||||
if ((await countActiveEntitlements(ip, product.id)) >= 1)
|
||||
throw new PurchaseError("Déjà débloqué", 409);
|
||||
grants.push({ kind: product.id });
|
||||
if (product.id === "element-skin") visiblePerkChanged = false; // viewer-scoped
|
||||
if (product.id === "element-skin" || product.id === "ip-colors") visiblePerkChanged = false; // viewer-scoped
|
||||
break;
|
||||
}
|
||||
case "consumable": {
|
||||
@@ -176,6 +176,14 @@ export async function purchase(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "send-skin": {
|
||||
if ((await countActiveEntitlements(ip, product.id)) >= 1)
|
||||
throw new PurchaseError("Déjà débloqué", 409);
|
||||
let skinMeta: any = {};
|
||||
try { skinMeta = product.metaJson ? JSON.parse(product.metaJson) : {}; } catch {}
|
||||
grants.push({ kind: product.id, meta: skinMeta });
|
||||
break;
|
||||
}
|
||||
case "bundle": {
|
||||
// Cosmetic bundle: Style Doré + 1 pet.
|
||||
if ((await countActiveEntitlements(ip, "style-dore")) < 1)
|
||||
|
||||
Reference in New Issue
Block a user