Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/controllers/session/handleGetDataObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Request, Response } from "express";
export default async function handleGetDataObject(req: Request, res: Response) {
try {
const credentials = getCredentials(req.query);

const keyAsset = await getDroppedAsset(credentials);
if (!keyAsset.dataObject.landmarkZoneId) throw "No landmark zone ID found in data object";

if (keyAsset.error) {
return res.status(404).json({ message: "Asset not found" });
Expand All @@ -17,9 +19,7 @@ export default async function handleGetDataObject(req: Request, res: Response) {

keyAsset.dataObject.participants = visitorProfileIds;

if (keyAsset) {
return res.status(200).json(keyAsset.dataObject);
}
if (keyAsset) return res.status(200).json(keyAsset.dataObject);
} catch (error: any) {
return errorHandler({
error,
Expand Down
27 changes: 21 additions & 6 deletions server/controllers/session/handleSetBreakoutConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,13 @@ export default async function handleSetBreakoutConfig(req: Request, res: Respons
duration: 5,
position: keyAsset.position,
})
.then()
.catch(() => console.error("Error: Cannot trigger particle"));
.catch((error) =>
errorHandler({
error,
functionName: "handleSetBreakoutConfig",
message: "Error triggering particle effects",
}),
);

placeVisitors(matches, visitorsObj, participants, keyAsset.id!, breakouts, privateZones);
}, countdown * 1000);
Expand Down Expand Up @@ -341,17 +346,27 @@ export default async function handleSetBreakoutConfig(req: Request, res: Respons

const timeout = setTimeout(() => {
const world = World.create(urlSlug, { credentials });
world.triggerActivity({ type: WorldActivityType.GAME_ON, assetId }).catch((error) =>
errorHandler({
error,
functionName: "handleSetBreakoutConfig",
message: "Error triggering world activity",
}),
);

world
.triggerParticle({
name: "pastelConfetti_fall",
duration: 5,
position: keyAsset.position,
})
.then()
.catch(() => console.error("Error: Cannot trigger particle"));

world.triggerActivity({ type: WorldActivityType.GAME_ON, assetId });
.catch((error) =>
errorHandler({
error,
functionName: "handleSetBreakoutConfig",
message: "Error triggering world activity",
}),
);

placeVisitors(matches, visitorsObj, participants, keyAsset.id!, breakouts, privateZonesAtStart);
}, countdown * 1000);
Expand Down
Loading