From c5666dc38739de241e045487d197ca895dd9835d Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 11 May 2024 00:16:45 +0200 Subject: [PATCH] Give a proper response on createGuildDojo --- .../api/createGuildDojoController.ts | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/controllers/api/createGuildDojoController.ts b/src/controllers/api/createGuildDojoController.ts index d0849259..45e26a85 100644 --- a/src/controllers/api/createGuildDojoController.ts +++ b/src/controllers/api/createGuildDojoController.ts @@ -1,11 +1,27 @@ import { RequestHandler } from "express"; -export const createGuildDojoController: RequestHandler = (_req, res) => { - // _req.body.toString() -> {"SpawnComponent":{"id":{"$oid":"000000000000000000000000"},"pf":"/Lotus/Levels/ClanDojo/DojoHall.level","ppf":""}} +export const createGuildDojoController: RequestHandler = (req, res) => { + // req.body.toString() -> {"SpawnComponent":{"id":{"$oid":"000000000000000000000000"},"pf":"/Lotus/Levels/ClanDojo/DojoHall.level","ppf":""}} - // I'm guessing the response is same as getGuildDojo.php, but I have yet to log one of those for a fresh clan. - // This works to make the client load in, but can't build new rooms. + // I'm guessing the response is same as getGuildDojo.php, which responds like this for a fresh dojo: res.json({ - DojoComponents: [{ pf: "/Lotus/Levels/ClanDojo/DojoHall.level", ppf: "" }] + _id: { $oid: req.params.guildId }, + Name: "If you can read this in-game, tell me I need to fetch the clan name from the DB, lol.", + Tier: 1, + FixedContributions: true, + DojoRevision: 1, + RevisionTime: Math.round(Date.now() / 1000), + Energy: 5, + Capacity: 100, + DojoRequestStatus: 0, + DojoComponents: [ + { + pf: "/Lotus/Levels/ClanDojo/DojoHall.level", + ppf: "", + id: { $oid: "000000000000000000000000" }, + CompletionTime: { $date: { $numberLong: "" + Date.now() } }, + DecoCapacity: 600 + } + ] }); };