welsonjs/lib/ldplayer.js

44 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-10-19 08:11:56 +00:00
////////////////////////////////////////////////////////////////////////
// LDPlayer API
///////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell");
var SYS = require("lib/system");
exports.VERSIONINFO = "LDPlayer (ldplayer.js) version 0.1";
exports.global = global;
exports.require = global.require;
exports.getList = function() {
2020-10-20 02:41:26 +00:00
var data = [];
2020-11-18 08:46:26 +00:00
var commands = [
[SYS.getEnvString("SYSTEMDRIVE") + "/LDPlayer/LDPlayer4.0/ldconsole.exe", "list2"],
2020-11-27 06:58:43 +00:00
[SYS.getEnvString("SYSTEMDRIVE") + "/LDPlayer/LDPlayer3.0/ldconsole.exe", "list2"],
2020-12-07 03:48:37 +00:00
[SYS.getEnvString("SYSTEMDRIVE") + "/NOXGAMES/MOMO/ldconsole.exe", "list2"],
[SYS.getEnvString("SYSTEMDRIVE") + "/XuanZhi/LDPlayer/ldconsole.exe", "list2"]
2020-10-20 02:41:26 +00:00
];
2020-11-18 08:46:26 +00:00
for (var i = 0; i < commands.length; i++) {
var result = SHELL.exec(commands[i]);
var lines = result.split(/\r?\n/);
2020-10-20 02:41:26 +00:00
2020-11-18 08:46:26 +00:00
for(var k = 0; k < lines.length; k++) {
var row = lines[k].split(',');
if(row.length == 7) {
data.push({
index: row[0],
title: row[1],
topWindowHandle: row[2],
binddWindowHandle: row[3],
androidStarted: row[4],
PID: parseInt(row[5]),
PIDVBox: parseInt(row[6])
});
}
2020-10-20 02:41:26 +00:00
}
}
2020-11-18 08:46:26 +00:00
2020-10-20 02:41:26 +00:00
return data;
2020-10-19 08:11:56 +00:00
};