Update BdsManegerServer.js #246

Merged
Sirherobrine23 merged 1 commits from SocketSo into main 2021-11-23 11:48:25 +00:00

View File

@ -290,7 +290,8 @@ module.exports.StartServer = function start() {
}); });
// Socket.io // Socket.io
io.on("ServerCommand", (data = "") => { io.on("connection", socket => {
socket.on("ServerCommand", (data, callback) => {
if (typeof data === "string") return returnFuntion.command(data); if (typeof data === "string") return returnFuntion.command(data);
else if (typeof data === "object") { else if (typeof data === "object") {
if (typeof data.uuid === "string") { if (typeof data.uuid === "string") {
@ -299,6 +300,7 @@ module.exports.StartServer = function start() {
} }
return; return;
}); });
});
ServerExec.on("exit", code => io.emit("ServerExit", { ServerExec.on("exit", code => io.emit("ServerExit", {
UUID: returnFuntion.uuid, UUID: returnFuntion.uuid,
exitCode: code exitCode: code
@ -438,4 +440,4 @@ module.exports.CronBackups = BdsSettings.GetCronBackup().map(Crron => {
else console.info("Oracle Bucket Backup Disabled"); else console.info("Oracle Bucket Backup Disabled");
}) })
} }
}); });