move coordinators folder

This commit is contained in:
pa
2026-03-10 10:36:17 +09:00
parent d0a52ecd23
commit 648fcde085
20 changed files with 8 additions and 8 deletions
+49
View File
@@ -0,0 +1,49 @@
/**
* @param {object} deps Coordinator dependencies.
* @returns {object} Game flow coordinator methods.
*/
export function createGameCoordinator(deps) {
const {
userStore,
instanceStore,
updateLoopStore,
locationStore,
gameLogStore,
vrStore,
avatarStore,
configRepository,
workerTimers,
checkVRChatDebugLogging,
autoVRChatCacheManagement,
checkIfGameCrashed,
getIsGameNoVR
} = deps;
/**
* Runs shared side effects when game running state changes.
* @param {boolean} isGameRunning Whether VRChat is running.
*/
async function runGameRunningChangedFlow(isGameRunning) {
if (isGameRunning) {
userStore.markCurrentUserGameStarted();
} else {
await configRepository.setBool('isGameNoVR', getIsGameNoVR());
userStore.markCurrentUserGameStopped();
instanceStore.removeAllQueuedInstances();
autoVRChatCacheManagement();
checkIfGameCrashed();
updateLoopStore.setIpcTimeout(0);
avatarStore.addAvatarWearTime(userStore.currentUser.currentAvatar);
}
locationStore.lastLocationReset();
gameLogStore.clearNowPlaying();
vrStore.updateVRLastLocation();
workerTimers.setTimeout(() => checkVRChatDebugLogging(), 60000);
updateLoopStore.setNextDiscordUpdate(0);
}
return {
runGameRunningChangedFlow
};
}