Skip to content

Commit c8110e0

Browse files
committed
update triggerActivity
1 parent 927bda9 commit c8110e0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/controllers/handlePlayerSelection.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ export const handlePlayerSelection = async (req: Request, res: Response) => {
4747
shouldUpdateGame = false;
4848
} else if ((isPlayerX && playerO.visitorId) || (!isPlayerX && playerX.visitorId)) {
4949
text = "Let the game begin!";
50-
world.triggerActivity({ type: WorldActivityType.GAME_ON, assetId: keyAssetId });
50+
world.triggerActivity({ type: WorldActivityType.GAME_ON, assetId: keyAssetId }).catch((error) => {
51+
console.error("Error triggering activity:", error);
52+
});
5153
} else {
5254
text = "Find a second player!";
53-
world.triggerActivity({ type: WorldActivityType.GAME_WAITING, assetId: keyAssetId });
55+
world.triggerActivity({ type: WorldActivityType.GAME_WAITING, assetId: keyAssetId }).catch((error) => {
56+
console.error("Error triggering activity:", error);
57+
});
5458
}
5559

5660
if (!shouldUpdateGame) {

0 commit comments

Comments
 (0)