Major update 2 / login

This commit is contained in:
2026-04-26 16:33:04 +03:00
parent 5bff9a287d
commit e8fd35105f
15 changed files with 999 additions and 96 deletions

View File

@@ -10,7 +10,7 @@ async function pollAndExecute() {
let cmdData;
try {
const res = await fetch(`${BASE_URL}/api/commands/pending?player_id=${player_id}`);
const res = await apiFetch(`${BASE_URL}/api/commands/pending?player_id=${player_id}`);
cmdData = await res.json();
} catch (e) {
log(`Poll failed: ${e}`);
@@ -114,7 +114,7 @@ async function pollAndExecute() {
if (allFull) {
log('⚠️ Auto-farm: ALL warehouses are full (>95%) — skipping loot this cycle');
try {
await fetch(`${BASE_URL}/api/farm_status?player_id=${uw.Game.player_id}`, {
await apiFetch(`${BASE_URL}/api/farm_status?player_id=${uw.Game.player_id}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ warehouse_full: true })
@@ -122,7 +122,7 @@ async function pollAndExecute() {
} catch (e) {}
} else if (claimedAny) {
try {
await fetch(`${BASE_URL}/api/farm_status?player_id=${uw.Game.player_id}`, {
await apiFetch(`${BASE_URL}/api/farm_status?player_id=${uw.Game.player_id}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ warehouse_full: false })