forked from mirror/MCSM-Daemon
Fix: dep exe download err
This commit is contained in:
parent
5839c1566f
commit
bdeaad46bd
@ -21,7 +21,7 @@ function installPtyForLinux(url: string) {
|
||||
const file = fs.createWriteStream(PTY_PATH);
|
||||
https.get(url, (res) => {
|
||||
if (res.statusCode !== 200) {
|
||||
return reject(new Error("code!=200"));
|
||||
return reject(new Error(`Try download: ${url} failed.`));
|
||||
}
|
||||
res.on("error", (err) => {
|
||||
if (fs.existsSync(PTY_PATH)) fs.removeSync(PTY_PATH);
|
||||
|
@ -60,7 +60,7 @@ export function navigation(socket: Socket) {
|
||||
}
|
||||
// Register all events with Socket
|
||||
for (const event of routerApp.eventNames()) {
|
||||
socket.on(event, (protocol: IPacket) => {
|
||||
socket.on(event as string, (protocol: IPacket) => {
|
||||
if (!protocol) return logger.info(`session ${socket.id} request data protocol format is incorrect`);
|
||||
const ctx = new RouterContext(protocol.uuid, socket, session, event.toString());
|
||||
routerApp.emitRouter(event as string, ctx, protocol.data);
|
||||
|
Loading…
Reference in New Issue
Block a user