mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 22:00:07 +00:00
Store full game for singleplayer, add more validation (#2031)
## Description: onunload allows up to 64kb, but reducing the number of hash messages and compressing using gzip, we can reduce the GameRecord size to stay under 64kb. I played a 10 minute game and the compressed GameRecord was only a few kb. Also verify the game is singleplayer and has only 1 player ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -271,7 +271,7 @@ export class ClientGameRunner {
|
||||
this.lobby.clientID,
|
||||
);
|
||||
console.error(gu.stack);
|
||||
this.stop(true);
|
||||
this.stop();
|
||||
return;
|
||||
}
|
||||
this.transport.turnComplete();
|
||||
@@ -361,12 +361,12 @@ export class ClientGameRunner {
|
||||
this.transport.connect(onconnect, onmessage);
|
||||
}
|
||||
|
||||
public stop(saveFullGame: boolean = false) {
|
||||
public stop() {
|
||||
if (!this.isActive) return;
|
||||
|
||||
this.isActive = false;
|
||||
this.worker.cleanup();
|
||||
this.transport.leaveGame(saveFullGame);
|
||||
this.transport.leaveGame();
|
||||
if (this.connectionCheckInterval) {
|
||||
clearInterval(this.connectionCheckInterval);
|
||||
this.connectionCheckInterval = null;
|
||||
|
||||
Reference in New Issue
Block a user