feat(map): adopt DC Default scene
This commit is contained in:
@@ -13,6 +13,7 @@ from fastapi import APIRouter, HTTPException, Path, Query, Request
|
||||
from fastapi.responses import JSONResponse, Response, StreamingResponse
|
||||
|
||||
MAP_GATEWAY_URL_ENV: Final = "MISSIONCORE_MAP_GATEWAY_INTERNAL_URL"
|
||||
MAP_SANDBOX_HIDE_CREDITS_ENV: Final = "MISSIONCORE_MAP_SANDBOX_HIDE_CREDITS"
|
||||
MAP_SCHEMA_VERSION: Final = "missioncore.map-gateway/v1"
|
||||
MAP_RUNTIME_SCHEMA_VERSION: Final = "missioncore.map-runtime/v1"
|
||||
MAP_PAGE_VERSION: Final = "0.1.0"
|
||||
@@ -149,6 +150,11 @@ class MapGatewayProxy:
|
||||
"terrain": 1,
|
||||
"buildings": 96188,
|
||||
},
|
||||
"sandbox": {
|
||||
"hide_credit_overlay": _environment_flag(
|
||||
MAP_SANDBOX_HIDE_CREDITS_ENV
|
||||
)
|
||||
},
|
||||
},
|
||||
headers={"Cache-Control": "no-store"},
|
||||
)
|
||||
@@ -309,6 +315,15 @@ def _validate_internal_url(raw_url: str) -> str:
|
||||
return raw_url.rstrip("/")
|
||||
|
||||
|
||||
def _environment_flag(name: str) -> bool:
|
||||
return os.environ.get(name, "").strip().lower() in {
|
||||
"1",
|
||||
"true",
|
||||
"yes",
|
||||
"on",
|
||||
}
|
||||
|
||||
|
||||
def _validate_cache_target(target_url: str) -> None:
|
||||
if len(target_url) > MAX_CACHE_TARGET_LENGTH:
|
||||
raise HTTPException(status_code=422, detail="Map resource URL is too long.")
|
||||
|
||||
Reference in New Issue
Block a user