feat: add ballistic overlay and improve DMA stability

- Add ballistic aim dot and bullet trail rendering with menu toggles
- Read local weapon ammo data for prediction inputs
- Rework bone scatter reads to per-bone pages with cached skeleton fallback
- Add DMA throughput stats to the overlay info panel
- Improve signature scanning with page-based scatter reads
- Cache encoded map tiles and support cross-origin/static web radar hosting
- Add Caddy config for serving the web radar UI
This commit is contained in:
67
2026-06-19 20:51:40 +08:00
parent 7945bc6536
commit 8c1d390781
17 changed files with 909 additions and 245 deletions
+7 -2
View File
@@ -1,6 +1,10 @@
const storageKey = "dayz-web-map-settings";
const params = new URLSearchParams(window.location.search);
const password = params.get("password") || "";
// Optional ?server=http://host:port param — lets the UI be served from a static
// host (Caddy, GitHub Pages, local file) while the C++ backend runs elsewhere.
// Leave empty when the UI is served directly by the C++ server (same origin).
const serverOrigin = (params.get("server") || "").replace(/\/$/, "");
const favoriteLootColor = "#ef4444";
const favoriteLootFilterDefinition = { key: "favoriteLoot", label: "Favorites", visibleKey: "showFavoriteLoot", kind: "loot", category: "favorite", color: favoriteLootColor, markerSize: 10, textSize: 14, showLabel: true };
const lootPalette = ["#f43f5e", "#f59e0b", "#22c55e", "#eab308", "#84cc16", "#ec4899", "#0ea5e9", "#14b8a6", "#c084fc", "#f97316", "#d946ef", "#dc2626", "#fbbf24", "#fb923c", "#0891b2", "#64748b"];
@@ -300,7 +304,8 @@ function toggleFavoriteLoot(itemName) {
}
function apiUrl(path) {
return password ? `${path}?password=${encodeURIComponent(password)}` : path;
const base = serverOrigin + path;
return password ? `${base}?password=${encodeURIComponent(password)}` : base;
}
function tileUrl(tileX, tileY, retry = 0) {
@@ -311,7 +316,7 @@ function tileUrl(tileX, tileY, retry = 0) {
if (password) {
query.set("password", password);
}
return `/tile?${query.toString()}`;
return `${serverOrigin}/tile?${query.toString()}`;
}
function getViewportMetrics() {