Skip to content

Commit 344112e

Browse files
committed
fix: fix demo
1 parent 81c4ab8 commit 344112e

File tree

5 files changed

+326
-323
lines changed

5 files changed

+326
-323
lines changed

apps/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"systeminformation": "^5.17.3",
1818
"win-control": "^0.3.1",
1919
"windows-tlist": "^0.1.3",
20-
"wql-process-monitor": "^3.0.1"
20+
"wql-process-monitor": "3.0.1"
2121
},
2222
"devDependencies": {
2323
"@packages/animalese": "0.0.0",

apps/app/resources/detect-game.js

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
1-
const { getProcessInfo } = require('windows-tlist')
1+
const {getProcessInfo} = require('windows-tlist')
22
const wqlImport = import('wql-process-monitor')
33

44
function send(...args) {
5-
process.send(...args)
5+
process.send(...args)
66
}
77

88
wqlImport.then((wql) => {
9-
const { subscribe } = wql
10-
return subscribe({
11-
creation: true,
12-
deletion: false,
13-
bin: {
14-
filter: ['cmd.exe', 'tlist.exe', 'conhost.exe'],
15-
},
16-
})
9+
const {subscribe} = wql
10+
return subscribe({
11+
creation: true,
12+
deletion: false,
13+
bin: {
14+
filter: ['cmd.exe', 'tlist.exe', 'conhost.exe'],
15+
},
16+
})
1717
})
18-
.then((processMonitor) => {
18+
.then((processMonitor) => {
19+
20+
processMonitor.on('creation', ([process, pid, filepath, user]) => {
1921

20-
processMonitor.on('creation', ([process, pid, filepath, user]) => {
21-
22-
console.log(`[game-detection]: process creation - ${process}::${pid}(${user}) ["${filepath}"]`)
23-
// getProcessInfo(pid)
24-
// .then(processInfo => {
25-
const isGame = [
26-
// processInfo.modules.find(module => module.path.includes('d3d')),
27-
// processInfo.modules.find(module => module.path.includes('dxgi')),
28-
// processInfo.modules.find(module => module.path.includes('steamapps')),
29-
filepath.includes('steamapps'),
30-
].every(Boolean)
31-
if (isGame) {
32-
console.log('[game-detection]: Game launched', filepath)
33-
send({
34-
type: 'game-detection',
35-
payload: {
36-
process, pid, filepath, user,
37-
},
22+
console.log(`[game-detection]: process creation - ${process}::${pid}(${user}) ["${filepath}"]`)
23+
// getProcessInfo(pid)
24+
// .then(processInfo => {
25+
const isGame = [
26+
// processInfo.modules.find(module => module.path.includes('d3d')),
27+
// processInfo.modules.find(module => module.path.includes('dxgi')),
28+
// processInfo.modules.find(module => module.path.includes('steamapps')),
29+
filepath.includes('steamapps'),
30+
filepath.includes('demo.exe'),
31+
].some(Boolean)
32+
if (isGame) {
33+
console.log('[game-detection]: Game launched', filepath)
34+
send({
35+
type: 'game-detection',
36+
payload: {
37+
process, pid, filepath, user,
38+
},
39+
})
40+
}
41+
// })
3842
})
39-
}
40-
// })
4143
})
42-
})
4344

4445
setInterval(() => {
4546
}, 1000 * 60 * 60)

0 commit comments

Comments
 (0)