Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
48890f96b4
|
|||
|
5e663c68be
|
|||
| 759a1a4089 | |||
| 9e76165638 | |||
| 1865a385ad | |||
|
b9e0cccfe1
|
|||
|
934581772d
|
|||
|
7c8dd807da
|
|||
|
8c816e2e6b
|
|||
|
cc51e1c9a7
|
|||
|
ae5105f40e
|
|||
|
4a9b9dd40b
|
+21
-11
@@ -712,23 +712,32 @@ def newserv_account_lock_acquire():
|
||||
"lock": lock_row_payload(row),
|
||||
})
|
||||
|
||||
if row["holder_source"] != source:
|
||||
return jsonify({
|
||||
"ok": False,
|
||||
"message": f"$C6Account is already active\\non {row['holder_source']}.",
|
||||
"holder_source": row["holder_source"],
|
||||
"state": row["state"],
|
||||
"lock": lock_row_payload(row),
|
||||
})
|
||||
|
||||
sessions = row["sessions"] or {}
|
||||
if isinstance(sessions, str):
|
||||
sessions = json.loads(sessions)
|
||||
|
||||
if row["holder_source"] != source:
|
||||
target_region_current = False
|
||||
if row["state"] == "draining" and not sessions and source_region:
|
||||
_all_current, sync = account_sync_current_on_all_regions(account_id)
|
||||
region_status = (sync.get("regions") or {}).get(source_region) or {}
|
||||
target_region_current = region_status.get("status") == "current"
|
||||
|
||||
if not target_region_current:
|
||||
return jsonify({
|
||||
"ok": False,
|
||||
"message": f"$C6Account is already active\\non {row['holder_source']}.",
|
||||
"holder_source": row["holder_source"],
|
||||
"state": row["state"],
|
||||
"lock": lock_row_payload(row),
|
||||
})
|
||||
|
||||
sessions[session_nonce] = session_info
|
||||
|
||||
cur.execute("""
|
||||
UPDATE account_session_locks
|
||||
SET state = 'active',
|
||||
SET holder_source = %s,
|
||||
state = 'active',
|
||||
source_region = %s,
|
||||
source_ship = %s,
|
||||
account_store = %s,
|
||||
@@ -739,6 +748,7 @@ def newserv_account_lock_acquire():
|
||||
RETURNING account_id, holder_source, source_region, source_ship,
|
||||
account_store, state, sessions, created_at, updated_at, expires_at
|
||||
""", (
|
||||
source,
|
||||
source_region,
|
||||
source_ship,
|
||||
account_store,
|
||||
@@ -780,7 +790,7 @@ def newserv_account_lock_heartbeat():
|
||||
SET updated_at = now(),
|
||||
expires_at = %s
|
||||
WHERE holder_source = %s
|
||||
AND state IN ('active', 'draining')
|
||||
AND state = 'active'
|
||||
""", (expires_at, source))
|
||||
refreshed = cur.rowcount
|
||||
|
||||
|
||||
+26
-4
@@ -27,7 +27,7 @@
|
||||
8: { hp: 2.00, atp: 1.08, exp: 2.00 },
|
||||
9: { hp: 2.50, atp: 1.09, exp: 2.50 },
|
||||
10: { hp: 3.00, atp: 1.10, exp: 3.00 },
|
||||
11: { hp: 4.00, atp: 1.10, exp: null },
|
||||
11: { hp: 4.00, atp: 1.10, exp: 3.00 },
|
||||
};
|
||||
|
||||
const COLUMN_GROUPS = {
|
||||
@@ -148,13 +148,25 @@
|
||||
}
|
||||
|
||||
function bpTier() {
|
||||
const tier = Number(qs("#bestiary-bp-tier")?.value || 0);
|
||||
const select = qs("#bestiary-tier");
|
||||
const raw = String(select?.value || "");
|
||||
const label = String(select?.selectedOptions?.[0]?.textContent || "");
|
||||
const match = raw.match(/(\d+)$/) || label.match(/(\d+)/);
|
||||
const tier = match ? Number(match[1]) : 0;
|
||||
return BP_TIERS[tier] || BP_TIERS[0];
|
||||
}
|
||||
|
||||
function xpBonusMultiplier() {
|
||||
return Number(qs("#bestiary-xp-bonus")?.value || 1);
|
||||
}
|
||||
|
||||
function displayValue(row, key) {
|
||||
const value = row[key];
|
||||
|
||||
if (key === "exp" && row.difficulty !== "Ultimate") {
|
||||
return Math.round(Number(value || 0) * xpBonusMultiplier());
|
||||
}
|
||||
|
||||
if (row.difficulty !== "Ultimate") {
|
||||
return value ?? "";
|
||||
}
|
||||
@@ -170,16 +182,22 @@
|
||||
}
|
||||
|
||||
if (key === "exp" && tier.exp !== null) {
|
||||
return Math.round(Number(value || 0) * tier.exp);
|
||||
return Math.round(Number(value || 0) * tier.exp * xpBonusMultiplier());
|
||||
}
|
||||
|
||||
return value ?? "";
|
||||
}
|
||||
|
||||
function hasAnyBestiaryValue(row) {
|
||||
const keys = ["hp", "atp", "dfp", "mst", "ata", "evp", "lck", "esp", "exp", "efr", "eic", "eth", "elt", "edk"];
|
||||
return keys.some((key) => Number(row[key] || 0) !== 0);
|
||||
}
|
||||
|
||||
function visibleRows() {
|
||||
const search = state.filters.search.trim().toLowerCase();
|
||||
|
||||
return state.rows.filter((row) => {
|
||||
if (!hasAnyBestiaryValue(row)) return false;
|
||||
if (state.filters.mode && row.mode !== state.filters.mode) return false;
|
||||
if (state.filters.episode && row.episode !== state.filters.episode) return false;
|
||||
if (state.filters.difficulty && row.difficulty !== state.filters.difficulty) return false;
|
||||
@@ -332,11 +350,15 @@
|
||||
renderTable();
|
||||
});
|
||||
|
||||
qs("#bestiary-bp-tier")?.addEventListener("change", () => {
|
||||
qs("#bestiary-tier")?.addEventListener("change", () => {
|
||||
state.page = 1;
|
||||
renderTable();
|
||||
});
|
||||
|
||||
qs("#bestiary-xp-bonus")?.addEventListener("change", () => {
|
||||
renderTable();
|
||||
});
|
||||
|
||||
qs("#bestiary-placeholder")?.addEventListener("click", (event) => {
|
||||
const pageButton = event.target.closest("[data-bestiary-page]");
|
||||
if (pageButton) {
|
||||
|
||||
+9
-17
@@ -51,22 +51,13 @@
|
||||
<option value="">All difficulties</option>
|
||||
</select>
|
||||
|
||||
<label for="bestiary-bp-tier">BP Tier</label>
|
||||
<select id="bestiary-bp-tier">
|
||||
<option value="0">No modifier</option>
|
||||
<option value="1">Brutal Peeps +1</option>
|
||||
<option value="2">Brutal Peeps +2</option>
|
||||
<option value="3">Brutal Peeps +3</option>
|
||||
<option value="4">Brutal Peeps +4</option>
|
||||
<option value="5">Brutal Peeps +5</option>
|
||||
<option value="6">Brutal Peeps +6</option>
|
||||
<option value="7">Brutal Peeps +7</option>
|
||||
<option value="8">Brutal Peeps +8</option>
|
||||
<option value="9">Brutal Peeps +9</option>
|
||||
<option value="10">Brutal Peeps +10</option>
|
||||
<option value="11">Brutal Peeps +11</option>
|
||||
<label for="bestiary-xp-bonus">XP Bonus</label>
|
||||
<select id="bestiary-xp-bonus">
|
||||
<option value="1">No modifier</option>
|
||||
<option value="5">5x</option>
|
||||
<option value="10">10x</option>
|
||||
</select>
|
||||
<p class="drops-field-note">Applies HP, ATP, and EXP modifiers to Ultimate rows only.</p>
|
||||
<p class="drops-field-note">Applies EXP multiplier only.</p>
|
||||
|
||||
<label for="bestiary-view">View</label>
|
||||
<select id="bestiary-view">
|
||||
@@ -80,7 +71,8 @@
|
||||
|
||||
<label for="bestiary-tier" data-bestiary-tier-wrap>BP Tier</label>
|
||||
<select id="bestiary-tier" data-bestiary-tier-wrap>
|
||||
<option>BP+1</option><option>BP+2</option><option>BP+3</option>
|
||||
|
||||
<option value="0">No modifier</option><option>BP+1</option><option>BP+2</option><option>BP+3</option>
|
||||
<option>BP+4</option><option>BP+5</option><option>BP+6</option>
|
||||
<option>BP+7</option><option>BP+8</option><option>BP+9</option>
|
||||
<option>BP+10</option><option>BP+11</option>
|
||||
@@ -122,6 +114,6 @@
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="bestiary-tables.js?v=bestiary-table-viewer-20260613-3" defer></script>
|
||||
<script src="bestiary-tables.js?v=hide-zero-bestiary-rows-1" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user