feat: add relay-backed web radar sharing

- publish radar state/bootstrap snapshots to an HTTP relay
- add shared waypoint sync through relay APIs and SSE updates
- add remote Caddy/deploy tooling and mock relay push script
- add static POIs, topo-tile availability checks, and tile-load throttling
- add WASM 3D map engine and Python map data-prep pipeline
- update worn clothing reads to include slot metadata
- add grid controls, render perf HUD, and marker/label scaling tweaks
- remove embedded map resource generation in favor of disk/relay maps
This commit is contained in:
67
2026-06-23 03:11:52 +08:00
parent 7f9a6620f9
commit 361c6baa8f
16 changed files with 539 additions and 147 deletions
+8 -55
View File
@@ -90,6 +90,7 @@ list(APPEND PROJECT_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/src/Overlay/BoneInterpolator.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/Overlay/OverlayWindow.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/Overlay/GameOverlay.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/Web/ServerPublisher.cpp"
)
list(REMOVE_DUPLICATES PROJECT_SOURCES)
@@ -100,60 +101,16 @@ set(VOLKDMA_SOURCES
)
# -------------------------------------------------------------------------
# Embed map PNGs as Windows RCDATA resources
#
# Maps present in maps/ at configure time are baked into the binary so the
# server works out-of-the-box without copying anything next to the exe.
# A PNG placed on disk at runtime (maps/<id>.png next to the exe) still
# takes priority, so maps can be updated without rebuilding.
#
# Re-run CMake if you add new PNGs to maps/ after the initial configure.
# EmbeddedMaps stub — maps are served from the relay server, not baked into the binary.
# MapTileService falls back to this when no disk PNG is found; returning
# {nullptr, 0} means it will always load from maps/ on disk (or return 404).
# -------------------------------------------------------------------------
set(MAPS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/maps")
set(EMBEDDED_MAPS_RC "${CMAKE_CURRENT_BINARY_DIR}/maps_embedded.rc")
set(EMBEDDED_MAPS_CPP "${CMAKE_CURRENT_BINARY_DIR}/EmbeddedMaps.cpp")
set(MAP_IDS chernarusplus livonia namalsk banov deadfall deerisle esseker lux sakhal takistan alteria)
set(MAP_RIDS 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011)
# ── Base map RCDATA embedding ─────────────────────────────────────────────────
set(RC_LINES "")
set(CPP_CASES "")
foreach(MAP_ID MAP_RID IN ZIP_LISTS MAP_IDS MAP_RIDS)
if(EXISTS "${MAPS_SOURCE_DIR}/${MAP_ID}.png")
string(APPEND RC_LINES "${MAP_RID} RCDATA \"${MAPS_SOURCE_DIR}/${MAP_ID}.png\"\n")
string(APPEND CPP_CASES " if (mapId == \"${MAP_ID}\") return LoadRcData(${MAP_RID});\n")
message(STATUS "Embedding map: ${MAP_ID}")
else()
message(STATUS "Skipping map (not found): ${MAP_ID}")
endif()
endforeach()
file(WRITE "${EMBEDDED_MAPS_RC}" "// Auto-generated by CMake - do not edit.\n${RC_LINES}")
file(WRITE "${EMBEDDED_MAPS_CPP}"
"// Auto-generated by CMake - do not edit.
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>
#include <cstdint>
#include <utility>
"// Auto-generated by CMake — maps served from relay server, no embedded resources.
#include \"EmbeddedMaps.h\"
static std::pair<const uint8_t*, size_t> LoadRcData(int resourceId) {
HRSRC hRes = FindResource(nullptr, MAKEINTRESOURCE(resourceId), RT_RCDATA);
if (!hRes) return {nullptr, 0};
HGLOBAL hData = LoadResource(nullptr, hRes);
if (!hData) return {nullptr, 0};
const void* ptr = LockResource(hData);
DWORD sz = SizeofResource(nullptr, hRes);
if (!ptr || sz == 0) return {nullptr, 0};
return {static_cast<const uint8_t*>(ptr), sz};
}
std::pair<const uint8_t*, size_t> GetEmbeddedMap(const std::string& mapId) {
${CPP_CASES} return {nullptr, 0};
std::pair<const uint8_t*, size_t> GetEmbeddedMap(const std::string&) {
return {nullptr, 0};
}
")
@@ -164,11 +121,7 @@ add_executable(dayz-memory-cpp
${FRAMEWORK_SOURCES}
)
# Wire in the generated RC + CPP files.
target_sources(dayz-memory-cpp PRIVATE
"${EMBEDDED_MAPS_RC}"
"${EMBEDDED_MAPS_CPP}"
)
target_sources(dayz-memory-cpp PRIVATE "${EMBEDDED_MAPS_CPP}")
# -------------------------------------------------------------------------
# Include directories