project-client/patches/arrpc@3.4.0.patch

51 lines
1.8 KiB
Diff
Raw Normal View History

2024-06-16 16:42:48 +00:00
diff --git a/src/process/index.js b/src/process/index.js
index 97ea651..29e964e 100644
2024-06-16 16:42:48 +00:00
--- a/src/process/index.js
+++ b/src/process/index.js
@@ -1,12 +1,7 @@
const rgb = (r, g, b, msg) => `\x1b[38;2;${r};${g};${b}m${msg}\x1b[0m`;
const log = (...args) => console.log(`[${rgb(88, 101, 242, 'arRPC')} > ${rgb(237, 66, 69, 'process')}]`, ...args);
2024-06-16 16:42:48 +00:00
-import fs from 'node:fs';
-import { dirname, join } from 'path';
-import { fileURLToPath } from 'url';
-
2024-06-16 16:42:48 +00:00
-const __dirname = dirname(fileURLToPath(import.meta.url));
-const DetectableDB = JSON.parse(fs.readFileSync(join(__dirname, 'detectable.json'), 'utf8'));
+const DetectableDB = require('./detectable.json');
import * as Natives from './native/index.js';
const Native = Natives[process.platform];
diff --git a/update_db.js b/update_db.js
index ed94923..24deace 100644
--- a/update_db.js
+++ b/update_db.js
@@ -1,5 +1,5 @@
#!/usr/bin/env node
-import { createWriteStream, readFileSync } from 'fs';
+import { createWriteStream, readFileSync, writeFileSync } from 'fs';
import { get } from 'https';
import { dirname, join } from 'path';
@@ -25,5 +25,19 @@ get('https://discord.com/api/v9/applications/detectable', res => {
const oldNames = current.map(x => x.name);
const newNames = updated.map(x => x.name);
console.log(newNames.filter(x => !oldNames.includes(x)));
+
+ // append obs for auto streammode
+ updated.push({
+ aliases: ["Obs"],
+ executables: [
+ { is_launcher: false, name: "obs", os: "linux" },
+ { is_launcher: false, name: "obs.exe", os: "win32" },
+ { is_launcher: false, name: "obs.app", os: "darwin" }
+ ],
+ hook: true,
+ id: "STREAMERMODE",
+ name: "OBS"
+ });
+ writeFileSync(path, JSON.stringify(updated), 'utf8');
})
});
\ No newline at end of file