Automation

- MongoDB tied to Grasscutter rather than game
- Grasscutter restarts when changing encryption if it is running
- AIO link updates without needing manual edits
This commit is contained in:
Thoronium
2023-04-02 21:15:25 -06:00
parent 5d6bd72083
commit e834022ca7
8 changed files with 151 additions and 7 deletions

View File

@@ -68,7 +68,6 @@ export class Main extends React.Component<IProps, IState> {
// Emitted for rsa replacing-purposes
listen('game_closed', async () => {
const wasPatched = await getConfigOption('patch_rsa')
const autoService = await getConfigOption('auto_mongodb')
if (wasPatched) {
const unpatched = await unpatchGame()
@@ -77,6 +76,11 @@ export class Main extends React.Component<IProps, IState> {
alert(`Could not unpatch game! (Delete version.dll in your game folder)`)
}
}
})
// Emitted for automatic processes
listen('grasscutter_closed', async () => {
const autoService = await getConfigOption('auto_mongodb')
if (autoService) {
await invoke('stop_service', { service: 'MongoDB' })