feat: German ROBUST startup logs, MapLibre map and secure portal registration name checks
* feat(maplibre): expose XYZ raster tile adapter for OpenSim Warp3D grid coordinates * feat(map): replace custom map canvas with MapLibre GL raster XYZ map and region overlays * test(map): verify MapLibre viewport and bound-safe XYZ adapter * feat(robust): German grouped service lifecycle console messages * i18n(robust): German startup, networking and security diagnostic messages * i18n(robust): German startup, networking and security diagnostic messages * i18n(robust): German startup, networking and security diagnostic messages * i18n(robust): German startup, networking and security diagnostic messages * i18n(robust): localize migration, grid and security diagnostics * i18n(robust): localize migration, grid and security diagnostics * i18n(robust): localize migration, grid and security diagnostics * i18n(robust): localize migration, grid and security diagnostics * i18n(robust): localize migration, grid and security diagnostics * docs(openapi): advertise MapLibre XYZ Warp3D adapter * docs(portal): complete Stadt NexVerse backend registration contract and rollout checklist * docs(maplibre): synthetic XYZ coordinates, raster source and frontend CSP notes * feat(registration): machine-authenticated live full-name availability endpoint * feat(world-api): route scoped live avatar-name availability query * docs(openapi): specify machine-key protected name-availability and registration routes * docs(stadtportal): live Resident/full-name availability API and secure Go+JS debounce workflow * test(registration): protect live availability contract, scope and final POST recheck * test(hg): keep security warning regression after German localization * test(maplibre): assert shared view route on API rather than page HTML * test(maplibre): validate XYZ raster source rather than legacy DOM tile template
This commit is contained in:
1 parent
f5029861e2
commit
c55fa68ba1
17 files changed
+723
-211
No files matched your search
@@ -53,6 +53,12 @@ namespace NexVerse.Server.Api
|
||||
|
||||
string path = (request.UriPath ?? string.Empty).TrimEnd('/');
|
||||
bool deutschland = path.StartsWith("/api/v1/deutschland", StringComparison.OrdinalIgnoreCase);
|
||||
if (deutschland &&
|
||||
path.StartsWith("/api/v1/deutschland/xyz/", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
HandleXyzTile(path, response);
|
||||
return;
|
||||
}
|
||||
if (deutschland &&
|
||||
path.StartsWith("/api/v1/deutschland/tiles/", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -201,6 +207,47 @@ namespace NexVerse.Server.Api
|
||||
}
|
||||
}
|
||||
|
||||
// MapLibre uses standard XYZ indices, while OpenSimulator stores map
|
||||
// tiles by bottom-left grid coordinate and inverse native LOD.
|
||||
// The fixed shift places all nonnegative OpenSim coordinates within
|
||||
// the 24-bit virtual WebMercator tile plane, away from the poles.
|
||||
// These longitude/latitude values are SYNTHETIC, never real geography.
|
||||
private void HandleXyzTile(string path, IOSHttpResponse response)
|
||||
{
|
||||
const string prefix = "/api/v1/deutschland/xyz/";
|
||||
const long mapAxis = 1L << 24;
|
||||
const long gridShift = 1L << 22;
|
||||
string[] parts = path.Substring(prefix.Length).Split('/');
|
||||
if (parts.Length != 3 ||
|
||||
!int.TryParse(parts[0], out int z) || z < 17 || z > 24 ||
|
||||
!long.TryParse(parts[1], out long tileX) ||
|
||||
!parts[2].EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) ||
|
||||
!long.TryParse(parts[2].Substring(0, parts[2].Length - 4), out long tileY))
|
||||
{
|
||||
Json(response, HttpStatusCode.BadRequest, new { error = "invalid_xyz_tile" });
|
||||
return;
|
||||
}
|
||||
long count = 1L << z;
|
||||
if (tileX < 0 || tileY < 0 || tileX >= count || tileY >= count)
|
||||
{
|
||||
Json(response, HttpStatusCode.BadRequest, new { error = "invalid_xyz_bounds" });
|
||||
return;
|
||||
}
|
||||
long span = 1L << (24 - z);
|
||||
long gridX = tileX * span - gridShift;
|
||||
long gridY = mapAxis - (tileY + 1) * span - gridShift;
|
||||
if (gridX < 0 || gridY < 0 ||
|
||||
gridX > MaxCellCoordinate - span + 1 ||
|
||||
gridY > MaxCellCoordinate - span + 1)
|
||||
{
|
||||
Json(response, HttpStatusCode.NotFound, new { error = "map_tile_not_found" });
|
||||
return;
|
||||
}
|
||||
int zoom = 25 - z;
|
||||
HandleTile("/api/v1/deutschland/tiles/" + zoom + "/" +
|
||||
gridX + "/" + gridY + ".jpg", response);
|
||||
}
|
||||
|
||||
// Zoom=1 is one 256m grid cell; levels 2..8 are the native
|
||||
// OpenSimulator multi-resolution files (2,4,8,...,128 cells per tile).
|
||||
// Never interpret the coordinates as geographic longitude/latitude.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
namespace NexVerse.Server.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Standalone same-origin citizen map page. A city-portal menu item may link
|
||||
/// to or embed /api/v1/world-map/view without exposing privileged grid APIs.
|
||||
/// Stadt NexVerse MapLibre GL JS view. All virtual Grid coordinates use a
|
||||
/// documented reversible synthetic Mercator mapping; not real geography.
|
||||
/// </summary>
|
||||
internal static class NexCitizenWorldMapPage
|
||||
{
|
||||
@@ -14,174 +13,142 @@ namespace NexVerse.Server.Api
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="color-scheme" content="dark">
|
||||
<title>NexVerse Stadtportal · Weltkarte</title>
|
||||
<title>Stadt NexVerse · MapLibre Weltkarte</title>
|
||||
<link href="https://unpkg.com/maplibre-gl@6.15.0/dist/maplibre-gl.css" rel="stylesheet">
|
||||
<style>
|
||||
:root{color-scheme:dark;font:15px/1.5 system-ui,Arial,sans-serif;background:#07111e;color:#e9f1fa}
|
||||
:root{font:14px/1.5 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:#eaf2fa;background:#07111e;color-scheme:dark}
|
||||
*{box-sizing:border-box}body{margin:0}button,input{font:inherit}
|
||||
header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 21px;border-bottom:1px solid #22334a;background:#0b1727}
|
||||
h1{font-size:1.18rem;margin:0;letter-spacing:.02em}header small{color:#9eb2c9}
|
||||
main{display:grid;grid-template-columns:minmax(240px,300px) minmax(0,1fr);height:calc(100vh - 69px);min-height:420px}
|
||||
aside{padding:20px;border-right:1px solid #22334a;background:#0c1828;overflow:auto}
|
||||
h2{font-size:1rem;margin:0 0 10px}p{color:#9fb3ca}
|
||||
form{display:flex;gap:6px;margin:14px 0}input{width:100%;min-width:0;padding:10px 12px;background:#111f31;border:1px solid #334964;border-radius:9px;color:#fff}
|
||||
button{cursor:pointer;padding:8px 12px;color:#fff;border-radius:8px;background:#173047;border:1px solid #36516d}
|
||||
button:hover{background:#224461}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid #57c3f8;outline-offset:2px}
|
||||
#results{display:grid;gap:8px}.result{width:100%;text-align:left;display:grid;gap:3px;padding:12px;border-color:#2a435b}
|
||||
.result span{font-size:.79rem;color:#a0b5ca}.status{font-size:.83rem;min-height:32px}
|
||||
section{position:relative;overflow:hidden;background:#10253a}
|
||||
#world{position:absolute;inset:0;overflow:hidden;touch-action:none;cursor:grab}
|
||||
#world.dragging{cursor:grabbing}
|
||||
#layers{position:absolute;inset:0;overflow:hidden}
|
||||
.tile,.region{position:absolute}.tile{border:1px solid rgba(125,157,185,.12);background:#153047;overflow:hidden}
|
||||
.tile img{width:100%;height:100%;object-fit:cover;image-rendering:auto}
|
||||
.region{border:1px solid rgba(105,208,255,.65);background:rgba(20,96,143,.14);pointer-events:none}
|
||||
.region button{pointer-events:auto;position:absolute;top:4px;left:4px;max-width:calc(100% - 8px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:rgba(7,17,30,.87);padding:3px 6px;font-size:.79rem;border:1px solid #4687af}
|
||||
#controls{position:absolute;right:18px;top:16px;display:flex;gap:6px;z-index:4}
|
||||
#info{position:absolute;left:18px;bottom:18px;right:18px;background:#0b1829ec;padding:14px 16px;border:1px solid #345372;border-radius:12px;max-width:400px;box-shadow:0 12px 30px #0008;display:none;z-index:5}
|
||||
#info h3{margin:0 0 5px}#info a{color:#8bdaff}#info p{margin:4px 0 10px}
|
||||
#coords{position:absolute;bottom:12px;right:17px;background:#081421cb;color:#b1c5d5;padding:4px 8px;border-radius:6px;font-size:.76rem}
|
||||
.badge{font-size:.73rem;color:#91d8ff;text-transform:uppercase;letter-spacing:.14em}
|
||||
@media(max-width:760px){main{grid-template-columns:1fr;grid-template-rows:200px minmax(400px,1fr);height:auto}aside{border-right:0;border-bottom:1px solid #22334a;padding:13px;overflow:auto}section{height:calc(100dvh - 270px);min-height:400px}header small{display:none}form{margin:6px 0}h2{display:none}#results{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}}
|
||||
header{padding:14px 20px;background:#0c1728;border-bottom:1px solid #28405a;display:flex;justify-content:space-between;align-items:center;gap:15px}
|
||||
header h1{font-size:1.15rem;margin:0}header small{color:#9db4c9}
|
||||
main{height:calc(100dvh - 64px);min-height:420px;display:grid;grid-template-columns:290px minmax(0,1fr)}
|
||||
aside{padding:16px;background:#0b1a2c;border-right:1px solid #28405a;overflow:auto}
|
||||
form{display:flex;gap:6px}input{min-width:0;width:100%;padding:10px;background:#11243a;color:#fff;border:1px solid #35536f;border-radius:7px}
|
||||
button{cursor:pointer;color:#fff;background:#205079;border:1px solid #4683a8;padding:9px 12px;border-radius:7px}
|
||||
#results{display:grid;gap:7px;margin-top:13px}.result{text-align:left;width:100%;background:#122943}
|
||||
#state{min-height:38px;margin:12px 0;color:#aed2ec}#details{display:none;margin-top:18px;padding:13px;background:#132c42;border:1px solid #38607e;border-radius:10px}
|
||||
#details h2{margin:0 0 6px;font-size:1rem}#teleport{color:#80dcff}#notes{color:#8faac0;font-size:.86rem;margin-top:16px}
|
||||
#map{width:100%;height:100%;background:#10263c}#coords{position:absolute;right:14px;bottom:17px;background:#09172ee8;padding:6px 9px;border-radius:6px;z-index:2;pointer-events:none}
|
||||
.maplibregl-ctrl-group{background:#11253d;color:white}.maplibregl-ctrl-group button{background:#152b45}
|
||||
@media(max-width:700px){main{grid-template-columns:1fr;grid-template-rows:200px minmax(450px,1fr);height:auto}aside{padding:11px}#notes{display:none}header small{display:none}#map{min-height:65vh}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header><div><div class="badge">Stadt NexVerse · OpenGenesisLINK</div><h1>Weltkarte</h1></div><small>Regionen entdecken · suchen · teleportieren</small></header>
|
||||
<header><h1>Stadt NexVerse · Interaktive Weltkarte</h1><small>MapLibre · Originale Warp3D-Regionen · Suche · Teleport</small></header>
|
||||
<main>
|
||||
<aside>
|
||||
<h2>Region finden</h2>
|
||||
<form id="searchForm" autocomplete="off"><input id="search" aria-label="Region suchen" placeholder="Regionsname suchen (mind. 2 Zeichen)" maxlength="80"><button type="submit">Suchen</button></form>
|
||||
<div id="status" class="status" role="status" aria-live="polite">Lade Weltkarte …</div>
|
||||
<div id="results" aria-label="Suchergebnisse"></div>
|
||||
<p>Die interaktive Karte zeigt alle erreichbaren veröffentlichten Regionen in beliebigen Kartenausschnitten. Die Warp3D-Bilder werden aus dem OpenSim MapImageService geladen. Leere oder nicht verfügbare Regionen bleiben frei.</p>
|
||||
<form id="searchForm"><input id="search" maxlength="80" placeholder="Region suchen …" aria-label="Region suchen"><button type="submit">Suchen</button></form>
|
||||
<div id="state" role="status" aria-live="polite">Karte wird geladen …</div>
|
||||
<div id="results"></div>
|
||||
<div id="details"><h2 id="name"></h2><p id="desc"></p><a id="teleport" target="_blank" rel="noopener noreferrer">In diese Region teleportieren ↗</a></div>
|
||||
<p id="notes">Eigene Kartendaten von OpenGenesisLINK. Rasterkoordinaten sind virtuell und keine realen geographischen Standorte. Kartenbilder werden ausschließlich vom eigenen ROBUST-MapImageService geliefert.</p>
|
||||
</aside>
|
||||
<section aria-label="Interaktive NexVerse-Weltkarte">
|
||||
<div id="world" role="application" aria-label="Weltkarte ziehen zum Verschieben"><div id="layers"></div></div>
|
||||
<div id="controls"><button id="north" title="Nach Norden">↑</button><button id="west" title="Nach Westen">←</button><button id="east" title="Nach Osten">→</button><button id="south" title="Nach Süden">↓</button><button id="zoomIn" title="Vergrößern">+</button><button id="zoomOut" title="Verkleinern">−</button></div>
|
||||
<div id="info" aria-live="polite"><h3 id="selectedName"></h3><p id="selectedDetails"></p><a id="teleport" rel="noopener noreferrer" target="_blank">In diese Region teleportieren ↗</a></div>
|
||||
<div id="coords" aria-live="polite">–</div>
|
||||
</section>
|
||||
<div style="position:relative;min-height:420px"><div id="map"></div><div id="coords">–</div></div>
|
||||
</main>
|
||||
<script>
|
||||
(() => {
|
||||
'use strict';
|
||||
const $=id=>document.getElementById(id), world=$('world'), layers=$('layers');
|
||||
const status=$('status'), results=$('results'), info=$('info');
|
||||
const deutschland=location.pathname.toLowerCase().startsWith('/api/v1/deutschland');
|
||||
const apiRoot=deutschland?'/api/v1/deutschland':'/api/v1/world-map';
|
||||
if(deutschland){
|
||||
document.title='Stadt NexVerse · Deutschland';
|
||||
document.querySelector('header h1').textContent='Deutschland · Warp3D-Karte';
|
||||
}
|
||||
let center={x:1000,y:1000}, axis=12, bounds=null, requestId=0, drag=null;
|
||||
const axisChoices=[3,5,8,12,16];
|
||||
const clamp=n=>Math.max(0,Math.min(8388606,Math.round(n)));
|
||||
function view(){
|
||||
const half=Math.floor(axis/2), minX=clamp(center.x-half), minY=clamp(center.y-half);
|
||||
return {min_x:minX,max_x:Math.min(8388606,minX+axis-1),min_y:minY,max_y:Math.min(8388606,minY+axis-1)};
|
||||
}
|
||||
function setStatus(t){status.textContent=t;}
|
||||
function add(tag,cl,parent,text){
|
||||
const e=document.createElement(tag);if(cl)e.className=cl;if(text!==undefined)e.textContent=text;
|
||||
parent.appendChild(e);return e;
|
||||
}
|
||||
function select(r){
|
||||
$('selectedName').textContent=r.name;
|
||||
$('selectedDetails').textContent='Raster '+r.grid_x+' / '+r.grid_y+' · '+r.size_x+' × '+r.size_y+' m · Reifegrad '+(['Allgemein','Moderat','Adult'][r.maturity]||r.maturity);
|
||||
const link=$('teleport');
|
||||
if(r.teleport_uri){link.href=r.teleport_uri;link.style.display='inline';}
|
||||
else{link.removeAttribute('href');link.style.display='none';}
|
||||
info.style.display='block';
|
||||
}
|
||||
function draw(data){
|
||||
if(!data.bounds)return;
|
||||
bounds=data.bounds;
|
||||
const b=bounds, rect=world.getBoundingClientRect();
|
||||
const cellsX=b.max_x-b.min_x+1,cellsY=b.max_y-b.min_y+1;
|
||||
const unit=Math.min(rect.width/cellsX,rect.height/cellsY);
|
||||
const width=cellsX*unit,height=cellsY*unit, left=(rect.width-width)/2,top=(rect.height-height)/2;
|
||||
layers.replaceChildren();
|
||||
const pos=(x,y)=>({x:left+(x-b.min_x)*unit,y:top+(b.max_y-y)*unit});
|
||||
for(let y=b.min_y;y<=b.max_y;y++){
|
||||
for(let x=b.min_x;x<=b.max_x;x++){
|
||||
const p=pos(x,y),cell=add('div','tile',layers);
|
||||
Object.assign(cell.style,{left:p.x+'px',top:p.y+'px',width:unit+'px',height:unit+'px'});
|
||||
const im=document.createElement('img');im.loading='lazy';im.decoding='async';im.alt='';
|
||||
im.src=(data.tile_url_template||'/map/map-1-{x}-{y}-objects.jpg')
|
||||
.replace('{x}',String(x)).replace('{y}',String(y));
|
||||
im.onerror=()=>im.remove();cell.appendChild(im);
|
||||
}
|
||||
}
|
||||
for(const r of (data.regions||[])){
|
||||
const p=pos(r.grid_x,r.grid_y+r.cells_y-1);
|
||||
const card=add('div','region',layers);
|
||||
Object.assign(card.style,{left:p.x+'px',top:p.y+'px',width:(r.cells_x*unit)+'px',height:(r.cells_y*unit)+'px'});
|
||||
const button=add('button','',card,r.name);button.type='button';
|
||||
button.title=r.name+' ansehen';button.onclick=()=>select(r);
|
||||
}
|
||||
$('coords').textContent='Raster '+b.min_x+'–'+b.max_x+' / '+b.min_y+'–'+b.max_y+' · '+(data.regions||[]).length+' Regionen';
|
||||
}
|
||||
async function load(defaultView=false){
|
||||
const current=++requestId;
|
||||
const v=view();const p=new URLSearchParams(defaultView?{}:v);
|
||||
setStatus('Kartenbereich wird geladen …');
|
||||
try{
|
||||
const response=await fetch(apiRoot+(p.size?'?'+p:''),{cache:'no-store'});
|
||||
if(!response.ok)throw Error('HTTP '+response.status);
|
||||
const data=await response.json();if(current!==requestId)return;
|
||||
if(!data.bounds){setStatus('Keine Standardregion gefunden. Bitte nach einer Region suchen.');return;}
|
||||
center={x:Math.floor((data.bounds.min_x+data.bounds.max_x)/2),y:Math.floor((data.bounds.min_y+data.bounds.max_y)/2)};
|
||||
draw(data);setStatus((data.regions||[]).length+' Regionen im aktuellen Ausschnitt.');
|
||||
}catch(error){if(current===requestId)setStatus('Kartenfehler: '+error.message);}
|
||||
}
|
||||
async function search(event){
|
||||
event.preventDefault();
|
||||
const q=$('search').value.trim();
|
||||
if(q.length<2){setStatus('Bitte mindestens zwei Zeichen eingeben.');return;}
|
||||
setStatus('Suche läuft …');results.replaceChildren();
|
||||
try{
|
||||
const response=await fetch(apiRoot+'?q='+encodeURIComponent(q),{cache:'no-store'});
|
||||
if(!response.ok)throw Error('HTTP '+response.status);
|
||||
const data=await response.json(), found=data.regions||[];
|
||||
setStatus(found.length+' passende Regionen gefunden.');
|
||||
for(const r of found){
|
||||
const button=add('button','result',results);button.type='button';
|
||||
add('strong','',button,r.name);add('span','',button,'Raster '+r.grid_x+' / '+r.grid_y);
|
||||
button.onclick=()=>{center={x:r.grid_x,y:r.grid_y};select(r);load();};
|
||||
}
|
||||
if(found.length===1)results.firstChild.click();
|
||||
}catch(error){setStatus('Suche fehlgeschlagen: '+error.message);}
|
||||
}
|
||||
$('searchForm').addEventListener('submit',search);
|
||||
$('north').onclick=()=>{center.y=clamp(center.y+3);load();};
|
||||
$('south').onclick=()=>{center.y=clamp(center.y-3);load();};
|
||||
$('east').onclick=()=>{center.x=clamp(center.x+3);load();};
|
||||
$('west').onclick=()=>{center.x=clamp(center.x-3);load();};
|
||||
$('zoomIn').onclick=()=>{axis=axisChoices[Math.max(0,axisChoices.indexOf(axis)-1)];load();};
|
||||
$('zoomOut').onclick=()=>{axis=axisChoices[Math.min(axisChoices.length-1,axisChoices.indexOf(axis)+1)];load();};
|
||||
world.addEventListener('pointerdown',e=>{if(e.button!==0||e.target.closest('button'))return;drag={x:e.clientX,y:e.clientY,centerX:center.x,centerY:center.y};world.setPointerCapture(e.pointerId);world.classList.add('dragging');});
|
||||
world.addEventListener('pointerup',e=>{
|
||||
if(!drag)return;
|
||||
const moved=Math.hypot(e.clientX-drag.x,e.clientY-drag.y);
|
||||
if(moved>7){
|
||||
const size=Math.min(world.clientWidth,world.clientHeight)/axis;
|
||||
center.x=clamp(drag.centerX-(e.clientX-drag.x)/size);
|
||||
center.y=clamp(drag.centerY+(e.clientY-drag.y)/size);
|
||||
layers.style.transform='';load();
|
||||
}
|
||||
drag=null;world.classList.remove('dragging');
|
||||
<script type="module">
|
||||
import * as maplibregl from 'https://unpkg.com/maplibre-gl@6.15.0/dist/maplibre-gl.mjs';
|
||||
const $=id=>document.getElementById(id);
|
||||
const apiRoot=location.pathname.toLowerCase().startsWith('/api/v1/deutschland')
|
||||
?'/api/v1/deutschland':'/api/v1/world-map';
|
||||
const AXIS=2**24,SHIFT=2**22,MAX=8388606;
|
||||
const toCoords=(x,y)=>{
|
||||
const mx=(x+SHIFT+.5)/AXIS,my=1-(y+SHIFT+.5)/AXIS;
|
||||
return [mx*360-180,Math.atan(Math.sinh(Math.PI*(1-2*my)))*180/Math.PI];
|
||||
};
|
||||
const toGrid=(lng,lat)=>{
|
||||
const v=Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,lat))*Math.PI/360));
|
||||
return {x:Math.round((lng+180)/360*AXIS-SHIFT),
|
||||
y:Math.round((1-(1-v/Math.PI)/2)*AXIS-SHIFT)};
|
||||
};
|
||||
let map,revision=0,selected=null;
|
||||
function state(v){$('state').textContent=v;}
|
||||
function select(r){
|
||||
selected=r;
|
||||
$('details').style.display='block';
|
||||
$('name').textContent=r.name;
|
||||
$('desc').textContent='Grid '+r.grid_x+' / '+r.grid_y+' · '+r.size_x+' × '+r.size_y+' Meter';
|
||||
const a=$('teleport');
|
||||
if(r.teleport_uri){a.href=r.teleport_uri;a.style.display='inline';}
|
||||
else{a.removeAttribute('href');a.style.display='none';}
|
||||
}
|
||||
function geo(data){
|
||||
const features=(data.regions||[]).map(r=>{
|
||||
const x=r.grid_x,y=r.grid_y,ex=x+r.cells_x,ey=y+r.cells_y;
|
||||
const corners=[[x,y],[ex,y],[ex,ey],[x,ey],[x,y]]
|
||||
.map(p=>toCoords(p[0]-.5,p[1]-.5));
|
||||
return {type:'Feature',properties:{name:r.name,region_id:r.region_id,
|
||||
grid_x:x,grid_y:y,description:r.size_x+' × '+r.size_y+' m',teleport_uri:r.teleport_uri||''},
|
||||
geometry:{type:'Polygon',coordinates:[corners]}};
|
||||
});
|
||||
world.addEventListener('pointercancel',()=>{drag=null;layers.style.transform='';world.classList.remove('dragging');});
|
||||
world.addEventListener('pointermove',e=>{
|
||||
if(!drag)return;
|
||||
layers.style.transform='translate('+(e.clientX-drag.x)+'px,'+(e.clientY-drag.y)+'px)';
|
||||
map.getSource('regions').setData({type:'FeatureCollection',features});
|
||||
}
|
||||
async function viewport(){
|
||||
if(!map)return;
|
||||
const id=++revision,center=toGrid(...map.getCenter().toArray());
|
||||
const bounds=map.getBounds(),sw=toGrid(bounds.getWest(),bounds.getSouth()),
|
||||
ne=toGrid(bounds.getEast(),bounds.getNorth());
|
||||
// Public endpoint is deliberately limited to a bounded 16x16 viewport.
|
||||
const axis=16,minX=Math.max(0,Math.min(MAX-axis,Math.floor((sw.x+ne.x)/2)-axis/2)),
|
||||
minY=Math.max(0,Math.min(MAX-axis,Math.floor((sw.y+ne.y)/2)-axis/2));
|
||||
const qs=new URLSearchParams({min_x:minX,max_x:minX+axis-1,
|
||||
min_y:minY,max_y:minY+axis-1});
|
||||
state('Lade Regionen im Kartenausschnitt …');
|
||||
try{
|
||||
const response=await fetch('/api/v1/deutschland?'+qs,{cache:'no-store'});
|
||||
if(!response.ok)throw Error('HTTP '+response.status);
|
||||
const data=await response.json();if(id!==revision)return;
|
||||
geo(data);state((data.regions||[]).length+' Regionen im 16×16-Rasterausschnitt.');
|
||||
$('coords').textContent='Grid '+center.x+' / '+center.y+' · Zoom '+map.getZoom().toFixed(1);
|
||||
}catch(e){if(id===revision)state('Kartenabfrage fehlgeschlagen: '+e.message);}
|
||||
}
|
||||
async function search(e){
|
||||
e.preventDefault();const q=$('search').value.trim();if(q.length<2){state('Mindestens zwei Zeichen eingeben.');return;}
|
||||
$('results').replaceChildren();state('Suche läuft …');
|
||||
try{
|
||||
const r=await fetch(apiRoot+'?q='+encodeURIComponent(q),{cache:'no-store'});
|
||||
if(!r.ok)throw Error('HTTP '+r.status);
|
||||
const data=await r.json();state((data.regions||[]).length+' Regionen gefunden.');
|
||||
for(const reg of data.regions||[]){
|
||||
const b=document.createElement('button');b.className='result';b.type='button';
|
||||
b.textContent=reg.name+' · '+reg.grid_x+'/'+reg.grid_y;
|
||||
b.onclick=()=>{select(reg);map.flyTo({center:toCoords(reg.grid_x,reg.grid_y),zoom:22});};
|
||||
$('results').append(b);
|
||||
}
|
||||
}catch(e){state('Suche fehlgeschlagen: '+e.message);}
|
||||
}
|
||||
$('searchForm').addEventListener('submit',search);
|
||||
const base={version:8,sources:{
|
||||
warp:{type:'raster',tiles:['/api/v1/deutschland/xyz/{z}/{x}/{y}.jpg'],
|
||||
tileSize:256,minzoom:17,maxzoom:24,attribution:'© Stadt NexVerse · OpenGenesisLINK'},
|
||||
regions:{type:'geojson',data:{type:'FeatureCollection',features:[]}}
|
||||
},layers:[
|
||||
{id:'water',type:'background',paint:{'background-color':'#123247'}},
|
||||
{id:'warp3d',type:'raster',source:'warp',paint:{'raster-opacity':1}},
|
||||
{id:'region-fill',type:'fill',source:'regions',paint:{'fill-color':'#19b1e4','fill-opacity':.07}},
|
||||
{id:'region-outline',type:'line',source:'regions',paint:{'line-color':'#8bdffd','line-width':2}},
|
||||
{id:'region-label',type:'symbol',source:'regions',layout:{'text-field':['get','name'],
|
||||
'text-size':12,'text-allow-overlap':false},paint:{'text-color':'#fff','text-halo-color':'#09182a','text-halo-width':2}}
|
||||
]};
|
||||
async function init(){
|
||||
let cx=1000,cy=1010;
|
||||
try{
|
||||
const r=await fetch(apiRoot,{cache:'no-store'});
|
||||
if(r.ok){const data=await r.json();if(data.bounds){cx=Math.floor((data.bounds.min_x+data.bounds.max_x)/2);
|
||||
cy=Math.floor((data.bounds.min_y+data.bounds.max_y)/2);}}
|
||||
}catch{}
|
||||
map=new maplibregl.Map({container:'map',style:base,center:toCoords(cx,cy),
|
||||
zoom:22,minZoom:17,maxZoom:24,renderWorldCopies:false,
|
||||
dragRotate:false,pitchWithRotate:false,attributionControl:true});
|
||||
map.addControl(new maplibregl.NavigationControl({showCompass:false}),'top-right');
|
||||
map.on('load',viewport);map.on('moveend',viewport);
|
||||
map.on('mousemove',e=>{const g=toGrid(e.lngLat.lng,e.lngLat.lat);
|
||||
$('coords').textContent='Grid '+g.x+' / '+g.y+' · Zoom '+map.getZoom().toFixed(1);});
|
||||
map.on('click','region-fill',e=>{
|
||||
const p=e.features?.[0]?.properties;if(p)select({...p,name:p.name,
|
||||
size_x:p.description,size_y:'',grid_x:p.grid_x,grid_y:p.grid_y});
|
||||
});
|
||||
world.addEventListener('wheel',e=>{e.preventDefault();if(e.deltaY<0)$('zoomIn').click();else $('zoomOut').click();},{passive:false});
|
||||
addEventListener('resize',()=>{if(bounds)load();});
|
||||
load(true);
|
||||
})();
|
||||
</script>
|
||||
</body></html>
|
||||
}
|
||||
init().catch(e=>state('MapLibre konnte nicht gestartet werden: '+e.message));
|
||||
</script></body></html>
|
||||
""";
|
||||
}
|
||||
}
|
||||
@@ -318,7 +318,7 @@ namespace NexVerse.Server.Api
|
||||
"/api/v1/statistics/summary",
|
||||
apiGate.Wrap(statisticsRoute.Summary),
|
||||
"NexVerse statistics summary"));
|
||||
m_Log.Info("[NEX-WORLD-API]: Statistics summary route registered.");
|
||||
m_Log.Info("[NEX-WORLD-API]: Endpunkt für Statistikübersicht registriert.");
|
||||
|
||||
server.AddSimpleStreamHandler(new SimpleStreamHandler("/api/v1/version", apiGate.Wrap(handlers.Version), "NexVerse World API Version"));
|
||||
server.AddSimpleStreamHandler(new SimpleStreamHandler("/api/v1/capabilities", apiGate.Wrap(handlers.Capabilities), "NexVerse World API Capabilities"));
|
||||
@@ -590,7 +590,7 @@ namespace NexVerse.Server.Api
|
||||
oidcKeyPath,
|
||||
oidcTokenLifetimeSeconds);
|
||||
|
||||
m_Log.Info("[NEX-WORLD-API]: NexVerse native scoped access tokens and persistent OAuth/OIDC are enabled.");
|
||||
m_Log.Info("[NEX-WORLD-API]: Bereichsgebundene Zugriffstoken und dauerhaftes OAuth/OIDC sind aktiv.");
|
||||
}
|
||||
|
||||
NexApiAuthenticator authenticator = new NexApiAuthenticator(
|
||||
@@ -654,6 +654,13 @@ namespace NexVerse.Server.Api
|
||||
apiGate.Wrap(portalRegistration.Handle),
|
||||
"OpenGenesisLINK Stadtportal avatar registration"));
|
||||
|
||||
// Name checks are backend-to-backend and use the same
|
||||
// users:register machine key as the final POST.
|
||||
server.AddSimpleStreamHandler(new SimpleStreamHandler(
|
||||
"/api/v1/portal/avatars/name-availability",
|
||||
apiGate.Wrap(portalRegistration.HandleNameAvailability),
|
||||
"OpenGenesisLINK Stadtportal live avatar name lookup"));
|
||||
|
||||
NexUserApiRouter userRouter = new NexUserApiRouter(
|
||||
userService,
|
||||
authenticator,
|
||||
@@ -783,8 +790,8 @@ namespace NexVerse.Server.Api
|
||||
experienceStorePath);
|
||||
AppDomain.CurrentDomain.ProcessExit +=
|
||||
(_, __) => experienceStore.Dispose();
|
||||
m_Log.Info("[NEX-EXPERIENCES]: SingleWriterJson authority acquired. " +
|
||||
"One Robust writer only; no cross-host shared-file failover.");
|
||||
m_Log.Info("[NEX-EXPERIENCES]: Exklusive Schreibberechtigung für den JSON-Datenspeicher übernommen. " +
|
||||
"Es darf nur einen schreibenden ROBUST-Knoten geben; kein dateibasierter Failover zwischen Hosts.");
|
||||
|
||||
NexExperiencesApi experiencesApi =
|
||||
new NexExperiencesApi(
|
||||
@@ -1063,7 +1070,7 @@ namespace NexVerse.Server.Api
|
||||
"NexVerse WebProfileV3"),
|
||||
true);
|
||||
|
||||
m_Log.Info("[NEX-WEBPROFILE-V3]: WebProfileV3 enabled using the authoritative UserProfilesService store.");
|
||||
m_Log.Info("[NEX-WEBPROFILE-V3]: Avatarprofile über den maßgeblichen UserProfilesService-Datenspeicher aktiviert.");
|
||||
}
|
||||
|
||||
// Preserve authenticated statistics: the early route now delegates
|
||||
@@ -1139,17 +1146,17 @@ namespace NexVerse.Server.Api
|
||||
new SimpleStreamHandler("/api", apiGate.Wrap(userRouter.Handle), "NexVerse World API privileged router"),
|
||||
true);
|
||||
|
||||
m_Log.Warn("[NEX-WORLD-API]: Privileged endpoints are enabled. Use only over a transport that protects bearer tokens.");
|
||||
m_Log.Warn("[NEX-WORLD-API]: Sicherheitswarnung: Administrative API-Endpunkte sind aktiv. Zugriffstoken ausschließlich über geschützte Transportverbindungen übertragen.");
|
||||
}
|
||||
else
|
||||
{
|
||||
// The already-registered route lazily loads the same public
|
||||
// aggregate services; no duplicate handler or database plugin.
|
||||
m_Log.Info(
|
||||
"[NEX-WORLD-API]: Privileged endpoints are disabled; privacy-safe aggregate statistics remain available.");
|
||||
"[NEX-WORLD-API]: Administrative API-Endpunkte deaktiviert; datenschutzgerechte aggregierte Statistiken bleiben verfügbar.");
|
||||
}
|
||||
|
||||
m_Log.InfoFormat("[NEX-WORLD-API]: World API {0} enabled at {1}/api/v1", Core.NexVersePlatform.ApiVersion, publicBaseUrl);
|
||||
m_Log.InfoFormat("[NEX-WORLD-API]: World API {0} aktiviert unter {1}/api/v1", Core.NexVersePlatform.ApiVersion, publicBaseUrl);
|
||||
}
|
||||
|
||||
private static INexEventBus CreateEventBus(IConfigSource config, IHttpServer server)
|
||||
@@ -1199,7 +1206,7 @@ namespace NexVerse.Server.Api
|
||||
new SimpleStreamHandler(inboundPath, endpoint.Handle, "NexBus peer transport"));
|
||||
|
||||
m_Log.WarnFormat(
|
||||
"[NEXBUS]: Distributed HTTP transport enabled for node {0} with {1} configured peer(s). Protect this transport with TLS/firewall policy.",
|
||||
"[NEXBUS]: Verteilter HTTP-Transport für Knoten {0} mit {1} Gegenstelle(n) aktiv. Sicherheitswarnung: TLS und Firewall-Zugriffsregeln erforderlich.",
|
||||
nodeId,
|
||||
peers.Length);
|
||||
|
||||
|
||||
@@ -209,11 +209,16 @@ namespace NexVerse.Server.Api
|
||||
("post", "NV$-Konto sperren, freigeben oder schließen", "admin:*", "200")),
|
||||
["/api/v1/economy/accounts/ensure"] = AuthenticatedOperations(
|
||||
("post", "Vertrauenswürdiges Gruppen-, Business-, Estate- oder Objekt-Wallet provisionieren", "economy:transfer (service/admin)", "200")),
|
||||
["/api/v1/portal/avatars/register"] = AuthenticatedOperations(
|
||||
("post", "Stadtportal-Avatar mit users:register-Maschinenkey anlegen (Home und Last setzen)", "users:register", "201")),
|
||||
["/api/v1/portal/avatars/name-availability"] = AuthenticatedOperations(
|
||||
("get", "Live-Namenspruefung (leerer last_name wird Resident); nur Stadtportal-Backend und users:register-Maschinenkey", "users:register", "200")),
|
||||
["/api/v1/world-map"] = GetOperation("Oeffentliche Weltkarte: Regionen und Kartenkachel-Koordinaten in begrenztem Rasterfenster"),
|
||||
["/api/v1/world-map/view"] = GetOperation("Interaktive, einbettbare Weltkarte fuer das NexVerse Buergerportal"),
|
||||
["/api/v1/deutschland"] = GetOperation("Stadt NexVerse Deutschland: oeffentliche Warp3D-Kartenmetadaten und Regionssuche, begrenzte Viewports"),
|
||||
["/api/v1/deutschland/view"] = GetOperation("Interaktive Stadt NexVerse Deutschland-Karte mit Warp3D-Regionenkacheln"),
|
||||
["/api/v1/deutschland/tiles/{zoom}/{x}/{y}.jpg"] = GetOperation("Oeffentliche Original-Warp3D-Kartenkacheln von sichtbaren Regionen, Zoom 1 bis 8; 256 Pixel JPEG"),
|
||||
["/api/v1/deutschland/xyz/{z}/{x}/{y}.jpg"] = GetOperation("MapLibre-kompatible XYZ-Kartenbilder (synthetische Gridkoordinaten, z 17 bis 24)"),
|
||||
["/api/v1/search"] = GetOperation(
|
||||
"NexSearch über Personen, Gruppen, Regionen, Parcels, Places, Events, Land, Classifieds, Experiences und Destinations"),
|
||||
["/api/v1/places"] = MergeOperations(
|
||||
|
||||
@@ -79,22 +79,15 @@ namespace NexVerse.Server.Api
|
||||
return allowed.Contains(value);
|
||||
}
|
||||
|
||||
public void Handle(IOSHttpRequest request, IOSHttpResponse response)
|
||||
// Both signup and live name lookup must share identical
|
||||
// transport, enablement and machine-key security requirements.
|
||||
private bool AuthorizePortal(IOSHttpRequest request, IOSHttpResponse response)
|
||||
{
|
||||
response.AddHeader("Cache-Control", "no-store");
|
||||
response.AddHeader("X-Content-Type-Options", "nosniff");
|
||||
if (request == null || !string.Equals(request.HttpMethod, "POST", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
response.AddHeader("Allow", "POST");
|
||||
Reply(response, HttpStatusCode.MethodNotAllowed,
|
||||
"method_not_allowed", "POST ist erforderlich.");
|
||||
return;
|
||||
}
|
||||
if (!m_Enabled || m_Provisioner == null)
|
||||
{
|
||||
Reply(response, HttpStatusCode.ServiceUnavailable,
|
||||
"registration_disabled", "Avatarregistrierung ist derzeit nicht freigeschaltet.");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// A KeyHelp proxy may terminate HTTPS on another host before
|
||||
@@ -114,7 +107,7 @@ namespace NexVerse.Server.Api
|
||||
{
|
||||
Reply(response, HttpStatusCode.Forbidden,
|
||||
"https_required", "Eine verschluesselte Verbindung ist erforderlich.");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Restrict this route to a machine credential, not interactive
|
||||
@@ -128,8 +121,76 @@ namespace NexVerse.Server.Api
|
||||
response.AddHeader("WWW-Authenticate", "ApiKey");
|
||||
Reply(response, HttpStatusCode.Unauthorized, "unauthorized_portal",
|
||||
"Portalzugang nicht autorisiert.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read-only preflight. The final POST repeats this authoritative
|
||||
/// lookup; this response must never be interpreted as a reservation.
|
||||
/// </summary>
|
||||
public void HandleNameAvailability(IOSHttpRequest request, IOSHttpResponse response)
|
||||
{
|
||||
response.AddHeader("Cache-Control", "no-store");
|
||||
response.AddHeader("X-Content-Type-Options", "nosniff");
|
||||
if (request == null || !string.Equals(request.HttpMethod, "GET", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
response.AddHeader("Allow", "GET");
|
||||
Reply(response, HttpStatusCode.MethodNotAllowed,
|
||||
"method_not_allowed", "GET ist erforderlich.");
|
||||
return;
|
||||
}
|
||||
if (!AuthorizePortal(request, response))
|
||||
return;
|
||||
|
||||
string first = (request.QueryString?["first_name"] ?? string.Empty).Trim();
|
||||
string last = (request.QueryString?["last_name"] ?? string.Empty).Trim();
|
||||
if (string.IsNullOrWhiteSpace(last))
|
||||
last = "Resident";
|
||||
if (!IsValidName(first) || !IsValidName(last))
|
||||
{
|
||||
Reply(response, HttpStatusCode.BadRequest, "invalid_avatar_name",
|
||||
"Vor- und Nachname müssen 2 bis 31 gültige Zeichen besitzen.");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
bool available = m_Accounts.GetUserAccount(UUID.Zero, first, last) == null;
|
||||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
response.ContentType = "application/json; charset=utf-8";
|
||||
response.RawBuffer = JsonSerializer.SerializeToUtf8Bytes(new
|
||||
{
|
||||
available,
|
||||
status = available ? "available" : "taken",
|
||||
first_name = first,
|
||||
last_name = last,
|
||||
avatar_name = first + " " + last
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_Log.Error("[OGL PORTAL REGISTRATION]: Name availability lookup failed; correlation_id=" +
|
||||
NexApiRequestContext.Ensure(response), e);
|
||||
Reply(response, HttpStatusCode.ServiceUnavailable, "name_check_unavailable",
|
||||
"Namensprüfung ist momentan nicht verfügbar.");
|
||||
}
|
||||
}
|
||||
|
||||
public void Handle(IOSHttpRequest request, IOSHttpResponse response)
|
||||
{
|
||||
response.AddHeader("Cache-Control", "no-store");
|
||||
response.AddHeader("X-Content-Type-Options", "nosniff");
|
||||
if (request == null || !string.Equals(request.HttpMethod, "POST", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
response.AddHeader("Allow", "POST");
|
||||
Reply(response, HttpStatusCode.MethodNotAllowed,
|
||||
"method_not_allowed", "POST ist erforderlich.");
|
||||
return;
|
||||
}
|
||||
if (!AuthorizePortal(request, response))
|
||||
return;
|
||||
|
||||
if (request.ContentLength64 > MaxBodyCharacters * 4L ||
|
||||
request.ContentLength64 < 0 && !request.HasEntityBody)
|
||||
|
||||
@@ -263,13 +263,13 @@ namespace OpenSim.Data
|
||||
|
||||
private void InsertVersion(string type, int version)
|
||||
{
|
||||
m_log.InfoFormat("[MIGRATIONS]: Creating {0} at version {1}", type, version);
|
||||
m_log.InfoFormat("[DATENBANK]: Erstelle {0} mit Version {1}", type, version);
|
||||
ExecuteScript("insert into migrations(name, version) values('" + type + "', " + version + ")");
|
||||
}
|
||||
|
||||
private void UpdateVersion(string type, int version)
|
||||
{
|
||||
m_log.InfoFormat("[MIGRATIONS]: Updating {0} to version {1}", type, version);
|
||||
m_log.InfoFormat("[DATENBANK]: Aktualisiere {0} auf Version {1}", type, version);
|
||||
ExecuteScript("update migrations set version=" + version + " where name='" + type + "'");
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ scan_old_style:
|
||||
}
|
||||
|
||||
if (migrations.Count < 1)
|
||||
m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after);
|
||||
m_log.DebugFormat("[DATENBANK]: {0} – Tabellen sind auf aktuellem Stand (Revision {1})", _type, after);
|
||||
|
||||
return migrations;
|
||||
}
|
||||
|
||||
@@ -1992,7 +1992,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
/// </param>
|
||||
public void Start(bool performPollResponsesAsync, bool runPool)
|
||||
{
|
||||
m_log.Info($"[BASE HTTP SERVER]: Starting HTTP{(UseSSL ? "S" : "")} server on port {Port}");
|
||||
m_log.Info($"[HTTP-SERVER]: Starte HTTP{(UseSSL ? "S" : "")} auf Port {Port}");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -129,15 +129,15 @@ namespace OpenSim.Framework.Servers
|
||||
{
|
||||
// FIXME: This should be done down in ServerBase but we need to sort out and refactor the log4net
|
||||
// XmlConfigurator calls first accross servers.
|
||||
m_log.Info($"[SERVER BASE]: Starting in {m_startupDirectory}");
|
||||
m_log.Info($"[SERVER BASE]: Arbeitsverzeichnis: {m_startupDirectory}");
|
||||
|
||||
m_log.Info($"[SERVER BASE]: OpenSimulator version: {m_version}");
|
||||
m_log.Info($"[SERVER BASE]: OpenGenesisLINK-Version: {m_version}");
|
||||
|
||||
// clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
|
||||
// the clr version number doesn't match the project version number under Mono.
|
||||
//m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
|
||||
m_log.Info(
|
||||
$"[SERVER BASE]: Operating system version: {Environment.OSVersion}, .NET platform {Util.RuntimePlatformStr}, {(Environment.Is64BitProcess ? "64" : "32")}-bit");
|
||||
$"[SERVER BASE]: Betriebssystem: {Environment.OSVersion}, .NET-Plattform: {Util.RuntimePlatformStr}, {(Environment.Is64BitProcess ? "64" : "32")}-bit");
|
||||
}
|
||||
|
||||
public void RegisterCommonAppenders(IConfig startupConfig)
|
||||
@@ -188,7 +188,7 @@ namespace OpenSim.Framework.Servers
|
||||
m_logFileAppender.ActivateOptions();
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[SERVER BASE]: Logging started to file {0}", m_logFileAppender.File);
|
||||
m_log.InfoFormat("[SERVER BASE]: Protokolldatei geöffnet: {0}", m_logFileAppender.File);
|
||||
}
|
||||
|
||||
if (m_statsLogFileAppender != null && startupConfig != null)
|
||||
@@ -200,7 +200,7 @@ namespace OpenSim.Framework.Servers
|
||||
m_statsLogFileAppender.ActivateOptions();
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[SERVER BASE]: Stats Logging started to file {0}", m_statsLogFileAppender.File);
|
||||
m_log.InfoFormat("[SERVER BASE]: Statistikprotokoll geöffnet: {0}", m_statsLogFileAppender.File);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,10 +87,10 @@ namespace OpenSim.Server.Handlers.Inventory
|
||||
if (publicHypergridInventory)
|
||||
{
|
||||
if (allowLegacyPublicHypergridInventory)
|
||||
m_log.Warn("[OGL SECURITY][LEGACY HG]: Public /xinventory explicitly " +
|
||||
"ENABLED without verified per-avatar authorization. " +
|
||||
"Unauthorized inventory reads/writes may be possible. " +
|
||||
"Disable AllowLegacyPublicHGInventory when no longer required.");
|
||||
m_log.Warn("[OGL SECURITY][LEGACY HG]: Öffentliches /xinventory ausdrücklich " +
|
||||
"AKTIVIERT, ohne verifizierte Avatar-Autorisierung. " +
|
||||
"Unberechtigte Inventar-Lese- und Schreibzugriffe sind möglicherweise möglich. " +
|
||||
"AllowLegacyPublicHGInventory deaktivieren, sobald nicht mehr erforderlich.");
|
||||
else
|
||||
m_log.Warn("[OGL SECURITY]: Public Hypergrid inventory access is blocked " +
|
||||
"until authenticated per-avatar authorization is implemented. " +
|
||||
|
||||
@@ -90,6 +90,58 @@ namespace OpenSim.Server
|
||||
}
|
||||
}
|
||||
|
||||
// Categories only organize log output; the real connector startup order
|
||||
// comes unchanged from [ServiceList] so dependencies stay intact.
|
||||
private static string GroupRobustService(string name)
|
||||
{
|
||||
if (name.Contains("Asset")) return "ASSETS";
|
||||
if (name.Contains("Inventory")) return "INVENTAR";
|
||||
if (name.Contains("Grid") || name.Contains("Map")) return "GRID-KARTE";
|
||||
if (name.Contains("UserAccount") || name.Contains("Avatar") ||
|
||||
name.Contains("Authentication") || name.Contains("Login") ||
|
||||
name.Contains("Preferences")) return "BENUTZER";
|
||||
if (name.Contains("Friend") || name.Contains("Message") ||
|
||||
name.Contains("Groups") || name.Contains("Mute")) return "SOZIALES";
|
||||
if (name.Contains("Economy")) return "WAEHRUNG";
|
||||
if (name.Contains("WorldApi")) return "WORLD-API";
|
||||
if (name.Contains("Gatekeeper") || name.Contains("UserAgent") ||
|
||||
name.Contains("Helo")) return "HYPERGRID";
|
||||
return "SYSTEM";
|
||||
}
|
||||
|
||||
private static string DescribeRobustService(string name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "AssetServiceConnector": return "Asset-Dienst";
|
||||
case "XInventoryInConnector": return "Inventar-Schnittstelle";
|
||||
case "GridServiceConnector": return "Grid-Verzeichnis";
|
||||
case "GridInfoServerInConnector": return "Grid-Informationen";
|
||||
case "NexVerseWorldApiConnector": return "Stadt NexVerse World API";
|
||||
case "NexEconomyConnector": return "NV$-Waehrungsdienst";
|
||||
case "AuthenticationServiceConnector": return "Benutzer-Authentifizierung";
|
||||
case "AvatarServiceConnector": return "Avatar-Dienst";
|
||||
case "LLLoginServiceInConnector": return "Viewer-Anmeldung";
|
||||
case "PresenceServiceConnector": return "Online-Praesenz";
|
||||
case "UserAccountServiceConnector": return "Benutzerkonten";
|
||||
case "GridUserServiceConnector": return "Grid-Benutzerpositionen";
|
||||
case "AgentPreferencesServiceConnector": return "Avatar-Einstellungen";
|
||||
case "FriendsServiceConnector": return "Freundesdienst";
|
||||
case "MapAddServiceConnector": return "Kartenbild-Empfang";
|
||||
case "MapGetServiceConnector": return "Kartenbild-Auslieferung";
|
||||
case "GroupsServiceRobustConnector": return "Gruppendienst";
|
||||
case "HGGroupsServiceRobustConnector": return "Hypergrid-Gruppen";
|
||||
case "UserProfilesConnector": return "Avatar-Profile";
|
||||
case "MuteListServiceConnector": return "Ignorierlisten";
|
||||
case "GatekeeperServiceInConnector": return "Hypergrid-Gatekeeper";
|
||||
case "UserAgentServerConnector": return "Hypergrid-Benutzeragent";
|
||||
case "HeloServiceInConnector": return "Hypergrid-Handshake";
|
||||
case "HGFriendsServerConnector": return "Hypergrid-Freunde";
|
||||
case "InstantMessageServerConnector": return "Sofortnachrichten";
|
||||
default: return "Erweiterungsdienst";
|
||||
}
|
||||
}
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
Culture.SetCurrentCulture();
|
||||
@@ -207,7 +259,10 @@ namespace OpenSim.Server
|
||||
if (friendlyName == "LLLoginServiceInConnector")
|
||||
server.AddSimpleStreamHandler(new IndexPHPHandler(server));
|
||||
|
||||
m_log.InfoFormat("[SERVER]: Loading {0} on port {1}", friendlyName, server.Port);
|
||||
string description = DescribeRobustService(friendlyName);
|
||||
string group = GroupRobustService(friendlyName);
|
||||
m_log.InfoFormat("[SERVER][{0}]: Starte {1} ({2}) auf Port {3}", group,
|
||||
description, friendlyName, server.Port);
|
||||
|
||||
IServiceConnector connector = null;
|
||||
|
||||
@@ -223,11 +278,11 @@ namespace OpenSim.Server
|
||||
if (connector != null)
|
||||
{
|
||||
m_ServiceConnectors.Add(connector);
|
||||
m_log.InfoFormat("[SERVER]: {0} loaded successfully", friendlyName);
|
||||
m_log.InfoFormat("[SERVER][{0}]: {1} ({2}) erfolgreich geladen", group, description, friendlyName);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[SERVER]: Failed to load {0}", conn);
|
||||
m_log.ErrorFormat("[SERVER][{0}]: Dienst {1} konnte nicht geladen werden ({2})", group, description, conn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenSim.Services.GridService
|
||||
public GridService(IConfigSource config)
|
||||
: base(config)
|
||||
{
|
||||
m_log.DebugFormat("[GRID SERVICE]: Starting...");
|
||||
m_log.DebugFormat("[GRID-DIENST]: Grid-Verzeichnis wird initialisiert.");
|
||||
|
||||
m_config = config;
|
||||
IConfig gridConfig = config.Configs["GridService"];
|
||||
|
||||
@@ -98,11 +98,11 @@ namespace OpenSim.Services.GridService
|
||||
if(!m_ThisGridInfo.HasHGConfig)
|
||||
throw new Exception("missing HyperGrid configuration");
|
||||
|
||||
m_log.DebugFormat("[HYPERGRID LINKER]: Local Gatekeeper: {0}", m_ThisGridInfo.GateKeeperURL);
|
||||
m_log.DebugFormat("[HYPERGRID]: Lokaler Gatekeeper: {0}", m_ThisGridInfo.GateKeeperURL);
|
||||
|
||||
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
|
||||
|
||||
m_log.Debug("[HYPERGRID LINKER]: Loaded all services...");
|
||||
m_log.Debug("[HYPERGRID]: Alle erforderlichen Dienste geladen.");
|
||||
|
||||
if (!string.IsNullOrEmpty(m_MapTileDirectory))
|
||||
{
|
||||
|
||||
@@ -91,6 +91,36 @@ Beispielantwort (Struktur):
|
||||
Das ist **nur ein Schema-Beispiel**, keine Behauptung über tatsächlich
|
||||
vorhandene Regions-UUIDs oder aktuelle Antwortdaten.
|
||||
|
||||
## MapLibre GL JS als Karten-Renderer
|
||||
|
||||
Die einbettbare Ansicht unter `/api/v1/deutschland/view` sowie die
|
||||
bestehende `/api/v1/world-map/view` verwenden jetzt **MapLibre GL JS 6.15.0**
|
||||
als echte Rasterkarten-Engine. Damit übernimmt MapLibre Pan, Zoom,
|
||||
Mausbedienung, interaktive Regionenpolygone, Navigationsbuttons und
|
||||
Suchsprünge. Die eigenen Warp3D-Rasterbilder werden über eine
|
||||
standardisierte XYZ-Schicht dargestellt:
|
||||
|
||||
`GET /api/v1/deutschland/xyz/{z}/{x}/{y}.jpg`
|
||||
|
||||
Die XYZ-Schnittstelle ist nur ein **Kachelindex-Adapter** für den vorhandenen
|
||||
OpenSimulator MapImageService: z = 24 entspricht nativem Level 1 (eine
|
||||
256-m-Zelle pro Kachel); z = 17 entspricht Level 8 (128 Zellen pro Kachel).
|
||||
Intern gilt `zoom = 25 - z`; der Ausschnitt wird mit einem festen
|
||||
Offsetsystem in die zulässigen XYZ-Indizes projiziert. Es handelt sich um
|
||||
**synthetische** Mercator-Koordinaten; dargestellte Geokoordinaten
|
||||
dürfen niemals als echte Standorte/Stadtgeografie interpretiert werden.
|
||||
|
||||
Der XYZ-Server prüft Zoom (17–24), gültige nichtnegative XYZ-Indizes,
|
||||
Grenzen und Existenz veröffentlichter Regionen und reicht nur bereits
|
||||
vorliegende JPEG-Kacheln durch. Keine freien Dateipfade, administrativen
|
||||
Metadaten, MapLibre-/Google-API-Schlüssel oder unnötigen Renderjobs.
|
||||
|
||||
**Externe Bibliothek:** MapLibre 6.15.0 wird in dieser Ausbaustufe über
|
||||
eine fest versionierte unpkg-ESM-/CSS-URL bezogen. Für streng abgesicherte
|
||||
Produktivportale MapLibre CSS/JS später in der Webauslieferung selbst
|
||||
hosten und die eigene Content-Security-Policy entsprechend konfigurieren.
|
||||
Es werden keine Google-Satelliten-/OSM-Kartenkacheln abgerufen.
|
||||
|
||||
## Stadtportal-Einbindung
|
||||
|
||||
Der einfachste Einstieg ist ein Link oder ein gleichoriginiges iframe zu
|
||||
|
||||
@@ -0,0 +1,307 @@
|
||||
# Stadt NexVerse – Registrierung über stadt-nexverse.de
|
||||
|
||||
**Betriebsvertrag für das Go-Stadtportal und ROBUST / OpenGenesisLINK Gen1**
|
||||
Stand: 20.10.2026. Umsetzung im Server implementiert, produktive Freigabe nur nach Erstlogin-Abnahme.
|
||||
|
||||
## 1. Datenfluss
|
||||
|
||||
Browser auf `https://stadt-nexverse.de/registrieren` → **eigenes
|
||||
Go-Backend** (CSRF, Rate-Limits, Cloudflare-Turnstile-Verifikation,
|
||||
E-Mail-Verifikation, Einwilligungen, Passwortbestätigung) → HTTPS
|
||||
`POST https://world.stadt-nexverse.de/api/v1/portal/avatars/register` →
|
||||
ROBUST → UserAccount/Authentication/Inventory/Avatar/GridUser.
|
||||
|
||||
Der Browser erhält **niemals** `NEXVERSE_REGISTER_API_KEY`. Er
|
||||
kommuniziert nur mit seinem eigenen Portal-Backend. Der Schlüssel gehört
|
||||
in die geschützte Backend-`.env`, nie in HTML, JS oder öffentlichen Quellcode.
|
||||
|
||||
## 2. ROBUST-Einstellungen (aktive bin/Robust.HG.ini)
|
||||
|
||||
```ini
|
||||
[NexVerseWorldApi]
|
||||
Enabled = true
|
||||
EnablePrivilegedEndpoints = true
|
||||
PublicBaseUrl = "https://world.stadt-nexverse.de"
|
||||
PortalAvatarRegistrationEnabled = true
|
||||
PortalRegistrationTrustedProxyIPs = "<GENAUE_PROXY_QUELL_IP>"
|
||||
PortalRegistrationTrustedHttpPeers = ""
|
||||
PortalRegistrationDefaultRegionName = "Magdeburg"
|
||||
PortalRegistrationDefaultX = 116
|
||||
PortalRegistrationDefaultY = 120
|
||||
PortalRegistrationDefaultZ = 22
|
||||
|
||||
[UserAccountService]
|
||||
CreateDefaultAvatarEntries = true
|
||||
|
||||
[OglAvatarTemplates]
|
||||
Enabled = true
|
||||
RequirePublishedModels = true
|
||||
BenjaminPublishedModel = "<GEPRUEFTER_MODELLACCOUNT_MIT_VOR_UND_NACHNAME>"
|
||||
LunaPublishedModel = "<GEPRUEFTER_MODELLACCOUNT_MIT_VOR_UND_NACHNAME>"
|
||||
```
|
||||
|
||||
Keine Sektionen duplizieren. Die angezeigten Winkelklammern sind
|
||||
**Platzhalter**. Registrierungsfreigabe erst aktivieren, wenn beide
|
||||
Modellaccounts vollständig und mit Viewer getestet sind. Die Modellvorlagen
|
||||
müssen veröffentlichte Wearables/Attachments und zulässige Copy-/Transferrechte
|
||||
besitzen. Die registrierte Startregion `Magdeburg` muss den
|
||||
Spawn `116/120/22` erlauben. Der Account-Service setzt Home **und**
|
||||
Last; nur bei beiden Erfolgen kommt `201 ready:true`.
|
||||
|
||||
Verbindungsabsicherung: KeyHelp-Proxies dürfen `X-Forwarded-Proto: https`
|
||||
nur selbst setzen. Der genaue TCP-Peer muss im erlaubten IP-Verzeichnis
|
||||
stehen; HTTP zum internen ROBUST nur im abgesicherten Privatnetz/Tunnel.
|
||||
`PortalRegistrationTrustedHttpPeers` ausschließlich für explizite private
|
||||
Backend-Verbindungen. Öffentliche Ursprungsports per Firewall schützen.
|
||||
|
||||
## 3. Schlüssel anlegen
|
||||
|
||||
Unter `https://world.stadt-nexverse.de/api/v1/docs` mit einem
|
||||
World-API-Administrator (UserLevel ≥ 200, `admin:*`) anmelden.
|
||||
**Schlüssel & Einrichten → Nur Registrierungs-API-Key erstellen**;
|
||||
exakt Scope `users:register`. Klartext einmalig kopieren.
|
||||
|
||||
```dotenv
|
||||
NEXVERSE_WORLD_API_URL=https://world.stadt-nexverse.de/api/v1
|
||||
NEXVERSE_REGISTER_API_KEY=nxk_GEHEIMES_BEISPIEL
|
||||
NEXVERSE_TURNSTILE_SITE_KEY=PUBLIC_SITE_KEY
|
||||
NEXVERSE_TURNSTILE_SECRET=PRIVATE_SECRET
|
||||
```
|
||||
|
||||
Turnstile wird **im Backend** serverseitig verifiziert, nicht von ROBUST.
|
||||
E-Mail-Verifikation und Bot-/CSRF-/IP-Schutz leistet ebenfalls das Portal.
|
||||
|
||||
## 4. Exakter POST
|
||||
|
||||
```http
|
||||
POST /api/v1/portal/avatars/register
|
||||
Content-Type: application/json
|
||||
X-NexVerse-Api-Key: <BACKEND_API_KEY>
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"first_name": "Alex",
|
||||
"last_name": "Resident",
|
||||
"email": "alex@example.org",
|
||||
"password": "Langes-sicheres-Passwort-2026!",
|
||||
"gender": "female",
|
||||
"home_region": {
|
||||
"name": "Magdeburg",
|
||||
"position": { "x": 116, "y": 120, "z": 22 }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`first_name`, `last_name`: 2–31 Zeichen, Unicode-Buchstaben am Anfang,
|
||||
danach Buchstaben/Ziffern/`_`/`-`; ein leerer Nachname wird `Resident`.
|
||||
Passwort 12–128 Zeichen, E-Mail gültig/maximal 254 Zeichen.
|
||||
`gender`: `male`/`maennlich`/`männlich` → `ogl:benjamin`;
|
||||
`female`/`weiblich` → `ogl:luna`. Die Vorlagen sind serverseitig fixiert,
|
||||
kein frei wählbarer `model_alias`-Parameter. `home_region` ist optional,
|
||||
kann aber durch das **berechtigte Portal-Backend** aus seinen
|
||||
Admin-Einstellungen befüllt werden. `home_region.id` ist die echte
|
||||
Regions-UUID; ID und Name müssen bei kombinierter Übergabe übereinstimmen.
|
||||
|
||||
**Erfolg:** HTTP `201 Created`, `success:true`, `ready:true`,
|
||||
`avatar_id`, `avatar_name`, `first_name`, `last_name`,
|
||||
`model_name`, `home_region`, `last_position`.
|
||||
|
||||
## 5. Live-Prüfung der Avatar-Namensverfügbarkeit
|
||||
|
||||
**Neu:** Es gibt einen separaten serverseitigen **GET-Endpunkt**:
|
||||
|
||||
```http
|
||||
GET /api/v1/portal/avatars/name-availability?first_name=Antonia&last_name=Porta
|
||||
X-NexVerse-Api-Key: <BACKEND_ONLY_USERS_REGISTER_KEY>
|
||||
```
|
||||
|
||||
Der Endpunkt erfordert wie die finale Registrierung denselben **aktiven
|
||||
`users:register`-Maschinenschlüssel**, einen zulässigen HTTPS-/Proxy-Transport
|
||||
und `PortalAvatarRegistrationEnabled=true`. Die Abfrage erzeugt **keinen**
|
||||
Account und reserviert keinen Namen. Benutzer-Suchdaten werden nicht in
|
||||
den öffentlichen World-API-Logtext geschrieben.
|
||||
|
||||
**Name-Bildung (identisch zum Registrierungs-POST):**
|
||||
|
||||
| first_name | last_name | geprüfter vollständiger Avatarname |
|
||||
| --- | --- | --- |
|
||||
| `Sleimer` | *(leer oder nicht gesetzt)* | `Sleimer Resident` |
|
||||
| `Sleimer` | `Akina` | `Sleimer Akina` |
|
||||
| `Antonia` | *(leer)* | `Antonia Resident` |
|
||||
| `Antonia` | `Porta` | `Antonia Porta` |
|
||||
|
||||
Ein vorhandener `Sleimer Akina` bedeutet **nicht**, dass
|
||||
`Sleimer Resident` belegt ist. Es wird immer das vollständige
|
||||
`first_name + " " + last_name` über den autoritativen UserAccountService
|
||||
abgefragt. Erlaubt sind 2–31 Zeichen pro Namensfeld, gemäß dem POST-Vertrag.
|
||||
Ein zu kurzer/ungültiger Name liefert HTTP 400.
|
||||
|
||||
**Beispiel, frei (HTTP 200):**
|
||||
|
||||
```json
|
||||
{
|
||||
"available": true,
|
||||
"status": "available",
|
||||
"first_name": "Sleimer",
|
||||
"last_name": "Resident",
|
||||
"avatar_name": "Sleimer Resident"
|
||||
}
|
||||
```
|
||||
|
||||
**Beispiel, belegt (HTTP 200):**
|
||||
|
||||
```json
|
||||
{
|
||||
"available": false,
|
||||
"status": "taken",
|
||||
"first_name": "Antonia",
|
||||
"last_name": "Porta",
|
||||
"avatar_name": "Antonia Porta"
|
||||
}
|
||||
```
|
||||
|
||||
Fehler: `401 unauthorized_portal`, `403 https_required`,
|
||||
`400 invalid_avatar_name`, `503 registration_disabled` oder
|
||||
`503 name_check_unavailable`. Bei HTTP 503 darf das Portal den Namen
|
||||
**nicht** als frei markieren.
|
||||
|
||||
### Go-Stadtportal: sichere Backend-Weiterleitung
|
||||
|
||||
Der Browser fragt **nur das Portal** ab, beispielsweise:
|
||||
|
||||
`GET https://stadt-nexverse.de/api/registration/name-availability?first_name=...&last_name=...`
|
||||
|
||||
Das Go-Backend validiert die beiden Felder, begrenzt die Request-Rate
|
||||
**pro IP und Sitzung** und fragt anschließend die World API mit dem
|
||||
Maschinenschlüssel ab. Nur der **Status** `available` sollte im Frontend
|
||||
angezeigt werden. Niemals den Schlüssel oder die World-API-Antwort mit
|
||||
internen Details an den Browser weiterreichen.
|
||||
|
||||
```go
|
||||
// Ausschnitt zur Integration in den bestehenden Go-Router.
|
||||
// Der gemeinsame HTTP-Client sollte wiederverwendet werden.
|
||||
func checkWorldName(ctx context.Context, first, last string) (bool, error) {
|
||||
base := strings.TrimSuffix(os.Getenv("NEXVERSE_WORLD_API_URL"), "/")
|
||||
if !strings.HasPrefix(base, "https://") {
|
||||
return false, errors.New("World API erfordert HTTPS")
|
||||
}
|
||||
qs := url.Values{}
|
||||
qs.Set("first_name", strings.TrimSpace(first))
|
||||
qs.Set("last_name", strings.TrimSpace(last))
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet,
|
||||
base+"/portal/avatars/name-availability?"+qs.Encode(), nil)
|
||||
if err != nil { return false, err }
|
||||
req.Header.Set("X-NexVerse-Api-Key", os.Getenv("NEXVERSE_REGISTER_API_KEY"))
|
||||
req.Header.Set("Accept", "application/json")
|
||||
client := &http.Client{Timeout: 5*time.Second}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil { return false, err }
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return false, fmt.Errorf("Namensprüfung World API HTTP %d", resp.StatusCode)
|
||||
}
|
||||
var result struct { Available bool `json:"available"` }
|
||||
err = json.NewDecoder(io.LimitReader(resp.Body, 8192)).Decode(&result)
|
||||
return result.Available, err
|
||||
}
|
||||
```
|
||||
|
||||
Auf der Registrierungsseite die Abfrage nach ca. **450 ms ohne
|
||||
weitere Tastatureingabe** starten; bei jeder Änderung an Vor- oder
|
||||
Nachnamen vorherigen `AbortController` abbrechen. Kein Abruf bei
|
||||
ungültigen/zu kurzen Vornamen.
|
||||
|
||||
```js
|
||||
let pending, controller, serial = 0;
|
||||
function validateNameLive() {
|
||||
clearTimeout(pending);
|
||||
controller?.abort();
|
||||
const ticket = ++serial;
|
||||
const first = document.querySelector("#first_name").value.trim();
|
||||
const last = document.querySelector("#last_name").value.trim();
|
||||
const status = document.querySelector("#name_status");
|
||||
if (first.length < 2 || first.length > 31 || last.length > 31) {
|
||||
status.textContent = "Bitte einen gültigen Namen eingeben.";
|
||||
return;
|
||||
}
|
||||
status.textContent = "Name wird geprüft …";
|
||||
pending = setTimeout(async () => {
|
||||
controller = new AbortController();
|
||||
try {
|
||||
const q = new URLSearchParams({first_name: first, last_name: last});
|
||||
const r = await fetch("/api/registration/name-availability?" + q, {
|
||||
signal: controller.signal, credentials: "same-origin", cache: "no-store"
|
||||
});
|
||||
if (!r.ok) throw Error("HTTP " + r.status);
|
||||
const data = await r.json();
|
||||
if (ticket !== serial) return;
|
||||
status.textContent = data.available
|
||||
? "Avatarname verfügbar."
|
||||
: "Avatarname ist bereits vergeben.";
|
||||
} catch (err) {
|
||||
if (err.name !== "AbortError" && ticket === serial)
|
||||
status.textContent = "Namensprüfung momentan nicht verfügbar.";
|
||||
}
|
||||
}, 450);
|
||||
}
|
||||
document.querySelector("#first_name").addEventListener("input", validateNameLive);
|
||||
document.querySelector("#last_name").addEventListener("input", validateNameLive);
|
||||
```
|
||||
|
||||
**Wichtig:** Die Live-Prüfung ist nur eine unverbindliche Vorschau.
|
||||
Der endgültige `POST /api/v1/portal/avatars/register` wiederholt die
|
||||
Namensprüfung autoritativ und kann weiterhin `409 avatar_name_taken`
|
||||
zurückgeben, wenn der Name zwischenzeitlich vergeben wurde.
|
||||
|
||||
---
|
||||
|
||||
## 6. Go-Backend-Kernaufruf
|
||||
|
||||
```go
|
||||
payload, _ := json.Marshal(worldRegisterRequest)
|
||||
base := strings.TrimRight(os.Getenv("NEXVERSE_WORLD_API_URL"), "/")
|
||||
if !strings.HasPrefix(base, "https://") { return errors.New("HTTPS erforderlich") }
|
||||
req, _ := http.NewRequestWithContext(ctx, "POST", base + "/portal/avatars/register", bytes.NewReader(payload))
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
req.Header.Set("X-NexVerse-Api-Key", os.Getenv("NEXVERSE_REGISTER_API_KEY"))
|
||||
client := &http.Client{Timeout: 15 * time.Second}
|
||||
resp, err := client.Do(req)
|
||||
// Fehler behandeln, Antwort JSON auswerten; nur 201 + success:true
|
||||
// + ready:true als vollständig registriert betrachten.
|
||||
```
|
||||
|
||||
Die Imports und der vollständige Handler sind dem Go-Projekt anzupassen.
|
||||
Vor diesem Aufruf müssen die Sicherheitsprüfungen durchgeführt werden.
|
||||
|
||||
## 7. Fehlercodes und Betrieb
|
||||
|
||||
| HTTP | Code | Prüfung |
|
||||
|---|---|---|
|
||||
| 400 | `invalid_json`, `invalid_avatar_name`, `invalid_password`, `invalid_email`, `invalid_gender`, `invalid_home_region` | Eingaben |
|
||||
| 401 | `unauthorized_portal` | Maschinenkey / `users:register` |
|
||||
| 403 | `https_required` | HTTPS, Proxy-Quell-IP, Forwarded-Proto |
|
||||
| 409 | `avatar_name_taken`, `email_registered` | Bereits registriert |
|
||||
| 413 | `invalid_body_size` | Requestgröße |
|
||||
| 422 | `registration_failed` | Vorlage, Inventar, Account, Home/Last, Region |
|
||||
| 503 | `registration_disabled`, `registration_unavailable` | Konfiguration / Server-Log / Korrelations-ID |
|
||||
|
||||
Bei einem Verbindungsabbruch nach einem POST **nicht blind erneut
|
||||
registrieren**: Der Avatar könnte bereits existieren. Konto-Zustand
|
||||
kontrollieren und ggf. das unvollständige Provisioning reparieren. Der
|
||||
Prozess ist derzeit **keine** atomare Multi-Service-Transaktion.
|
||||
|
||||
**Produktionsabnahme:** Registrieren → Viewer-Login → korrektes
|
||||
Benjamin-/Luna-Outfit → Inventar → Magdeburg/116/120/22 → Home/Last →
|
||||
erneuter Login; anschließend Fehler- und Missbrauchsprüfungen.
|
||||
|
||||
## 8. Quellen im selben Repository
|
||||
|
||||
- `NexVerse/Server/Api/OglPortalRegistrationApi.cs`
|
||||
- `NexVerse/Server/Api/NexVerseWorldApiConnector.cs`
|
||||
- `OpenSim/Services/UserAccountService/UserAccountService.cs`
|
||||
- `doc/NexVerse/PORTAL_REGISTRATION_IAR_HARDENING.md`
|
||||
- `doc/NexVerse/OGL_AVATAR_STARTER_TEMPLATES.md`
|
||||
|
||||
**Die ausführliche Betreiberanleitung mit vollständigen Browser-/Go-
|
||||
Beispielen ist zusätzlich als Markdown-Download in der Chat-Ausgabe verfügbar.**
|
||||
@@ -31,6 +31,7 @@ for item in (
|
||||
):
|
||||
assert item in api, item
|
||||
|
||||
assert '"/api/v1/world-map/view"' in api
|
||||
assert "server_uri" not in api
|
||||
assert "node_id" not in api
|
||||
assert "owner_id" not in api
|
||||
@@ -47,11 +48,11 @@ for item in (
|
||||
for item in (
|
||||
"Weltkarte",
|
||||
"world-map",
|
||||
"world-map/view",
|
||||
"pointerdown",
|
||||
"pointerup",
|
||||
"maplibre-gl@6.15.0",
|
||||
"new maplibregl.Map(",
|
||||
"'/api/v1/deutschland/xyz/{z}/{x}/{y}.jpg'",
|
||||
"minzoom:17,maxzoom:24",
|
||||
"fetch(apiRoot+",
|
||||
"map-1-",
|
||||
"teleport_uri",
|
||||
"encodeURIComponent(q)",
|
||||
".textContent",
|
||||
@@ -59,11 +60,9 @@ for item in (
|
||||
):
|
||||
assert item in page, item
|
||||
|
||||
# The old pointermove implementation caused one HTTP request per pointer movement.
|
||||
pointermove=page.split("world.addEventListener('pointermove',", 1)[1].split(
|
||||
"world.addEventListener('wheel',", 1
|
||||
)[0]
|
||||
assert "load()" not in pointermove
|
||||
# MapLibre movement triggers bounded metadata updates on moveend, not mousemove.
|
||||
assert "map.on('moveend',viewport)" in page
|
||||
assert "map.on('mousemove',e=>" in page
|
||||
assert "innerHTML" not in page, "Region names must never enter HTML unsanitized"
|
||||
# Public Deutschland tile proxy is strictly bounded and must not disclose
|
||||
# private region or privileged placement data.
|
||||
@@ -71,6 +70,9 @@ for item in (
|
||||
'"/api/v1/deutschland"',
|
||||
'"/api/v1/deutschland/view"',
|
||||
'"/api/v1/deutschland/tiles/"',
|
||||
'"/api/v1/deutschland/xyz/"',
|
||||
"HandleXyzTile(path, response)",
|
||||
"const long gridShift = 1L << 22",
|
||||
"zoom < 1 || zoom > 8",
|
||||
"x % span != 0 || y % span != 0",
|
||||
"GetMapTile(fileName, UUID.Zero",
|
||||
@@ -84,7 +86,10 @@ for item in (
|
||||
assert '"/api/v1/deutschland"' in connector
|
||||
assert "ConfigureTiles(LoadOptionalService<IMapImageService>" in connector
|
||||
assert "apiRoot+'?q='" in page
|
||||
assert "data.tile_url_template" in page
|
||||
# MapLibre consumes the XYZ tile source directly; the metadata response
|
||||
# retains tile_url_template for external/non-MapLibre portal clients.
|
||||
assert "tile_url_template = tileTemplate" in api
|
||||
assert "'/api/v1/deutschland/xyz/{z}/{x}/{y}.jpg'" in page
|
||||
for item in ('["/api/v1/deutschland"]', '["/api/v1/deutschland/view"]',
|
||||
'["/api/v1/deutschland/tiles/{zoom}/{x}/{y}.jpg"]'):
|
||||
assert item in openapi, item
|
||||
|
||||
@@ -32,7 +32,7 @@ assert 'serverConfig.GetBoolean("AllowLegacyPublicHGInventory", false)' in conne
|
||||
assert 'bool allowLegacyPublicHypergridInventory = publicHypergridInventory &&' in connector
|
||||
assert 'publicHypergridInventory && !allowLegacyPublicHypergridInventory' in connector
|
||||
assert 'm_DenyPublicHypergridInventory = denyPublicHypergridInventory' in handler
|
||||
assert "Unauthorized inventory reads/writes may be possible" in connector
|
||||
assert "Unberechtigte Inventar-Lese- und Schreibzugriffe sind möglicherweise möglich" in connector
|
||||
|
||||
process = handler.split("protected override byte[] ProcessRequest", 1)[1]
|
||||
denial = process.split("string body;", 1)[0]
|
||||
|
||||
@@ -17,6 +17,34 @@ for marker in (
|
||||
'GetBoolean("PortalAvatarRegistrationEnabled", false)',
|
||||
):
|
||||
assert marker in connector, "Missing disabled-by-default portal route: " + marker
|
||||
# Backend-only live availability must use the same machine key and
|
||||
# normalized names as the authoritative final registration POST.
|
||||
for marker in (
|
||||
'"/api/v1/portal/avatars/name-availability"',
|
||||
"apiGate.Wrap(portalRegistration.HandleNameAvailability)",
|
||||
):
|
||||
assert marker in connector, "Live name availability registration missing: " + marker
|
||||
|
||||
for marker in (
|
||||
"public void HandleNameAvailability(",
|
||||
'string.Equals(request.HttpMethod, "GET"',
|
||||
"if (!AuthorizePortal(request, response))",
|
||||
'request.QueryString?["first_name"]',
|
||||
'request.QueryString?["last_name"]',
|
||||
'last = "Resident";',
|
||||
"m_Accounts.GetUserAccount(UUID.Zero, first, last) == null",
|
||||
"status = available ? \"available\" : \"taken\"",
|
||||
"HttpStatusCode.OK",
|
||||
'"name_check_unavailable"',
|
||||
'"invalid_avatar_name"',
|
||||
):
|
||||
assert marker in api, "Live name availability API security/contract missing: " + marker
|
||||
assert api.count("if (!AuthorizePortal(request, response))") == 2, "Both routes must share identical security checks."
|
||||
assert api.count("m_Accounts.GetUserAccount(UUID.Zero, first, last)") >= 2, "Live lookup must match final POST lookup."
|
||||
assert api.index("NexScopes.UsersRegister") < api.index("public void HandleNameAvailability(")
|
||||
assert api.index("public void HandleNameAvailability(") < api.index("public void Handle(")
|
||||
assert "X-NexVerse-Api-Key" in api and "HttpStatusCode.Created" in api
|
||||
|
||||
for marker in (
|
||||
"IOglPortalAccountProvisioner",
|
||||
"CreatePortalAvatar(",
|
||||
|
||||
Reference in new issue
Block a user