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
View File
@@ -215,6 +215,8 @@
* add bug report button in game
* bugfix: destroyers can't find path to dst and freeze
* record single player game stats
* alert on attack
* alert on unit captured or destroyed
* stop requesting lobby when playing game
* nuking an enemy and accidentally destroying a trade ship shouldn't break the alliance and make you a traitor
* you should get a notification and a reward (some money) for eliminating an enemy (perhaps take wtvr gold the enemy had)
+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 = {