Spaces:
Sleeping
Sleeping
game already started
Browse files
src/components/buttons/InteractButton.tsx
CHANGED
@@ -60,8 +60,13 @@ export default function InteractButton() {
|
|
60 |
console.log("game.world",game.world)
|
61 |
game.world.playersInit.delete(userPlayerId);
|
62 |
} else {
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
};
|
67 |
// if (!isAuthenticated || game === undefined) {
|
|
|
60 |
console.log("game.world",game.world)
|
61 |
game.world.playersInit.delete(userPlayerId);
|
62 |
} else {
|
63 |
+
if (game.world.gameCycle.cycleState==="LobbyState"){
|
64 |
+
console.log(`Joining game`);
|
65 |
+
void joinInput(worldId);
|
66 |
+
}else{
|
67 |
+
throw new ConvexError(`The game already started`);
|
68 |
+
}
|
69 |
+
|
70 |
}
|
71 |
};
|
72 |
// if (!isAuthenticated || game === undefined) {
|