Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
[Release] 2.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Akkadius committed Aug 29, 2023
1 parent ba3f213 commit b2b38fb
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
5 changes: 4 additions & 1 deletion frontend/src/.editorconfig → .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_size = 2
trim_trailing_whitespace = true

[*.md]
Expand All @@ -14,6 +14,9 @@ trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2

[*.js]
indent_size = 2

[*.ts]
indent_size = 2

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.6]

* [Process Management] Overhaul Windows launcher process management strategy to be more resilient. This unfortunately will have processes launch in the foreground but will be more stable.

## [2.3.5]

* [Process Management] Windows launcher fix edge case
Expand Down
41 changes: 24 additions & 17 deletions app/core/server-process-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,15 @@ module.exports = {
);
}

require('child_process').exec(startProcessString);
let startArgs = ["/c"].concat(startProcessString.split(" ")).concat(args);

require('child_process').spawn("cmd.exe", startArgs,
{
detached: true,
stdio: 'ignore',
cwd: pathManager.getEmuServerPath()
}
);

config.setAdminPanelConfig('launcher.isRunning', true);
console.log("[Process Manager] Starting server launcher...");
Expand All @@ -438,7 +446,7 @@ module.exports = {
*/
async cancelRestart(options = []) {
if (options.cancel) {
this.cancelTimedRestart = true;
this.cancelTimedRestart = true;
this.cancelTimedShutdown = true;
await serverDataService.messageWorld('[SERVER MESSAGE] Server stop cancelled');
}
Expand Down Expand Up @@ -558,13 +566,12 @@ module.exports = {
process_name + '.exe',
);

require('child_process').spawn(startProcessString, args,
let startArgs = ["/c", "start", "/B"].concat(startProcessString.split(" ")).concat(args);
require('child_process').spawn("cmd.exe", startArgs,
{
cwd: pathManager.emuServerPath,
detached: true,
shell: false,
stdio: 'pipe',
windowsHide: true,
stdio: 'ignore',
cwd: pathManager.getEmuServerPath()
}
);
}
Expand All @@ -578,7 +585,7 @@ module.exports = {

require('child_process').spawn(startProcessString,
{
cwd: pathManager.emuServerPath,
cwd: pathManager.getEmuServerPath(),
encoding: 'utf8',
shell: '/bin/bash',
detached: true
Expand Down Expand Up @@ -630,7 +637,7 @@ module.exports = {
this.systemProcessList.forEach((process) => {

// statics
if (process.name.includes("zone") && process.cmd.includes(" ")) {
if (process.cmd.includes("zone") && process.cmd.includes(" ")) {
try {
const zone = process.cmd.split(" ")[1].trim()
this.onlineStatics.push(zone)
Expand Down Expand Up @@ -658,8 +665,8 @@ module.exports = {

if (os.isWindows()) {
const stdout = require('child_process')
.execSync("WMIC path win32_process get Description,Commandline,Processid /format:csv")
.toString();
.execSync("WMIC path win32_process get Description,Commandline,Processid /format:csv")
.toString();

stdout.split('\n').forEach((row) => {
if (row.includes(",") && !row.includes("Description,ProcessId")) {
Expand All @@ -668,20 +675,20 @@ module.exports = {
const splitLength = splitRow.length;
const processId = splitRow[splitLength - 1].trim();
const simpleProcessName = splitRow[splitLength - 2].replace('.exe', '').trim();
const cmdlineSplit = row
.replace("," + splitRow[splitLength - 1].trim(), '')
.replace("," + splitRow[splitLength - 2].trim(), '')
.split(",");
const cmdlineSplit = row
.replace("," + splitRow[splitLength - 1].trim(), '')
.replace("," + splitRow[splitLength - 2].trim(), '')
.split(",");

let commandLine = "";
let commandLine = "";
if (cmdlineSplit.length > 1) {
commandLine = cmdlineSplit[1].trim();
}

const proc = {
"name": simpleProcessName,
"pid": processId,
"cmd": commandLine
"cmd": commandLine.replace(/\s+/g, ' ')
};

processList.push(proc);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eqemu-admin",
"version": "2.3.5",
"version": "2.3.6",
"private": true,
"bin": "./app/bin/admin",
"scripts": {
Expand Down

0 comments on commit b2b38fb

Please sign in to comment.