update gcs write logic, fix build cost bug

This commit is contained in:
Evan
2024-12-04 19:59:44 -08:00
parent 861a28fe76
commit 739dab0e52
3 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -90,12 +90,12 @@ export class DefaultConfig implements Config {
}
case UnitType.DefensePost:
return {
cost: (p: Player) => Math.pow(2, p.units(UnitType.Port).length) * 100_000,
cost: (p: Player) => Math.pow(2, p.units(UnitType.DefensePost).length) * 100_000,
territoryBound: true
}
case UnitType.City:
return {
cost: (p: Player) => Math.pow(2, p.units(UnitType.Port).length) * 250_000,
cost: (p: Player) => Math.pow(2, p.units(UnitType.City).length) * 250_000,
territoryBound: true
}
default:
+2 -1
View File
@@ -147,7 +147,8 @@ export class GameServer {
}
});
try {
if (this.turns.length > 100 && this.clients.length > 0) {
if (this.turns.length > 350) {
console.log(`writing game ${this.id} to gcs`)
const bucket = storage.bucket(this.config.gameStorageBucketName());
const file = bucket.file(this.id);
const game = {