Initial commit: DayZ memory C++ port with DMA backend and overlay

This commit is contained in:
67
2026-06-16 15:18:44 +08:00
commit f04e38b8ae
163 changed files with 163380 additions and 0 deletions
+2424
View File
File diff suppressed because it is too large Load Diff
+134
View File
@@ -0,0 +1,134 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DayZ Web Map</title>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<button class="settings-toggle" id="settingsToggle" type="button" aria-label="Open filters"></button>
<div class="top-right-toggles">
<button class="players-toggle" id="labelSettingsToggle" type="button" aria-label="Open label settings">Labels</button>
<button class="players-toggle" id="playersToggle" type="button" aria-label="Open players">Players</button>
<button class="loot-toggle" id="lootToggle" type="button" aria-label="Open loot">Loot</button>
</div>
<aside class="label-settings-panel" id="labelSettingsPanel">
<div class="label-settings-header">
<div>
<strong>Label Settings</strong>
<div class="label-settings-subtitle">Tune ordinary loot label placement without touching filters.</div>
</div>
<div class="label-settings-actions">
<button class="collapse-button" id="labelSettingsReset" type="button">Reset</button>
<button class="collapse-button" id="labelSettingsClose" type="button" aria-label="Close label settings"></button>
</div>
</div>
<div class="label-settings-body" id="labelSettingsBody">
<label class="setting-card" for="ordinaryLootSpread">
<span class="setting-title">Ordinary loot spread</span>
<span class="setting-value" id="ordinaryLootSpreadValue">2.0x</span>
<input type="range" id="ordinaryLootSpread" min="1" max="4" step="0.1" value="2">
<span class="setting-help">Controls how far regular loot labels may move away from the point to avoid collisions.</span>
</label>
<label class="setting-card" for="groupedLootSpread">
<span class="setting-title">Grouped loot spread</span>
<span class="setting-value" id="groupedLootSpreadValue">2.0x</span>
<input type="range" id="groupedLootSpread" min="1" max="4" step="0.1" value="2">
<span class="setting-help">Controls how far merged same-name loot labels may sit from the cluster center.</span>
</label>
<label class="setting-card" for="sameLootMergeRadius">
<span class="setting-title">Same-name merge radius</span>
<span class="setting-value" id="sameLootMergeRadiusValue">110 px</span>
<input type="range" id="sameLootMergeRadius" min="20" max="240" step="5" value="110">
<span class="setting-help">Items with the same name inside this screen radius share one text label with multiple connector lines.</span>
</label>
<label class="setting-card" for="lineAnchorMode">
<span class="setting-title">Line anchor on text</span>
<select id="lineAnchorMode">
<option value="auto-nearest">Auto nearest</option>
<option value="top-left">Top left</option>
<option value="bottom-center">Bottom center</option>
<option value="top-center">Top center</option>
<option value="top-right">Top right</option>
<option value="middle-left">Middle left</option>
<option value="middle-right">Middle right</option>
<option value="bottom-left">Bottom left</option>
<option value="bottom-right">Bottom right</option>
</select>
<span class="setting-help">Chooses from which corner or side midpoint of the text the connector line starts. Auto nearest selects the closest standard point on the text rectangle to the item point.</span>
</label>
<label class="setting-card toggle-setting">
<span class="setting-title">Merge same-name loot labels</span>
<input type="checkbox" id="mergeSameLootLabels" checked>
<span class="setting-help">When enabled, nearby ordinary loot with the same name is shown as one label with several lines.</span>
</label>
</div>
</aside>
<aside class="players-panel" id="playersPanel">
<div class="players-panel-header">
<strong>Players</strong>
<button class="collapse-button" id="playersClose" type="button" aria-label="Close players"></button>
</div>
<div class="players-server" id="serverInfo">Server: loading...</div>
<div class="players-list" id="playersList"></div>
</aside>
<aside class="loot-panel" id="lootPanel">
<div class="players-panel-header">
<strong>Ground Loot</strong>
<button class="collapse-button" id="lootClose" type="button" aria-label="Close loot"></button>
</div>
<div class="players-server" id="lootInfo">Loot: loading...</div>
<div class="loot-list" id="lootList"></div>
</aside>
<div class="shell">
<aside class="panel" id="settingsPanel">
<div class="panel-header">
<div>
<h1>DayZ Web Map</h1>
<div id="status">Connecting...</div>
<div id="serverBadge" class="server-badge">Server: loading...</div>
</div>
<button class="collapse-button" id="collapseButton" type="button" aria-label="Hide filters"></button>
</div>
<div class="panel-body" id="settingsPanelBody">
<div class="group">
<div class="group-title">Controls</div>
<label class="toggle-row"><input type="checkbox" id="followPlayer"><span>Follow player</span></label>
<label class="toggle-row"><input type="checkbox" id="showLabels" checked><span>Global labels</span></label>
<label class="toggle-row"><input type="checkbox" id="showLoot" checked><span>All loot</span></label>
</div>
<div class="group">
<div class="group-title">Entity Filters</div>
<div id="entityFilterList" class="filter-list"></div>
</div>
<div class="group">
<div class="group-title">Loot Filters</div>
<div id="lootFilterList" class="filter-list"></div>
</div>
<div class="group">
<div class="group-title">Display</div>
<label class="range-row" for="distanceFilter"><span>Distance filter</span><input type="range" id="distanceFilter" min="0" max="5000" step="50" value="2000"></label>
<div id="distanceValue">2000 m</div>
<label class="range-row" for="textSize"><span>Default text size</span><input type="range" id="textSize" min="10" max="24" step="1" value="14"></label>
<div id="textSizeValue">14 px</div>
</div>
<div class="hint">Drag to move. Use wheel or pinch to zoom. Open a filter card to tune color, marker size, text size and labels.</div>
</div>
</aside>
<main class="viewport" id="viewport">
<div class="canvas" id="canvas">
<div id="tiles"></div>
<svg id="paths"></svg>
<div id="itemLabels"></div>
<div id="markers"></div>
</div>
</main>
</div>
<script src="/app.js"></script>
</body>
</html>
+783
View File
@@ -0,0 +1,783 @@
:root {
color-scheme: dark;
font-family: Arial, sans-serif;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
min-height: 100%;
}
body {
background: #111827;
color: #e5e7eb;
overflow: hidden;
}
button,
input,
label,
a {
touch-action: manipulation;
}
.settings-toggle {
position: fixed;
top: 16px;
left: 16px;
z-index: 30;
display: inline-flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
font-size: 20px;
opacity: 0;
pointer-events: none;
transition: opacity 0.18s ease;
}
.settings-toggle.visible {
opacity: 1;
pointer-events: auto;
}
.top-right-toggles {
position: fixed;
top: 16px;
right: 16px;
z-index: 31;
display: flex;
gap: 8px;
}
.players-toggle,
.loot-toggle,
.collapse-button,
.settings-toggle,
.filter-gear {
border: 1px solid #334155;
background: #111827;
color: #e5e7eb;
border-radius: 0;
padding: 8px 12px;
cursor: pointer;
}
.players-toggle,
.loot-toggle {
padding: 10px 14px;
}
.label-settings-panel {
position: fixed;
top: 16px;
left: 50%;
transform: translate(-50%, calc(-100% - 24px));
width: min(760px, calc(100vw - 32px));
max-height: min(72vh, 760px);
z-index: 35;
border: 1px solid #1f2937;
border-radius: 0;
background: rgba(15, 23, 42, 0.97);
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
opacity: 0;
pointer-events: none;
transition: transform 0.18s ease, opacity 0.18s ease;
overflow: hidden;
}
.label-settings-panel.open {
transform: translate(-50%, 0);
opacity: 1;
pointer-events: auto;
}
.label-settings-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
padding: 14px 16px 12px;
border-bottom: 1px solid #1f2937;
}
.label-settings-subtitle {
margin-top: 4px;
color: #94a3b8;
font-size: 12px;
}
.label-settings-actions {
display: flex;
gap: 8px;
}
.label-settings-body {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
padding: 16px;
overflow-y: auto;
max-height: calc(72vh - 70px);
}
.setting-card {
display: grid;
gap: 8px;
padding: 12px;
border: 1px solid #334155;
border-radius: 0;
background: rgba(15, 23, 42, 0.72);
}
.setting-title {
color: #e5e7eb;
font-weight: 700;
}
.setting-value {
color: #93c5fd;
font-size: 12px;
}
.setting-help {
color: #94a3b8;
font-size: 12px;
line-height: 1.35;
}
.setting-card select,
.setting-card input[type="range"] {
width: 100%;
}
.setting-card select {
border: 1px solid #334155;
background: #111827;
color: #e5e7eb;
border-radius: 0;
padding: 9px 10px;
}
.toggle-setting {
grid-template-columns: 1fr auto;
align-items: center;
}
.toggle-setting .setting-help {
grid-column: 1 / -1;
}
.players-panel,
.loot-panel {
position: fixed;
top: 68px;
right: 16px;
bottom: 16px;
width: min(420px, calc(100vw - 32px));
z-index: 30;
border: 1px solid #1f2937;
border-radius: 0;
background: rgba(15, 23, 42, 0.95);
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
display: grid;
grid-template-rows: auto auto 1fr;
transform: translateX(calc(100% + 24px));
opacity: 0;
pointer-events: none;
transition: transform 0.18s ease, opacity 0.18s ease;
}
.players-panel.open,
.loot-panel.open {
transform: translateX(0);
opacity: 1;
pointer-events: auto;
}
.players-panel-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 12px 12px 8px;
border-bottom: 1px solid #1f2937;
}
.players-server {
padding: 8px 12px;
color: #93c5fd;
font-size: 12px;
border-bottom: 1px solid #1f2937;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.players-list,
.loot-list {
overflow-y: auto;
overscroll-behavior: contain;
padding: 8px;
}
.players-row {
display: grid;
grid-template-columns: 1fr;
gap: 6px;
border: 1px solid #263244;
border-radius: 0;
background: rgba(2, 6, 23, 0.55);
padding: 8px 10px;
margin-bottom: 8px;
}
.players-name {
font-family: Arial, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
font-weight: 600;
white-space: pre-line;
}
.players-steam {
grid-column: 1 / -1;
font-size: 12px;
}
.players-steam a {
color: #93c5fd;
text-decoration: none;
}
.players-empty {
color: #94a3b8;
font-size: 13px;
padding: 10px;
}
.loot-row {
width: 100%;
display: grid;
grid-template-columns: 1fr auto;
gap: 6px 12px;
text-align: left;
border: 1px solid rgba(51, 65, 85, 0.85);
border-left: 4px solid var(--loot-color, #94a3b8);
border-radius: 0;
background: rgba(2, 6, 23, 0.68);
color: #e5e7eb;
padding: 10px 12px;
margin-bottom: 8px;
cursor: pointer;
}
.loot-row.favorite {
border-color: rgba(239, 68, 68, 0.9);
box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.5), 0 0 18px rgba(239, 68, 68, 0.18);
}
.loot-name {
font-weight: 700;
color: var(--loot-color, #e5e7eb);
}
.loot-distance {
color: #cbd5e1;
font-size: 12px;
}
.loot-meta {
grid-column: 1 / -1;
color: #94a3b8;
font-size: 12px;
}
.loot-section-title,
.loot-group-title {
color: #93c5fd;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
padding: 8px 4px 6px;
}
.loot-group-title {
color: #cbd5e1;
letter-spacing: 0.04em;
padding-top: 4px;
}
.shell {
min-height: 100vh;
}
.panel {
position: fixed;
top: 16px;
left: 16px;
bottom: 16px;
width: min(360px, calc(100vw - 32px));
z-index: 20;
background: #0f172a;
border: 1px solid #1f2937;
border-radius: 0;
display: flex;
flex-direction: column;
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
transition: transform 0.18s ease, opacity 0.18s ease;
overflow: hidden;
}
.panel.collapsed {
transform: translateX(calc(-100% - 24px));
opacity: 0;
pointer-events: none;
}
.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px 16px 12px;
border-bottom: 1px solid #1f2937;
}
h1 {
margin: 0 0 6px;
font-size: 28px;
}
.server-badge {
margin-top: 4px;
color: #93c5fd;
font-size: 12px;
max-width: 230px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.panel-body {
flex: 1;
overflow-y: auto;
overscroll-behavior: contain;
padding: 16px;
display: flex;
flex-direction: column;
gap: 16px;
}
.group {
display: flex;
flex-direction: column;
gap: 8px;
}
.group-title {
color: #93c5fd;
font-size: 13px;
letter-spacing: 0.08em;
text-transform: uppercase;
margin-top: 8px;
}
.toggle-row {
display: grid;
grid-template-columns: 20px 1fr;
align-items: center;
gap: 8px;
}
.toggle-row input {
margin: 0;
}
.toggle-row.compact {
margin-top: 4px;
}
.range-row {
display: flex;
flex-direction: column;
gap: 6px;
}
.filter-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.filter-card {
border: 1px solid #334155;
border-radius: 0;
background: rgba(15, 23, 42, 0.72);
}
.filter-row {
display: grid;
grid-template-columns: 1fr auto;
align-items: center;
gap: 8px;
padding: 10px 12px;
}
.filter-main {
display: grid;
grid-template-columns: 18px 14px 1fr;
align-items: center;
gap: 10px;
}
.filter-main input {
margin: 0;
}
.filter-swatch {
width: 14px;
height: 14px;
border-radius: 999px;
border: 1px solid rgba(248, 250, 252, 0.3);
}
.filter-extra {
display: none;
padding: 0 12px 12px;
border-top: 1px solid rgba(51, 65, 85, 0.65);
gap: 10px;
}
.filter-card.expanded .filter-extra {
display: grid;
}
.mini-control {
display: grid;
grid-template-columns: 90px 1fr auto;
align-items: center;
gap: 10px;
}
.mini-control strong {
color: #94a3b8;
font-size: 12px;
font-weight: 600;
}
.viewport {
position: fixed;
inset: 0;
overflow: hidden;
touch-action: none;
overscroll-behavior: none;
background: #000;
user-select: none;
-webkit-user-select: none;
}
.canvas {
position: absolute;
transform-origin: 0 0;
user-select: none;
-webkit-user-select: none;
}
#tiles,
#paths,
#itemLabels,
#markers {
position: absolute;
inset: 0;
}
#paths {
z-index: 7;
pointer-events: none;
overflow: visible;
}
#itemLabels {
z-index: 5;
pointer-events: none;
}
#markers {
z-index: 10;
}
.map-tile {
position: absolute;
image-rendering: auto;
user-select: none;
-webkit-user-drag: none;
background: #000;
opacity: 0;
transition: opacity 0.15s ease;
}
.map-tile.loaded {
opacity: 1;
}
.map-tile.loading,
.map-tile.failed {
opacity: 0.35;
}
.entity {
position: absolute;
transform: translate(-50%, -50%);
z-index: 10;
}
.item-label-anchor {
position: absolute;
transform: translate(-50%, -50%);
}
.entity.layer-loot {
z-index: 10;
}
.entity.layer-favorite {
z-index: 20;
}
.entity.layer-entity {
z-index: 30;
}
.entity.player-entity {
z-index: 40;
}
.entity.local-player-entity {
z-index: 50;
}
.marker {
position: absolute;
left: 0;
top: 0;
width: 12px;
height: 12px;
border-radius: 999px;
border: 2px solid #000;
transform: translate(-50%, -50%);
z-index: 2;
}
.marker.players {
background: #f97316;
}
.marker.zombies {
background: #22c55e;
}
.marker.animals {
background: #60a5fa;
}
.marker.loot {
background: #facc15;
width: 8px;
height: 8px;
}
.marker.vehicles {
background: #a855f7;
width: 14px;
height: 14px;
}
.marker.bullets {
background: #f8fafc;
width: 6px;
height: 6px;
border-radius: 2px;
box-shadow: 0 0 10px rgba(248, 250, 252, 0.65);
}
.marker.otherEntities {
background: #94a3b8;
width: 10px;
height: 10px;
}
.marker.local-player {
background: #ef4444;
width: 16px;
height: 16px;
}
.marker.favorite {
box-shadow: 0 0 0 2px rgba(127, 29, 29, 0.85), 0 0 14px rgba(239, 68, 68, 0.85);
border-color: #fee2e2;
}
.entity.bullet-phantom .marker.bullets {
opacity: 0.45;
box-shadow: 0 0 6px rgba(148, 163, 184, 0.45);
}
.entity.bullet-completed .marker.bullets {
border-color: rgba(15, 23, 42, 0.8);
}
.bullet-path-actual,
.bullet-path-predicted {
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 2;
}
.bullet-path-actual {
opacity: 0.9;
}
.bullet-path-predicted {
stroke-dasharray: 8 6;
opacity: 0.7;
}
.bullet-path-phantom {
opacity: 0.35;
}
.direction {
position: absolute;
left: 50%;
top: 50%;
width: 2px;
height: 28px;
background: #f8fafc;
transform-origin: 50% 100%;
}
.entity-direction {
left: 0;
top: 0;
z-index: 1;
}
.direction::before {
content: "";
position: absolute;
left: 50%;
top: -8px;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 8px solid currentColor;
transform: translateX(-50%);
}
.local-direction {
color: #ef4444;
}
.label {
position: absolute;
left: 0;
top: 0;
display: inline-block;
white-space: nowrap;
font-family: Arial, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
color: #f8fafc;
padding: 0;
line-height: 1.15;
font-weight: 700;
text-shadow: 0 1px 2px rgba(2, 6, 23, 0.9);
pointer-events: none;
z-index: 3;
}
.entity.player-entity .label {
white-space: pre;
}
.label.favorite {
text-shadow: 0 1px 2px rgba(127, 29, 29, 0.85);
}
.label-line {
position: absolute;
left: 0;
top: 0;
height: 1px;
background: currentColor;
transform-origin: 0 50%;
opacity: 0.9;
pointer-events: none;
z-index: 2;
}
.label-line.favorite {
opacity: 1;
}
.loot-line {
z-index: 1;
}
.loot-label {
z-index: 2;
}
.hint {
color: #94a3b8;
font-size: 13px;
}
.unauthorized {
display: grid;
place-items: center;
min-height: 100vh;
font-size: 24px;
}
@media (max-width: 900px) {
.label-settings-panel {
top: 12px;
width: min(760px, calc(100vw - 24px));
}
.label-settings-body {
grid-template-columns: 1fr;
}
.panel {
top: 12px;
left: 12px;
bottom: 12px;
width: min(340px, calc(100vw - 24px));
}
.mini-control {
grid-template-columns: 1fr;
align-items: start;
}
.top-right-toggles {
top: 12px;
right: 12px;
}
.players-panel,
.loot-panel {
top: 64px;
right: 12px;
bottom: 12px;
width: min(420px, calc(100vw - 24px));
}
}