mirror of
https://github.com/HolographicHat/Yae.git
synced 2026-03-19 02:49:47 +08:00
v1.0.1
This commit is contained in:
23
app.js
23
app.js
@@ -7,11 +7,11 @@ const { initConfig, splitPacket, upload, decodeProto, log, setupHost, KPacket, d
|
||||
const { exportData } = require("./export")
|
||||
const { exitHook } = require("./exitHook.js");
|
||||
|
||||
// TODO: i18n
|
||||
// TODO: send ack to avoid resend
|
||||
// TODO: use kotlin rewrite it
|
||||
(async () => {
|
||||
try {
|
||||
exitHook(() => {
|
||||
setupHost(true)
|
||||
console.log("按任意键退出")
|
||||
cp.execSync("pause > nul", { stdio: "inherit" })
|
||||
})
|
||||
@@ -25,17 +25,18 @@ const { exitHook } = require("./exitHook.js");
|
||||
}
|
||||
await checkUpdate()
|
||||
checkCDN().then(_ => debug("CDN check success."))
|
||||
let gameProcess
|
||||
let unexpectedExit = true
|
||||
const gameProcess = cp.execFile(conf.executable, { cwd: conf.path },err => {
|
||||
if (err !== null && !err.killed) {
|
||||
throw err
|
||||
}
|
||||
})
|
||||
gameProcess.on("exit", () => {
|
||||
if (unexpectedExit) process.exit(0)
|
||||
})
|
||||
rs.create(conf,() => {
|
||||
setupHost()
|
||||
gameProcess = cp.execFile(conf.executable, { cwd: conf.path },err => {
|
||||
if (err !== null && !err.killed) {
|
||||
throw err
|
||||
}
|
||||
})
|
||||
gameProcess.on("exit", () => {
|
||||
if (unexpectedExit) process.exit(0)
|
||||
})
|
||||
},(ip, port, hServer) => {
|
||||
let login = false
|
||||
let cache = new Map()
|
||||
@@ -143,6 +144,6 @@ const { exitHook } = require("./exitHook.js");
|
||||
} else {
|
||||
appcenter.uploadError(Error(e), true)
|
||||
}
|
||||
process.exit(0)
|
||||
process.exit(1)
|
||||
}
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user