Off unless the page is built with MP_API set (MP_API=/api/mp npm run build): a plain build has no door, no chip and makes no requests. The session server is scripts/mp-server.js (npm run mp), plain node:http, which can also serve the built site so one process sits behind the reverse proxy; docs/MULTIPLAYER.md has the nginx and Caddy setups. A session has a six-character code, one seed and one rules preset, so every player starts in the same world, and up to twelve players with their own AS numbers. Saves go to the server on a new game day at most every 15 s and when the page hides, ordered by a sequence number (409 on a stale push, and the player picks which one to keep). Tokens live in localStorage, never in the save; the server keeps only their hash. A #mp= link moves a network to another device. The session panel shows the leaderboard, the feed and a short chat; each player's public card (tier, POPs, links, exchanges, transit, peak, customers, score) carries what in-game peering between players will need next. Server limits: body sizes, one upload per player, uploads per address and in total, sessions per hour, wrong-code lockout; addresses counted per IPv6 /64, X-Forwarded-For only with --trust-proxy.
26 lines
2 KiB
JavaScript
26 lines
2 KiB
JavaScript
/* ================= ANALYTICS (ridiculytics) =================
|
|
Off unless ANALYTICS.host is set. Fill in your collector when you self-host the game.
|
|
Inside the claude.ai viewer outside requests are blocked, so it only reports from your own domain. */
|
|
const APP_VERSION='__VERSION__';
|
|
// Filled in by scripts/build.sh from CHANGELOG.md for this version.
|
|
const RELEASE_NOTES=/*__RELEASE_NOTES__*/[];
|
|
// A big release's story, shown in full in "What's new" (paragraphs; **bold** allowed). Empty for most releases.
|
|
const RELEASE_STORY=/*__RELEASE_STORY__*/[];
|
|
const IS_DEV=APP_VERSION.startsWith('__');
|
|
// Multiplayer (docs/MULTIPLAYER.md): the path of a self-hosted copy's session server, stamped by MP_API=/api/mp npm run build.
|
|
// Empty, as in every plain build (and on seriesoftub.es), multiplayer stays off: no door, no requests.
|
|
const MP_API=/*__MP_API__*/'';
|
|
// Only report from the real site; previews, localhost and the Claude viewer stay silent.
|
|
const ANALYTICS={host:/(^|\.)seriesoftub\.es$/.test(location.hostname)&&!/[?&]noc=/.test(location.search)?'https://stats.seriesoftub.es':'',site:'seriesoftub.es'};
|
|
(function(){
|
|
try{
|
|
window.ridiculytics=window.ridiculytics||function(){const q=window.ridiculytics.q=window.ridiculytics.q||[];if(q.length<100)q.push(arguments);};
|
|
if(!ANALYTICS.host)return;
|
|
const sc=document.createElement('script');sc.defer=true;sc.src='https://cdn.jsdelivr.net/npm/ridiculytics@1.0.1/web/counter.min.js';
|
|
sc.setAttribute('data-host',ANALYTICS.host);if(ANALYTICS.site)sc.setAttribute('data-site',ANALYTICS.site);sc.setAttribute('data-spa','false');sc.integrity='sha384-uNCU8e2RB7Yn6lVNut2gupQsJwKwXPZu2i4t/Eg6Q59ki0kchBR4L4yoS3ZxxjEX';sc.crossOrigin='anonymous';sc.referrerPolicy='no-referrer';
|
|
document.head.appendChild(sc);
|
|
}catch(e){}
|
|
})();
|
|
const TRACKED=new Set();
|
|
function track(name,once){if(!ANALYTICS.host)return;if(once){if(TRACKED.has(name))return;TRACKED.add(name);}try{window.ridiculytics(name);}catch(e){}}
|
|
const PLAY_MARKS=[1,5,15,30,60,120];
|