Update Grasscutter versions

Add auto MongoDB option
This commit is contained in:
Thoronium
2023-03-31 19:40:14 -06:00
parent 90b86b42d0
commit ef3ba2a045
24 changed files with 219 additions and 39 deletions

View File

@@ -159,16 +159,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
// Open server as well if the options are set
if (config.grasscutter_with_game) {
const jarFolderArr = config.grasscutter_path.replace(/\\/g, '/').split('/')
jarFolderArr.pop()
const jarFolder = jarFolderArr.join('/')
await invoke('run_jar', {
path: config.grasscutter_path,
executeIn: jarFolder,
javaPath: config.java_path || '',
})
this.launchServer()
}
} else {
await unpatchGame()
@@ -196,6 +187,11 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
if (!config.grasscutter_path) return alert('Grasscutter not installed or set!')
if (config.auto_mongodb) {
// Check if MongoDB is running and start it if not
await invoke('service_status', { service: 'MongoDB' })
}
let jarFolder = config.grasscutter_path
if (jarFolder.includes('/')) {