PUBG drop map: live squad map with WebSocket rooms
All checks were successful
Deploy production / deploy (push) Successful in 1m15s

- server.js wraps Bun.serve to add /ws/<channel> upgrades (same server and port) and
  serve the map tiles from the host mount; Dockerfile now runs bun ./server.js
- ws hub (channel registry, origin check) + pubg-map channel: rooms by unguessable
  code, validated + rate-limited messages, per-room write queue, presence
- games.pubg_rooms / pubg_matches / pubg_markers; per-match sessions with history
- /trackers/games/pubg/map hub (owner: rooms, landings over time, history) and
  /trackers/games/pubg/map/<code> fullscreen Leaflet map (all 11 maps)
- deploy-remote.sh bind-mounts ~/pubg-maps; scripts/build-pubg-tiles.py rebuilds it
This commit is contained in:
2026-10-25 22:46:24 +00:00
parent d93374bca2
commit 0fe0d36f87
26 changed files with 39201 additions and 3 deletions

View File

@@ -83,6 +83,31 @@ YAML
else
echo "No $money_documents_host_dir/documents.json on this host; money documents will not be readable" >&2
fi
# PUBG drop map tiles (512 px WebP, from PUBG's official api-assets) also live on the host,
# outside the repo (~120 MB), bind-mounted read-only at /pubg-maps; server.js serves them at
# /pubg-tiles/<map>/<z>/<x>/<y>.webp. Layout: <map>/<z>/<x>/<y>.webp + <map>/thumb.webp.
pubg_tiles_host_dir=${PUBG_TILES_HOST_DIR:-/home/stan/pubg-maps}
case "$pubg_tiles_host_dir" in /*) ;; *) echo 'PUBG_TILES_HOST_DIR must be absolute' >&2; exit 2 ;; esac
if sudo docker run --rm --entrypoint sh \
--mount "type=bind,source=$pubg_tiles_host_dir,target=/pubg-maps,readonly" "$image" \
-c 'test -f /pubg-maps/erangel/thumb.webp' 2>/dev/null; then
pubg_tiles_override="$HOME/compose.pubg-tiles.yml"
rm -f "$pubg_tiles_override"
cat >"$pubg_tiles_override" <<YAML
services:
app:
environment:
PUBG_TILES_ROOT: /pubg-maps
volumes:
- type: bind
source: $pubg_tiles_host_dir
target: /pubg-maps
read_only: true
YAML
compose_files+=(-f "$pubg_tiles_override")
else
echo "No $pubg_tiles_host_dir/erangel on this host; the PUBG map will have no tiles" >&2
fi
previous_tag=$(sed -n 's/^IMAGE_TAG=//p' "$directory/.env" | head -n 1)
switched=0
rollback() {