mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 21:59:20 +00:00
packing tiles for more efficient transfer
This commit is contained in:
@@ -124,6 +124,8 @@ export class ClientGameRunner {
|
||||
this.renderer.initialize()
|
||||
this.input.initialize()
|
||||
this.worker.start((gu: GameUpdateViewData) => {
|
||||
const size = gu.packedTileUpdates.length * 4 / 1000
|
||||
console.log(`game update size: ${size}kb`)
|
||||
this.gameView.update(gu)
|
||||
this.renderer.tick()
|
||||
})
|
||||
|
||||
@@ -36,6 +36,10 @@ export class TerritoryLayer implements Layer {
|
||||
}
|
||||
|
||||
tick() {
|
||||
this.game.recentlyUpdatedTiles()
|
||||
.forEach(t => this.enqueue(t))
|
||||
|
||||
|
||||
if (!this.game.inSpawnPhase()) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user