Skip to content

Commit 2458831

Browse files
committed
fix: Make sure game updates sent 100% of the time after ensureGameDataDownloaded makes a changes
1 parent 6ceb02e commit 2458831

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/back/flashpoint/WebgameContentRunner.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { downloadGameData } from '@back/download';
22
import { checkAndInstallPlatform, createLaunchInfoCommand, escapeArgsForShell, getContentEnvironment } from '@back/GameLauncher';
33
import { ManagedChildProcess } from '@back/ManagedChildProcess';
4-
import { createRawCommand } from '@back/responses';
4+
import { broadcastGameUpdate, createRawCommand } from '@back/responses';
55
import { BackState } from '@back/types';
66
import { awaitDialog } from '@back/util/dialog';
77
import { promiseSleep, removeService, runService } from '@back/util/misc';
@@ -155,6 +155,7 @@ export async function ensureGameDataDownloaded(state: BackState, game: Game) {
155155
return false;
156156
}
157157
}
158+
broadcastGameUpdate(state, game.id);
158159
}
159160

160161
// Make sure it has a path set, check the default location if it does not then save it back
@@ -166,6 +167,7 @@ export async function ensureGameDataDownloaded(state: BackState, game: Game) {
166167
game.activeDataOnDisk = true;
167168
await fpDatabase.saveGameData(gameData);
168169
await fpDatabase.saveGame(game);
170+
broadcastGameUpdate(state, game.id);
169171
}
170172
}
171173
}

src/back/responses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2743,7 +2743,7 @@ export async function exitApp(state: BackState, beforeProcessExit?: () => void |
27432743
return exit(state, beforeProcessExit);
27442744
}
27452745

2746-
async function broadcastGameUpdate(state: BackState, id: string) {
2746+
export async function broadcastGameUpdate(state: BackState, id: string) {
27472747
const game = await getGame(state, id);
27482748
if (game) {
27492749
state.socketServer.broadcast(BackOut.UPDATE_GAME, game);

0 commit comments

Comments
 (0)