Jofthomas commited on
Commit
0c7ebad
·
1 Parent(s): e3f17b7
Files changed (2) hide show
  1. convex/aiTown/game.ts +6 -3
  2. src/components/Game.tsx +2 -2
convex/aiTown/game.ts CHANGED
@@ -260,19 +260,22 @@ export class Game extends AbstractGame {
260
  this.world.winner = 'werewolves'
261
  }
262
  }
263
-
264
  // Quit LobbyState to start the game once we have at least 3 players
265
  if (this.world.gameCycle.cycleState === 'LobbyState' && humans.length >= LOBBY_SIZE) {
266
  this.world.gameCycle.startGame(this)
267
  if (frozen) {
268
  console.log('Unfreezing');
269
  api.testing.resume()
 
270
  }
271
  }
272
- if (this.world.gameCycle.cycleState === 'LobbyState' && humans.length < LOBBY_SIZE) {
273
-
274
  console.log('Freezing');
275
  //api.testing.stop()
 
 
276
  }
277
 
278
  // debug
 
260
  this.world.winner = 'werewolves'
261
  }
262
  }
263
+ console.log(this.world.players.values.length)
264
  // Quit LobbyState to start the game once we have at least 3 players
265
  if (this.world.gameCycle.cycleState === 'LobbyState' && humans.length >= LOBBY_SIZE) {
266
  this.world.gameCycle.startGame(this)
267
  if (frozen) {
268
  console.log('Unfreezing');
269
  api.testing.resume()
270
+
271
  }
272
  }
273
+ if (this.world.gameCycle.cycleState === 'LobbyState' && humans.length < LOBBY_SIZE ) {
274
+ if (!frozen) {
275
  console.log('Freezing');
276
  //api.testing.stop()
277
+ }
278
+
279
  }
280
 
281
  // debug
src/components/Game.tsx CHANGED
@@ -101,8 +101,8 @@ export default function Game() {
101
  if (!worldId || !engineId || !game ) {
102
  return null;
103
  }
104
- console.log(humanTokenIdentifier)
105
- console.log("game.world.players.values() :",game.world.players.values())
106
  const playerId = [...game.world.players.values()].find(
107
  (p) => !!p && p.human === humanTokenIdentifier,
108
  )?.id;
 
101
  if (!worldId || !engineId || !game ) {
102
  return null;
103
  }
104
+ //console.log(humanTokenIdentifier)
105
+ //console.log("game.world.players.values() :",game.world.players.values())
106
  const playerId = [...game.world.players.values()].find(
107
  (p) => !!p && p.human === humanTokenIdentifier,
108
  )?.id;