fix ?
This commit is contained in:
@@ -446,7 +446,7 @@
|
||||
fetch('/dashboard/farm-settings', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ player_id: PLAYER_ID, enabled, loot_option: selectedOption })
|
||||
body: JSON.stringify({ player_id: PLAYER_ID, world_id: WORLD_ID, enabled, loot_option: selectedOption })
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(() => {
|
||||
@@ -458,7 +458,7 @@
|
||||
|
||||
// -- Load current settings --
|
||||
function loadSettings() {
|
||||
fetch(`/dashboard/farm-settings?player_id=${PLAYER_ID}`)
|
||||
fetch(`/dashboard/farm-settings?player_id=${PLAYER_ID}&world_id=${WORLD_ID}`)
|
||||
.then(r => r.json())
|
||||
.then(cfg => {
|
||||
document.getElementById('farm-enabled').checked = cfg.enabled;
|
||||
@@ -564,7 +564,7 @@
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
player_id: PLAYER_ID,
|
||||
town_id: 0,
|
||||
town_id: WORLD_ID ? `0_${WORLD_ID}` : "0",
|
||||
type: 'farm_upgrade',
|
||||
payload: { threshold: threshold, action_type: actionType }
|
||||
})
|
||||
@@ -591,7 +591,7 @@
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
player_id: PLAYER_ID,
|
||||
town_id: 0,
|
||||
town_id: WORLD_ID ? `0_${WORLD_ID}` : "0",
|
||||
type: 'farm_loot',
|
||||
payload: { loot_option: selectedOption }
|
||||
})
|
||||
@@ -617,7 +617,7 @@
|
||||
fetch('/dashboard/bootcamp-attack-now', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ player_id: PLAYER_ID })
|
||||
body: JSON.stringify({ player_id: PLAYER_ID, world_id: WORLD_ID })
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(() => {
|
||||
@@ -633,7 +633,7 @@
|
||||
|
||||
async function checkWarehouseStatus() {
|
||||
try {
|
||||
const res = await fetch(`/api/farm_status?player_id=${PLAYER_ID}`);
|
||||
const res = await fetch(`/api/farm_status?player_id=${PLAYER_ID}&world_id=${WORLD_ID}`);
|
||||
const data = await res.json();
|
||||
const banner = document.getElementById('warehouse-full-banner');
|
||||
if (banner) banner.style.display = data.warehouse_full ? 'flex' : 'none';
|
||||
@@ -651,7 +651,7 @@
|
||||
}
|
||||
|
||||
function loadBotSettings() {
|
||||
fetch(`/dashboard/bot-settings?player_id=${PLAYER_ID}`)
|
||||
fetch(`/dashboard/bot-settings?player_id=${PLAYER_ID}&world_id=${WORLD_ID}`)
|
||||
.then(r => r.json())
|
||||
.then(cfg => {
|
||||
document.getElementById('bootcamp-enabled').checked = !!cfg.bootcamp_enabled;
|
||||
@@ -669,6 +669,7 @@
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
player_id: PLAYER_ID,
|
||||
world_id: WORLD_ID,
|
||||
bootcamp_enabled: document.getElementById('bootcamp-enabled').checked,
|
||||
bootcamp_use_def: document.getElementById('bootcamp-use-def').checked,
|
||||
rural_trade_enabled: document.getElementById('rural-trade-enabled').checked,
|
||||
@@ -708,9 +709,9 @@
|
||||
}
|
||||
|
||||
function loadBotLogs() {
|
||||
fetch(`/dashboard/bot-logs?player_id=${PLAYER_ID}&feature=bootcamp`)
|
||||
fetch(`/dashboard/bot-logs?player_id=${PLAYER_ID}&world_id=${WORLD_ID}&feature=bootcamp`)
|
||||
.then(r => r.json()).then(data => renderBotLog('bootcamp-log', data));
|
||||
fetch(`/dashboard/bot-logs?player_id=${PLAYER_ID}&feature=rural_trade`)
|
||||
fetch(`/dashboard/bot-logs?player_id=${PLAYER_ID}&world_id=${WORLD_ID}&feature=rural_trade`)
|
||||
.then(r => r.json()).then(data => renderBotLog('rural-trade-log', data));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user