fix(ugc): answer the client's built-in UGC path, and document how it downloads

In the 1.10.64 client tested, 3D services ignore boot.cfg's UGC and patch
server lines and ask http://127.0.0.1:80/lwoclient/UserBrickModels/...; the
UGC server now answers that path too (useful when it runs on port 80), and
the docs say to keep UGCUSE3DSERVICES=7:0 (the client builds the models from
the world's LXFML; verified that property models load) until it can.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 14:44:23 -05:00
parent c4d2454e63
commit b4fa732047

View File

@@ -228,10 +228,14 @@ namespace {
} }
void RegisterRoutes() { void RegisterRoutes() {
const auto prefix = Segments(Lower(Game::config->GetValue("client_path").empty() ? "/ugc" : Game::config->GetValue("client_path"))); // The configured path, and the one the 1.10.64 client uses whatever its boot.cfg says (its built-in patch server
// folder, lwoclient/UserBrickModels; see docs/UgcServer.md)
std::set<std::string> bases;
for (const auto& path : { Game::config->GetValue("client_path").empty() ? std::string("/ugc") : Game::config->GetValue("client_path"), std::string("/lwoclient/UserBrickModels") }) {
const auto prefix = Segments(Lower(path));
std::string base; std::string base;
for (const auto& segment : prefix) base += "/" + segment; for (const auto& segment : prefix) base += "/" + segment;
if (!bases.insert(base).second) continue;
const auto clientRoute = [prefixSize = prefix.size()](HTTPReply& reply, const HTTPContext& context) { const auto clientRoute = [prefixSize = prefix.size()](HTTPReply& reply, const HTTPContext& context) {
auto segments = Segments(context.originalPath); auto segments = Segments(context.originalPath);
if (segments.size() <= prefixSize) { if (segments.size() <= prefixSize) {
@@ -245,6 +249,8 @@ namespace {
}; };
Game::web.RegisterHTTPRoute({ .path = base + "/:folder/:file", .method = eHTTPMethod::GET, .middleware = {}, .handle = clientRoute }); Game::web.RegisterHTTPRoute({ .path = base + "/:folder/:file", .method = eHTTPMethod::GET, .middleware = {}, .handle = clientRoute });
Game::web.RegisterHTTPRoute({ .path = base + "/:folder/:type/:file", .method = eHTTPMethod::GET, .middleware = {}, .handle = clientRoute }); Game::web.RegisterHTTPRoute({ .path = base + "/:folder/:type/:file", .method = eHTTPMethod::GET, .middleware = {}, .handle = clientRoute });
LOG("Serving the client's downloads under %s/UGCC<datacenter>/", base.c_str());
}
// Previews for the dashboard // Previews for the dashboard
Game::web.RegisterHTTPRoute({ .path = "/files/:kind/:id/:file", .method = eHTTPMethod::GET, .middleware = {}, Game::web.RegisterHTTPRoute({ .path = "/files/:kind/:id/:file", .method = eHTTPMethod::GET, .middleware = {},
@@ -361,7 +367,6 @@ namespace {
reply.headers.push_back("Access-Control-Allow-Origin: *"); reply.headers.push_back("Access-Control-Allow-Origin: *");
reply.headers.push_back("Cache-Control: no-store"); reply.headers.push_back("Cache-Control: no-store");
} }); } });
LOG("Serving the client's downloads under %s/UGCC<datacenter>/", base.c_str());
} }
std::filesystem::path ResPath() { std::filesystem::path ResPath() {