Give a proper response on createGuildDojo

This commit is contained in:
Sainan 2024-05-11 00:16:45 +02:00
parent b7d574071e
commit c5666dc387

View File

@ -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
}
]
});
};