monday
All checks were successful
Build / build (18) (push) Successful in 1m29s
Build / build (18) (pull_request) Successful in 1m8s
Build / build (20) (push) Successful in 1m7s
Build / build (22) (push) Successful in 38s
Build / build (20) (pull_request) Successful in 37s
Build / build (22) (pull_request) Successful in 1m18s

This commit is contained in:
Sainan 2025-03-22 21:46:25 +01:00
parent 4e011e1ed4
commit 18062b5d91

View File

@ -13,10 +13,13 @@ export const entratiLabConquestModeController: RequestHandler = async (req, res)
const body = getJSONfromString<IEntratiLabConquestModeRequest>(String(req.body)); const body = getJSONfromString<IEntratiLabConquestModeRequest>(String(req.body));
if (body.BuyMode) { if (body.BuyMode) {
if (!inventory.EntratiVaultCountResetDate || Date.now() >= inventory.EntratiVaultCountResetDate.getTime()) { if (!inventory.EntratiVaultCountResetDate || Date.now() >= inventory.EntratiVaultCountResetDate.getTime()) {
const thisWeek = Math.trunc(Date.now() / 604800000) * 604800000; const EPOCH = 1734307200 * 1000; // Mondays, amirite?
const nextWeek = thisWeek + 604800000; const day = Math.trunc((Date.now() - EPOCH) / 86400000);
const week = Math.trunc(day / 7);
const weekStart = EPOCH + week * 604800000;
const weekEnd = weekStart + 604800000;
inventory.EntratiVaultCountLastPeriod = 0; inventory.EntratiVaultCountLastPeriod = 0;
inventory.EntratiVaultCountResetDate = new Date(nextWeek); inventory.EntratiVaultCountResetDate = new Date(weekEnd);
if (inventory.EntratiLabConquestUnlocked) { if (inventory.EntratiLabConquestUnlocked) {
inventory.EntratiLabConquestUnlocked = 0; inventory.EntratiLabConquestUnlocked = 0;
} }