Private
Public Access
1
0

Adding repo after 2 days of vibecoding

This commit is contained in:
gauvainboiche
2026-03-29 11:16:46 +02:00
commit 4eac0f4415
948 changed files with 99537 additions and 0 deletions

17
server/worldSeed.js Normal file
View File

@@ -0,0 +1,17 @@
/**
* One world seed per UTC-aligned period: floor(utcUnixSeconds / rotationSeconds).
* Changing the slot triggers a full grid wipe on the server.
*/
export function computeWorldSeedState(rotationSeconds) {
const rot = Math.max(60, Math.floor(rotationSeconds));
const nowSec = Math.floor(Date.now() / 1000);
const slot = Math.floor(nowSec / rot);
const periodStart = slot * rot;
const periodEnd = periodStart + rot;
return {
worldSeed: `swg-${slot}`,
seedSlot: slot,
seedPeriodEndsAtUtc: new Date(periodEnd * 1000).toISOString(),
seedPeriodStartsAtUtc: new Date(periodStart * 1000).toISOString(),
};
}