@0xlimo/paygate
Switched off on 0x.limox1-paygate lets only owners into a paid game's hosted site and hosted server. It is in the SDK source, but not published to the registry and not deployed on 0x.limo.
Not published, not deployed
@0xlimo/paygate 0.1.0 is in the SDK source (packages/paygate), but it is not published to
the 0x registry, and it is not running on 0x.limo. The front does not route hosted sites
through it, and x1-host has no paygate configured. What follows is how paid games will behave
when it is switched on. One part is already live: a paid game's new versions are built
origin-only, with no swarm.
You do not install or call x1-paygate yourself. It sits in front of the hosting service. What matters to you as a developer is how a paid game's site and server behave for players.
#What players see
The launcher opens a paid game with
?x1_play=<play ticket>. Only owners get a ticket (POST /v1/apps/<appid>/play-ticket). Tickets last 5 minutes.The gate checks the ticket, then sets two cookies with a signed pass that lasts 12 h:
x1_passwithPath=/sites/<site>/x1_passwithPath=/x1/game/<site>/
Both are
HttpOnly; Secure; SameSite=None; Partitioned. The gate then redirects to the same URL withoutx1_play.Every file of the site needs the pass, not only
index.html. Without one the answer is402with a "Buyon 0x" page linking to the store. A bad or expired ticket gets 403with the same page.A browser sends the
/x1/game/<site>/pass with the game's own HTTP and WebSocket requests, so@0xlimo/netand the templates need no change.A game client without the browser's cookies, such as a native client, connects with
?x1_play=<ticket>. x1-host removes the parameter before your server sees the request.
#What changes for a paid game's site
- No swarm. New versions are built origin-only:
x1.jsonis{"swarm": false}and there is noswarm/manifest. The seeder skips paid sites. The gate also answersx1.jsonwith{"swarm": false}andswarm/*with404for versions built before the game had a price. - Private caching. Paid sites get
Cache-Control: private, so a shared cache does not keep them. Purge/sites/<site>/*at the CDN when a free game gets a price.
#Subscription-only games
The sites of subscription-only games are gated the same way. Only players with an active
subscription get a play ticket, the refusal page says "Subscribe to
#Limits
- A pass lasts 12 h, so a refund or revoked entitlement takes effect when it expires, not at once.
- Anyone holding a ticket can exchange it during its 5 minutes. It is removed from the address at once.
- The pass relies on partitioned cookies (CHIPS) in the store's iframe. A browser that refuses even partitioned cookies in a frame shows the buy page to owners too.
The module's exports are listed in the reference.
