mirror of
https://github.com/zoriya/EAU.git
synced 2026-06-04 03:07:01 +00:00
fixed library discovery
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
// const LocalGameDiscovery = require("./src/js/LocalGameSearch");
|
||||
const LocalGameDiscovery = require("./src/js/LocalGameSearch");
|
||||
const Store = require("./src/js/store");
|
||||
const log = require("electron-log");
|
||||
|
||||
@@ -42,8 +42,8 @@ else
|
||||
createWindow();
|
||||
});
|
||||
|
||||
// console.log(typeof LocalGameDiscovery.init);
|
||||
// LocalGameDiscovery.init();
|
||||
|
||||
LocalGameDiscovery.init();
|
||||
}
|
||||
|
||||
function createWindow()
|
||||
|
||||
Generated
+2451
-2441
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -6,10 +6,12 @@
|
||||
"dependencies": {
|
||||
"@types/jquery": "^3.3.29",
|
||||
"bootstrap": "^4.3.1",
|
||||
"electron-log": "^3.0.4",
|
||||
"fs": "0.0.1-security",
|
||||
"jquery": "^3.3.1",
|
||||
"popper.js": "^1.14.7",
|
||||
"electron-log": "^3.0.4"
|
||||
"simple-vdf": "^1.1.1",
|
||||
"winreg": "^1.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^4.1.1",
|
||||
|
||||
@@ -11,6 +11,7 @@ module.exports = {
|
||||
|
||||
function GetGameLocation()
|
||||
{
|
||||
|
||||
//64bit regObj path
|
||||
RegSteamPath = new Registery({
|
||||
hive: Registery.HKLM,
|
||||
@@ -43,7 +44,6 @@ function GetLibrary(err, data)
|
||||
|
||||
|
||||
let NormalisedSteamPath = path.normalize(data.value + "/steamapps/libraryfolders.vdf");
|
||||
console.log("normalised path: " + NormalisedSteamPath);
|
||||
|
||||
//read game library location
|
||||
|
||||
@@ -56,15 +56,27 @@ function GetLibrary(err, data)
|
||||
let str = data.toString();
|
||||
let raw = vdf.parse(str);
|
||||
let SteamJSONobj = JSON.parse( JSON.stringify(raw) );
|
||||
console.log(SteamJSONobj.LibraryFolders["1"]);
|
||||
|
||||
if (SteamJSONobj === null){console.warn("can't read json")}
|
||||
|
||||
for (let i = 0; i > 10; i++ )
|
||||
var libraries = [];
|
||||
|
||||
//get object lenght, +1 because i start at 1
|
||||
let totalKey = Object.keys(SteamJSONobj.LibraryFolders).length + 1;
|
||||
|
||||
for (let i = 1; i < totalKey; i++ )
|
||||
{
|
||||
console.log(SteamJSONobj.LibraryFolders);
|
||||
if(SteamJSONobj.LibraryFolders[i] != null)
|
||||
{
|
||||
//WARNING i is initiliated at 1
|
||||
libraries[i-1] = SteamJSONobj.LibraryFolders[i];
|
||||
console.log(libraries[i-1]);
|
||||
}
|
||||
}
|
||||
//console.log(SteamJSONobj.LibraryFolders.1);
|
||||
|
||||
});
|
||||
function AnalyseLibrary(err, data)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user