feature: wip-game-achievements

refactor: rename files
This commit is contained in:
JackEnx 2024-05-08 15:38:52 -03:00 committed by Zamitto
parent fabeedaa8a
commit 8fb62af0cf
18 changed files with 739 additions and 0 deletions

View file

@ -5,6 +5,10 @@ import { createGame, updateGamePlaytime } from "./library-sync";
import { GameRunning } from "@types";
import { PythonInstance } from "./download";
import { Game } from "@main/entity";
import {
startGameAchievementObserver,
stopGameAchievementObserver,
} from "@main/events/achievements/game-achievements-observer";
export const gamesPlaytime = new Map<
number,
@ -74,6 +78,8 @@ function onOpenGame(game: Game) {
} else {
createGame({ ...game, lastTimePlayed: new Date() }).catch(() => {});
}
startGameAchievementObserver(game.id);
}
function onTickGame(game: Game) {
@ -125,4 +131,6 @@ const onCloseGame = (game: Game) => {
} else {
createGame(game).catch(() => {});
}
stopGameAchievementObserver(game.id);
};