From eb49ea4b84053098f85b8fd360224f4b985e6e87 Mon Sep 17 00:00:00 2001 From: Horoli Date: Sat, 31 Oct 2026 23:14:44 +0900 Subject: [PATCH] Improve summit terrain, mobile HUD and multiplayer night equipment Add the Blender flashlight asset with a 600 lm beam and reduced bloom, shared-mode self badge, and compact phone controls. Relocate the summit marker, blend terrain seams, widen walking routes, and align local server configuration on port 2027. --- .config.example.json | 6 +-- README.md | 4 +- docs/multiplayer-server.md | 4 +- index.html | 5 ++- public/characters/flashlight.glb | Bin 0 -> 155936 bytes public/osm-derived.json | 8 ++-- public/terrain/summit-mesh.bin | Bin 15601904 -> 16099324 bytes public/terrain/summit-mesh.bin.gz | Bin 6138350 -> 6369382 bytes public/terrain/summit-mesh.json | 20 ++++----- scripts/constants/marker-location.json | 11 +++++ scripts/constants/sunrise-wish.ts | 6 +++ scripts/create-flashlight.py | 38 ++++++++++++++++ scripts/locate-summit-marker.py | 18 ++++++++ server/constants/multiplayer.ts | 2 +- server/room.ts | 6 ++- src/constants/character.ts | 1 + src/constants/flashlight.ts | 12 +++++ src/constants/summitMaterials.ts | 1 + src/constants/summitPlateau.ts | 2 +- src/constants/summitTerrain.ts | 1 + src/constants/summitTrails.ts | 10 ++--- src/multiplayer/protocol.ts | 2 +- src/multiplayer/remotePlayers.ts | 2 +- src/scene/flashlight.ts | 23 ++++++++++ src/scene/sheep.ts | 24 +++++++--- src/scene/summitTerrain.ts | 16 ++++++- src/scene/summitTrails.ts | 5 ++- src/scene/world.ts | 58 ++++++++++++++++++++----- src/style.css | 28 ++++++++++++ src/ui/selfBadge.ts | 30 +++++++++++++ src/ui/timeController.ts | 27 ++++++++++++ tests/multiplayer-client.test.ts | 4 +- tests/multiplayer-server.test.ts | 2 +- tests/rain-gear.test.ts | 28 ++++++++++++ tests/server-config.test.ts | 6 +-- tests/summit-marker.test.ts | 10 +++++ tests/summit-terrain.test.ts | 25 +++++++++++ tests/summit-walking.test.ts | 11 +++-- tests/time-controller.test.ts | 8 +++- vite.config.ts | 2 +- 40 files changed, 402 insertions(+), 64 deletions(-) create mode 100644 public/characters/flashlight.glb create mode 100644 scripts/constants/marker-location.json create mode 100644 scripts/constants/sunrise-wish.ts create mode 100644 scripts/create-flashlight.py create mode 100644 scripts/locate-summit-marker.py create mode 100644 src/constants/flashlight.ts create mode 100644 src/scene/flashlight.ts create mode 100644 src/ui/selfBadge.ts diff --git a/.config.example.json b/.config.example.json index 4069071..d7b4c0e 100644 --- a/.config.example.json +++ b/.config.example.json @@ -1,12 +1,12 @@ { "host": "127.0.0.1", - "port": 3000, + "port": 2027, "mongoUri": "mongodb://172.16.0.7:27017", "mongoDatabase": "sunrise", "visitStore": "mongo", "allowedOrigins": [ - "http://127.0.0.1:3000", - "http://localhost:3000", + "http://127.0.0.1:2027", + "http://localhost:2027", "http://127.0.0.1:5173", "http://localhost:5173" ] diff --git a/README.md b/README.md index 516d2b6..bc59db4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ OSM 건물의 외곽선·높이·층수와 OSM 대조 기반 선별을 제거했 ## 공동 관측 서버 -관악산 채널 1은 최대 100명을 수용합니다. Node.js + Socket.IO로 이동·감정표현·우천 장비를 공유하고 MongoDB에는 접속 기록만 저장합니다. `npm run build` 후 `npm start`로 실행합니다. 기본 주소는 `http://127.0.0.1:3000`입니다. +관악산 채널 1은 최대 100명을 수용합니다. Node.js + Socket.IO로 이동·감정표현·우천 장비를 공유하고 MongoDB에는 접속 기록만 저장합니다. `npm run build` 후 `npm start`로 실행합니다. 기본 주소는 `http://127.0.0.1:2027`입니다. 환경설정·개발 실행·검증 방법과 운영 한계는 [서버 설명](docs/multiplayer-server.md)을 참고하세요. 기본 MongoDB는 `172.16.0.7:27017`의 `sunrise.visitSessions`이며 `.config.example.json`을 `.config.json`으로 복사한 뒤 변경합니다. @@ -37,7 +37,7 @@ OSM 건물의 외곽선·높이·층수와 OSM 대조 기반 선별을 제거했 - 현재 관악산 공동 방을 `채널 1`로 사용한다. - `/api/lobby`에서 서버 목록, 채널 정원·인원·입장 가능 여부를 조회한다. 선택 화면에서는 방문 기록이나 3D 장면을 생성하지 않는다. -- 개발 시 프런트엔드(`npm run dev`)와 백엔드(`npm run dev:server`)를 함께 실행한다. Vite가 `/api`와 `/socket.io`를 백엔드 3000번 포트로 전달한다. +- 개발 시 프런트엔드(`npm run dev`)와 백엔드(`npm run dev:server`)를 함께 실행한다. Vite가 `/api`와 `/socket.io`를 백엔드 2027번 포트로 전달한다. - 서버 조회 실패·입장 실패는 재시도할 수 있다. 명시적인 `?mode=solo` 비교 화면과 개발용 `?profile` 경로는 기존 직접 진입을 유지한다. 아래 내용은 각 기능의 개발 기록이다. diff --git a/docs/multiplayer-server.md b/docs/multiplayer-server.md index 9cf985a..81369f4 100644 --- a/docs/multiplayer-server.md +++ b/docs/multiplayer-server.md @@ -12,13 +12,13 @@ npm run build npm start ``` -예제 설정의 접속 주소: `http://127.0.0.1:3000`. DB: `mongodb://172.16.0.7:27017`, DB 이름 `sunrise`, 컬렉션 `visitSessions`. 인증이 필요하면 `mongoUri`에 계정과 `authSource` 등 해당 서버 설정을 지정한다. URI를 브라우저용 `VITE_*` 변수에 넣지 않는다. `.config.json`은 버전 관리에서 제외한다. +예제 설정의 접속 주소: `http://127.0.0.1:2027`. DB: `mongodb://172.16.0.7:27017`, DB 이름 `sunrise`, 컬렉션 `visitSessions`. 인증이 필요하면 `mongoUri`에 계정과 `authSource` 등 해당 서버 설정을 지정한다. URI를 브라우저용 `VITE_*` 변수에 넣지 않는다. `.config.json`은 버전 관리에서 제외한다. Linux에서는 `cp .config.example.json .config.json`으로 복사한다. 설정 파일은 작업 디렉터리와 관계없이 프로젝트 루트에서 읽으며 모든 예제 항목을 유지한다. 파일이 없거나 JSON 또는 항목 형식이 잘못되면 서버 시작을 중단한다. 서버 설정은 `.env`나 환경변수에서 읽지 않는다. 수정 후 서버를 재시작한다. `npm run verify:mongo`도 같은 파일의 `mongoUri`를 사용한다. 운영 환경에서는 `allowedOrigins`를 실제 접속 주소의 배열(예: `["https://sunrise.example.com"]`)로 바꾸고 `visitStore`는 `"mongo"`로 유지한다. JSON에는 주석을 넣지 않는다. -개발 시 별도 터미널에서 `npm run dev:server`와 `npm run dev`를 실행한다. Vite의 `/socket.io`, `/health`, `/api` 요청은 3000 포트 서버로 전달된다. `npm run preview`는 프런트 미리보기이며 공동 방 서버를 대신하지 않는다. +개발 시 별도 터미널에서 `npm run dev:server`와 `npm run dev`를 실행한다. Vite의 `/socket.io`, `/health`, `/api` 요청은 2027 포트 서버로 전달된다. `npm run preview`는 프런트 미리보기이며 공동 방 서버를 대신하지 않는다. `host` 기본값은 `127.0.0.1`이라 현재 컴퓨터에서만 접속할 수 있다. LAN/운영 배포 시 실제 바인딩 주소, `port`, `allowedOrigins`를 지정하고 TLS를 제공하는 프록시와 방화벽을 구성한다. 이번 구현은 외부 호스팅 배포까지 수행하지 않는다. 동일 방/정원을 여러 Node 프로세스에서 따로 실행하지 않는다. 프로세스별 메모리는 공유되지 않으며 현재는 단일 인스턴스 구성이다. diff --git a/index.html b/index.html index caa5651..3082658 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,7 @@ +
@@ -64,6 +65,7 @@
+
LIVEKST
@@ -82,7 +84,8 @@