From e8ab0b8f4253aa3a31f57ffbe4f746a28ba3b89d Mon Sep 17 00:00:00 2001 From: JotaChina Date: Sun, 8 Feb 2026 14:07:47 -0300 Subject: [PATCH] toques finais --- assets/js/creations/server/server.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/assets/js/creations/server/server.js b/assets/js/creations/server/server.js index 275c98a3..42f043e0 100755 --- a/assets/js/creations/server/server.js +++ b/assets/js/creations/server/server.js @@ -247,7 +247,7 @@ const io = new Server(httpsServer, { }, }); -console.log("Backend V6 (Logs Dinâmicos) iniciado. Aguardando conexões..."); +console.log("Servidor Backend do MMP-Search está no ar!"); // util de log das salas deste socket function logMyRooms(socket, prefix = "SALAS") { @@ -638,7 +638,6 @@ app.use(express.json({ limit: "250mb" })); app.use((req, res, next) => { const origin = req.headers.origin; - // ajuste se você usa outros hosts no dev const allowed = new Set([ "https://alice.ufsj.edu.br", ]); @@ -659,7 +658,7 @@ const LMMS_BIN = process.env.LMMS_BIN || "lmms"; const LMMS_TIMEOUT_MS = Number(process.env.LMMS_TIMEOUT_MS || 5 * 60 * 1000); function buildLmmsCommand(inputMmp, outputAudio, ext) { - // ✅ igual ao Python: -r input -o output -f ext + // igual ao Python: -r input -o output -f ext const lmmsArgs = ["-r", inputMmp, "-o", outputAudio, "-f", ext]; // Só usa xvfb se você pedir explicitamente @@ -772,7 +771,7 @@ app.post("/render", async (req, res) => { let inputMmpPath = null; let cwdForLmms = tmpDir; - // ✅ caminho novo: veio pacote (mmpz/zip) com samples/ + // caminho novo: veio pacote (mmpz/zip) com samples/ if (mmpzBase64 && String(mmpzBase64).trim().length > 0) { const safeName = sanitizeFileName(mmpzName || "project.mmpz"); const zipPath = path.join(tmpDir, safeName); @@ -783,7 +782,7 @@ app.post("/render", async (req, res) => { inputMmpPath = await findFirstMmp(tmpDir); if (!inputMmpPath) throw new Error("nenhum .mmp encontrado após extrair o pacote"); - cwdForLmms = path.dirname(inputMmpPath); // 🔥 isso faz o LMMS resolver samples/... + cwdForLmms = path.dirname(inputMmpPath); // isso faz o LMMS resolver samples/... } else { // fallback antigo: xml puro (patterns ok, samples não) let projectXml = null; @@ -828,7 +827,7 @@ app.post("/notify-update", express.json(), (req, res) => { if (updateType === "samples") { // 1. Emitir o evento para TODAS as salas/clientes. - // O evento deve ser algo que seu ui.js entenda. + // O evento deve ser algo que ui.js entenda. io.emit("system_update", { type: "RELOAD_SAMPLES", message: "Novo Sample/Project adicionado. Recarregando o navegador de arquivos...", @@ -845,11 +844,11 @@ app.post("/notify-update", express.json(), (req, res) => { app.get("/", (req, res) => { res.send( - "Servidor Backend V6 (Logs Dinâmicos) da DAW colaborativa está no ar!" + "Servidor Backend do MMP-Search está no ar novamente!" ); }); // ====== START ====== httpsServer.listen(PORT, () => { - console.log(`Servidor escutando na porta https://localhost:${PORT}`); + console.log(`Servidor escutando na porta ${PORT}`); }); \ No newline at end of file