Spaces:
Sleeping
Sleeping
test
Browse files- convex/aiTown/game.ts +4 -9
convex/aiTown/game.ts
CHANGED
|
@@ -29,12 +29,8 @@ import { parseMap, serializeMap } from '../util/object';
|
|
| 29 |
import { LOBBY_SIZE } from '../constants';
|
| 30 |
import { api } from '../_generated/api';
|
| 31 |
|
| 32 |
-
const
|
| 33 |
-
|
| 34 |
-
const frozen = defaultWorld?.status === 'stoppedByDeveloper';
|
| 35 |
-
console.log("Frozen : ", frozen)
|
| 36 |
-
const unfreeze = useMutation(api.testing.resume);
|
| 37 |
-
const freeze = useMutation(api.testing.stop);
|
| 38 |
|
| 39 |
|
| 40 |
type WerewolfLookupTable = {
|
|
@@ -270,14 +266,13 @@ export class Game extends AbstractGame {
|
|
| 270 |
this.world.gameCycle.startGame(this)
|
| 271 |
if (frozen) {
|
| 272 |
console.log('Unfreezing');
|
| 273 |
-
|
| 274 |
}
|
| 275 |
}
|
| 276 |
if (this.world.gameCycle.cycleState === 'LobbyState' && humans.length < LOBBY_SIZE) {
|
| 277 |
|
| 278 |
console.log('Freezing');
|
| 279 |
-
|
| 280 |
-
|
| 281 |
}
|
| 282 |
|
| 283 |
// debug
|
|
|
|
| 29 |
import { LOBBY_SIZE } from '../constants';
|
| 30 |
import { api } from '../_generated/api';
|
| 31 |
|
| 32 |
+
const frozen = api.world.defaultWorldStatus.status==="stoppedByDeveloper"
|
| 33 |
+
console.log("Frozen : ", frozen);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
type WerewolfLookupTable = {
|
|
|
|
| 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
|