mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-17 18:22:50 +00:00
feat(ugc): icon pose math shared with the editor, model rotation parameters, assembled mesh endpoint
UgcIconPose holds the icon camera, model rotation (yaw/pitch/roll, YXZ) and the crop to the projected bounds; RenderIcon uses it. The parameter list gains the model's turn (defaults 0, so icons stay the same). POST /admin/assembly returns a module combination's assembled .nif (turned by the build type's AdditionalModelRotation), made on a worker and kept in a small cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -327,6 +327,21 @@ namespace {
|
||||
}
|
||||
} });
|
||||
|
||||
Game::web.RegisterHTTPRoute({ .path = "/admin/assembly", .method = eHTTPMethod::POST, .middleware = {},
|
||||
.handle = [admin](HTTPReply& reply, const HTTPContext& context) {
|
||||
std::optional<nlohmann::json> body;
|
||||
if (!admin(reply, context, body)) return;
|
||||
auto deferred = Web::Defer(reply, context);
|
||||
std::string error;
|
||||
if (!g_Processor->QueueAssembly(body->value("modules", std::string()), deferred, error)) {
|
||||
HTTPReply out;
|
||||
out.status = eHTTPStatusCode::BAD_REQUEST;
|
||||
out.contentType = eContentType::APPLICATION_JSON;
|
||||
out.message = nlohmann::json{ { "success", false }, { "error", error } }.dump();
|
||||
deferred.Send(std::move(out));
|
||||
}
|
||||
} });
|
||||
|
||||
Game::web.RegisterHTTPRoute({ .path = "/admin/regenerate-icons", .method = eHTTPMethod::POST, .middleware = {},
|
||||
.handle = [admin](HTTPReply& reply, const HTTPContext& context) {
|
||||
std::optional<nlohmann::json> body;
|
||||
|
||||
Reference in New Issue
Block a user