mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
fix
This commit is contained in:
parent
187adf9b34
commit
3fb0613444
|
@ -125,6 +125,14 @@ exports.getPIDList = function() {
|
|||
return result;
|
||||
};
|
||||
|
||||
exports.isAlivePID = function(pid) {
|
||||
if (!pid) {
|
||||
return false;
|
||||
} else {
|
||||
return (exports.getPIDList().indexOf(pid) > -1);
|
||||
}
|
||||
};
|
||||
|
||||
exports.getProcessListByName = function(name) {
|
||||
return exports.getProcessList().filter(function(s) {
|
||||
return (s.Caption === name);
|
||||
|
|
18
shadow.js
18
shadow.js
|
@ -57,16 +57,18 @@ var check_LDPlayer = function() {
|
|||
AppsMutex.push(pid);
|
||||
|
||||
if (title in Apps.LDPlayer) {
|
||||
while (!SYS.isAlivePID(ssPID)) {
|
||||
var ss = SS.connect(Apps.LDPlayer[title]);
|
||||
ssPort = ss.listenPort;
|
||||
ssPID = ss.processID;
|
||||
}
|
||||
} else {
|
||||
console.error("Not assigned static IP: " + title);
|
||||
continue;
|
||||
}
|
||||
|
||||
var process;
|
||||
while (!(shadowPID > 0)) {
|
||||
while (!SYS.isAlivePID(shadowPID)) {
|
||||
process = SHELL.createProcess([
|
||||
SYS.getCurrentScriptDirectory() + "/bin/shadow.exe",
|
||||
"-c",
|
||||
|
@ -76,7 +78,7 @@ var check_LDPlayer = function() {
|
|||
"-p",
|
||||
pid
|
||||
]);
|
||||
sleep(1000);
|
||||
sleep(3000);
|
||||
shadowPID = process.ProcessID;
|
||||
}
|
||||
|
||||
|
@ -102,16 +104,18 @@ var check_NoxPlayer = function() {
|
|||
AppsMutex.push(pid);
|
||||
|
||||
if (hostname in Apps.NoxPlayer) {
|
||||
while (!SYS.isAlivePID(ssPID)) {
|
||||
var ss = SS.connect(Apps.NoxPlayer[hostname]);
|
||||
ssPort = ss.listenPort;
|
||||
ssPID = ss.processID;
|
||||
}
|
||||
} else {
|
||||
console.error("Not assigned static IP: " + hostname);
|
||||
continue;
|
||||
}
|
||||
|
||||
var process;
|
||||
while (!(shadowPID > 0)) {
|
||||
while (!SYS.isAlivePID(shadowPID)) {
|
||||
process = SHELL.createProcess([
|
||||
SYS.getCurrentScriptDirectory() + "/bin/shadow.exe",
|
||||
"-c",
|
||||
|
@ -121,7 +125,7 @@ var check_NoxPlayer = function() {
|
|||
"-p",
|
||||
pid
|
||||
]);
|
||||
sleep(1000);
|
||||
sleep(3000);
|
||||
shadowPID = process.ProcessID;
|
||||
}
|
||||
|
||||
|
@ -156,13 +160,15 @@ var check_ProcessName = function() {
|
|||
AppsMutex.push("processName_" + uniqueId);
|
||||
|
||||
// 소켓 연결
|
||||
while (!SYS.isAlivePID(ssPID)) {
|
||||
var ss = SS.connect(Apps.ProcessName[uniqueId]);
|
||||
ssPort = ss.listenPort;
|
||||
ssPID = ss.processID;
|
||||
}
|
||||
|
||||
// 프로세스 이름으로 실행
|
||||
var process;
|
||||
while (!(shadowPID > 0)) {
|
||||
while (!SYS.isAlivePID(shadowPID)) {
|
||||
process = SHELL.createProcess([
|
||||
SYS.getCurrentScriptDirectory() + "/bin/shadow.exe",
|
||||
"-c",
|
||||
|
@ -172,7 +178,7 @@ var check_ProcessName = function() {
|
|||
"-n",
|
||||
uniqueId
|
||||
]);
|
||||
sleep(1000);
|
||||
sleep(3000);
|
||||
shadowPID = process.ProcessID;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user