mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 23:54:48 +01:00
Changes from 1.2.1 - 1.5.1
Contains slightly modified commits from between 1.2.1 and 1.5.1.
This commit is contained in:
@@ -40,5 +40,32 @@ export async function encryptionEnabled(path: string) {
|
||||
return false
|
||||
}
|
||||
|
||||
return serverConf.server.http.encryption.useEncryption
|
||||
if ('server' in serverConf) {
|
||||
return serverConf.server.http.encryption.useEncryption
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
export async function changeResourcePath(path: string) {
|
||||
let serverConf
|
||||
|
||||
try {
|
||||
serverConf = JSON.parse(
|
||||
await invoke('read_file', {
|
||||
path,
|
||||
})
|
||||
)
|
||||
} catch (e) {
|
||||
console.log(`Server config at ${path} not found or invalid. Be sure to run the server at least once to generate it`)
|
||||
return
|
||||
}
|
||||
|
||||
serverConf.folderStructure.resources = './resources/'
|
||||
|
||||
// Write file
|
||||
await invoke('write_file', {
|
||||
path,
|
||||
contents: JSON.stringify(serverConf, null, 2),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user