@overlayed/app 0.2.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +765 -3
- package/dist/index.js +1052 -709
- package/dist/native-interface/build/overlayed_native_interface_x64.node +0 -0
- package/dist/native-interface/main.js +10 -1
- package/dist/render-interface/build/overlayed_render_hook_x64.dll +0 -0
- package/dist/render-interface/build/overlayed_render_interface_x64.node +0 -0
- package/dist/siege.d.ts +2131 -0
- package/dist/siege.js +326 -0
- package/package.json +17 -10
- package/dist/config.d.ts +0 -5
- package/dist/managers/errorManager.d.ts +0 -34
- package/dist/managers/gameBuildManager.d.ts +0 -18
- package/dist/managers/gameLaunchManager.d.ts +0 -36
- package/dist/managers/keybindManager.d.ts +0 -38
- package/dist/managers/manager.d.ts +0 -18
- package/dist/managers/nativeModuleManager.d.ts +0 -31
- package/dist/managers/processManager.d.ts +0 -34
- package/dist/managers/ravenManager.d.ts +0 -35
- package/dist/overlayed.d.ts +0 -4
- package/dist/types.d.ts +0 -50
- package/dist/utils.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
return { all:
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
}, off: function(
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
}, emit: function(
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
s(
|
|
24
|
-
}), (
|
|
25
|
-
s(
|
|
1
|
+
var Ue = Object.defineProperty;
|
|
2
|
+
var ze = (n, e, t) => e in n ? Ue(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var c = (n, e, t) => ze(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { type as K } from "arktype";
|
|
5
|
+
import { createRequire as oe } from "node:module";
|
|
6
|
+
import k, { existsSync as qe, mkdirSync as We, readFileSync as _e, writeFileSync as Qe, copyFileSync as Xe } from "node:fs";
|
|
7
|
+
import m, { resolve as Je } from "node:path";
|
|
8
|
+
import v from "node:fs/promises";
|
|
9
|
+
import ke from "jszip";
|
|
10
|
+
import { createHash as Ye } from "node:crypto";
|
|
11
|
+
import Ze, { app as Pe } from "electron";
|
|
12
|
+
var et = Object.defineProperty, tt = (n, e, t) => e in n ? et(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, F = (n, e, t) => tt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
13
|
+
function nt(n) {
|
|
14
|
+
return { all: n = n || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
15
|
+
var r = n.get(e);
|
|
16
|
+
r ? r.push(t) : n.set(e, [t]);
|
|
17
|
+
}, off: function(e, t) {
|
|
18
|
+
var r = n.get(e);
|
|
19
|
+
r && (t ? r.splice(r.indexOf(t) >>> 0, 1) : n.set(e, []));
|
|
20
|
+
}, emit: function(e, t) {
|
|
21
|
+
var r = n.get(e);
|
|
22
|
+
r && r.slice().map(function(s) {
|
|
23
|
+
s(t);
|
|
24
|
+
}), (r = n.get("*")) && r.slice().map(function(s) {
|
|
25
|
+
s(e, t);
|
|
26
26
|
});
|
|
27
27
|
} };
|
|
28
28
|
}
|
|
29
|
-
let
|
|
29
|
+
let Ce = class {
|
|
30
30
|
constructor() {
|
|
31
|
-
|
|
31
|
+
F(this, "emitter"), this.emitter = nt();
|
|
32
32
|
}
|
|
33
|
-
on(
|
|
34
|
-
this.emitter.on(
|
|
33
|
+
on(e, t) {
|
|
34
|
+
this.emitter.on(e, t);
|
|
35
35
|
}
|
|
36
|
-
off(
|
|
37
|
-
this.emitter.off(
|
|
36
|
+
off(e, t) {
|
|
37
|
+
this.emitter.off(e, t);
|
|
38
38
|
}
|
|
39
|
-
emit(
|
|
40
|
-
this.emitter.emit(
|
|
39
|
+
emit(e, t) {
|
|
40
|
+
this.emitter.emit(e, t);
|
|
41
41
|
}
|
|
42
42
|
removeAllListeners() {
|
|
43
43
|
this.emitter.off("*", () => {
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
return
|
|
47
|
+
function Ke(n, ...e) {
|
|
48
|
+
var t;
|
|
49
|
+
return t = class extends n {
|
|
50
50
|
/**
|
|
51
51
|
* Lazy get the static instance
|
|
52
52
|
*/
|
|
53
53
|
static getInstance() {
|
|
54
|
-
return this._instance || (this._instance = new
|
|
54
|
+
return this._instance || (this._instance = new n(...e)), this._instance;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Release the instance (most of the time you won't need this)
|
|
@@ -59,28 +59,68 @@ function qe(r, ...t) {
|
|
|
59
59
|
static clearInstance() {
|
|
60
60
|
this._instance = void 0;
|
|
61
61
|
}
|
|
62
|
-
},
|
|
62
|
+
}, F(t, "_instance"), t;
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
class rt extends Ce {
|
|
65
|
+
destroy() {
|
|
66
|
+
this.removeAllListeners();
|
|
67
|
+
}
|
|
68
|
+
fatal(e, t, r) {
|
|
69
|
+
this.emit("fatal", {
|
|
70
|
+
code: t,
|
|
71
|
+
message: e,
|
|
72
|
+
data: r,
|
|
73
|
+
timestamp: Date.now()
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
error(e, t, r) {
|
|
77
|
+
this.emit("error", {
|
|
78
|
+
code: t,
|
|
79
|
+
message: e,
|
|
80
|
+
data: r,
|
|
81
|
+
timestamp: Date.now()
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
warn(e, t, r) {
|
|
85
|
+
this.emit("warning", {
|
|
86
|
+
code: t,
|
|
87
|
+
message: e,
|
|
88
|
+
data: r,
|
|
89
|
+
timestamp: Date.now()
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
Ke(rt);
|
|
94
|
+
const st = oe(import.meta.url), {
|
|
95
|
+
PipeEventServer: it,
|
|
96
|
+
PipeEventClient: Fn,
|
|
97
|
+
PipeEventBase: xn,
|
|
98
|
+
ProcessMonitor: Dn,
|
|
99
|
+
Process: $n,
|
|
100
|
+
InjectionMethod: Tn,
|
|
101
|
+
AccessLevel: Bn,
|
|
102
|
+
HardwareInterface: Gn
|
|
103
|
+
} = st("./build/overlayed_native_interface_x64.node");
|
|
104
|
+
let at = class extends Ce {
|
|
105
|
+
constructor(e) {
|
|
106
|
+
super(), F(this, "server", null), F(this, "_hasConnection", !1), F(this, "pipeId"), this.pipeId = e, this.init();
|
|
69
107
|
}
|
|
70
108
|
get hasConnection() {
|
|
71
109
|
return this._hasConnection;
|
|
72
110
|
}
|
|
73
111
|
destroy() {
|
|
74
|
-
var
|
|
75
|
-
this.server && (this._hasConnection = !1, (
|
|
112
|
+
var e;
|
|
113
|
+
this.server && (this._hasConnection = !1, (e = this.server) == null || e.removeAllListeners(), this.server = null);
|
|
76
114
|
}
|
|
115
|
+
// TODO make sure that new events and new event keys do not stop the app from working
|
|
116
|
+
// this is because we may have new events/event keys from a DLL but the types/validations might not be up to date
|
|
77
117
|
init() {
|
|
78
|
-
this.server = new
|
|
118
|
+
this.server = new it(this.pipeId, { clientCount: 1, access: 1 }), this.server.on("event", (e) => {
|
|
79
119
|
try {
|
|
80
|
-
const
|
|
81
|
-
this.emit("data",
|
|
82
|
-
} catch (
|
|
83
|
-
this.emit("error",
|
|
120
|
+
const t = JSON.parse(e);
|
|
121
|
+
this.emit("data", [t]);
|
|
122
|
+
} catch (t) {
|
|
123
|
+
this.emit("error", t);
|
|
84
124
|
}
|
|
85
125
|
}), this.server.on("connected", () => {
|
|
86
126
|
this._hasConnection = !0;
|
|
@@ -89,54 +129,50 @@ let Je = class extends We {
|
|
|
89
129
|
});
|
|
90
130
|
}
|
|
91
131
|
};
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
n && n.slice().map(function(s) {
|
|
107
|
-
s(e);
|
|
108
|
-
}), (n = r.get("*")) && n.slice().map(function(s) {
|
|
109
|
-
s(t, e);
|
|
132
|
+
const le = Ke(at, "stats-cc");
|
|
133
|
+
function ot(n) {
|
|
134
|
+
return { all: n = n || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
135
|
+
var r = n.get(e);
|
|
136
|
+
r ? r.push(t) : n.set(e, [t]);
|
|
137
|
+
}, off: function(e, t) {
|
|
138
|
+
var r = n.get(e);
|
|
139
|
+
r && (t ? r.splice(r.indexOf(t) >>> 0, 1) : n.set(e, []));
|
|
140
|
+
}, emit: function(e, t) {
|
|
141
|
+
var r = n.get(e);
|
|
142
|
+
r && r.slice().map(function(s) {
|
|
143
|
+
s(t);
|
|
144
|
+
}), (r = n.get("*")) && r.slice().map(function(s) {
|
|
145
|
+
s(e, t);
|
|
110
146
|
});
|
|
111
147
|
} };
|
|
112
148
|
}
|
|
113
|
-
class
|
|
149
|
+
class Se {
|
|
114
150
|
constructor() {
|
|
115
|
-
|
|
116
|
-
this.emitter =
|
|
151
|
+
c(this, "emitter");
|
|
152
|
+
this.emitter = ot();
|
|
117
153
|
}
|
|
118
|
-
on(
|
|
119
|
-
this.emitter.on(
|
|
154
|
+
on(e, t) {
|
|
155
|
+
this.emitter.on(e, t);
|
|
120
156
|
}
|
|
121
|
-
off(
|
|
122
|
-
this.emitter.off(
|
|
157
|
+
off(e, t) {
|
|
158
|
+
this.emitter.off(e, t);
|
|
123
159
|
}
|
|
124
|
-
emit(
|
|
125
|
-
this.emitter.emit(
|
|
160
|
+
emit(e, t) {
|
|
161
|
+
this.emitter.emit(e, t);
|
|
126
162
|
}
|
|
127
163
|
removeAllListeners() {
|
|
128
164
|
this.emitter.off("*", () => {
|
|
129
165
|
});
|
|
130
166
|
}
|
|
131
167
|
}
|
|
132
|
-
function
|
|
133
|
-
var
|
|
134
|
-
return
|
|
168
|
+
function _(n, ...e) {
|
|
169
|
+
var r;
|
|
170
|
+
return r = class extends n {
|
|
135
171
|
/**
|
|
136
172
|
* Lazy get the static instance
|
|
137
173
|
*/
|
|
138
174
|
static getInstance() {
|
|
139
|
-
return this._instance || (this._instance = new
|
|
175
|
+
return this._instance || (this._instance = new n(...e)), this._instance;
|
|
140
176
|
}
|
|
141
177
|
/**
|
|
142
178
|
* Release the instance (most of the time you won't need this)
|
|
@@ -144,163 +180,209 @@ function k(r, ...t) {
|
|
|
144
180
|
static clearInstance() {
|
|
145
181
|
this._instance = void 0;
|
|
146
182
|
}
|
|
147
|
-
},
|
|
183
|
+
}, c(r, "_instance"), r;
|
|
148
184
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
} catch (t) {
|
|
153
|
-
return [null, t];
|
|
185
|
+
class lt extends Se {
|
|
186
|
+
destroy() {
|
|
187
|
+
this.removeAllListeners();
|
|
154
188
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return e;
|
|
163
|
-
}
|
|
164
|
-
class rt {
|
|
165
|
-
constructor(t) {
|
|
166
|
-
l(this, "options");
|
|
167
|
-
l(this, "_data");
|
|
168
|
-
this.options = t, this._data = this.load();
|
|
189
|
+
fatal(e, t, r) {
|
|
190
|
+
this.emit("fatal", {
|
|
191
|
+
code: t,
|
|
192
|
+
message: e,
|
|
193
|
+
data: r,
|
|
194
|
+
timestamp: Date.now()
|
|
195
|
+
});
|
|
169
196
|
}
|
|
170
|
-
|
|
171
|
-
|
|
197
|
+
error(e, t, r) {
|
|
198
|
+
this.emit("error", {
|
|
199
|
+
code: t,
|
|
200
|
+
message: e,
|
|
201
|
+
data: r,
|
|
202
|
+
timestamp: Date.now()
|
|
203
|
+
});
|
|
172
204
|
}
|
|
173
|
-
|
|
174
|
-
this.
|
|
205
|
+
warn(e, t, r) {
|
|
206
|
+
this.emit("warning", {
|
|
207
|
+
code: t,
|
|
208
|
+
message: e,
|
|
209
|
+
data: r,
|
|
210
|
+
timestamp: Date.now()
|
|
211
|
+
});
|
|
175
212
|
}
|
|
176
|
-
|
|
177
|
-
|
|
213
|
+
}
|
|
214
|
+
const E = _(lt);
|
|
215
|
+
class ct {
|
|
216
|
+
constructor(e) {
|
|
217
|
+
c(this, "data");
|
|
218
|
+
c(this, "_schema");
|
|
219
|
+
c(this, "_defaultValue");
|
|
220
|
+
c(this, "_path");
|
|
221
|
+
const { schema: t, default: r, path: s } = e;
|
|
222
|
+
this._schema = t, this._defaultValue = r, this._path = s;
|
|
223
|
+
}
|
|
224
|
+
set(e) {
|
|
225
|
+
const t = this._schema["~standard"].validate(e);
|
|
226
|
+
if (t instanceof Promise)
|
|
227
|
+
throw new Error("StructuredConfigFile does not support async validation");
|
|
228
|
+
if (t.issues) {
|
|
229
|
+
this.reportInvalidConfigFile(t.issues);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this.data = this.onBeforeSave(e), this.save(e);
|
|
178
233
|
}
|
|
179
|
-
|
|
180
|
-
return
|
|
234
|
+
get() {
|
|
235
|
+
return this.data ? this.data : this.load();
|
|
181
236
|
}
|
|
182
|
-
|
|
237
|
+
getKey(e) {
|
|
238
|
+
return this.get()[e];
|
|
239
|
+
}
|
|
240
|
+
save(e) {
|
|
241
|
+
const t = this.onBeforeSave(e);
|
|
183
242
|
try {
|
|
184
|
-
|
|
185
|
-
w.writeFileSync(this.options.path, JSON.stringify(t, null, 2));
|
|
243
|
+
k.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
|
|
186
244
|
} catch {
|
|
245
|
+
return;
|
|
187
246
|
}
|
|
247
|
+
return this.data = t;
|
|
188
248
|
}
|
|
189
249
|
load() {
|
|
190
|
-
if (!this.fileExists(this.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return this.
|
|
194
|
-
|
|
195
|
-
return n ? this.setupDefaultData(!0) : this.onAfterLoad(e);
|
|
196
|
-
}
|
|
197
|
-
canReadWriteFile(t) {
|
|
250
|
+
if (!this.fileExists(this.getFilePath()) || !this.canReadWriteFile(this.getFilePath())) {
|
|
251
|
+
this.save(this._defaultValue);
|
|
252
|
+
const e = this.onAfterLoad(this._defaultValue);
|
|
253
|
+
return this.data = e, e;
|
|
254
|
+
}
|
|
198
255
|
try {
|
|
199
|
-
|
|
256
|
+
const e = k.readFileSync(this.getFilePath(), "utf8"), t = this.onAfterLoad(this.parseStoredData(e));
|
|
257
|
+
return this.data = t, t;
|
|
200
258
|
} catch {
|
|
201
|
-
return
|
|
259
|
+
return this.data = this._defaultValue;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
onBeforeSave(e) {
|
|
263
|
+
return e;
|
|
264
|
+
}
|
|
265
|
+
onAfterLoad(e) {
|
|
266
|
+
return e;
|
|
267
|
+
}
|
|
268
|
+
getFilePath() {
|
|
269
|
+
return this._path;
|
|
270
|
+
}
|
|
271
|
+
parseStoredData(e) {
|
|
272
|
+
try {
|
|
273
|
+
const r = K("string.json.parse").to("object")(e);
|
|
274
|
+
if (r instanceof K.errors)
|
|
275
|
+
return this._defaultValue;
|
|
276
|
+
const s = this._schema["~standard"].validate(r);
|
|
277
|
+
if (s instanceof Promise)
|
|
278
|
+
throw new Error("StructuredConfigFile does not support async validation");
|
|
279
|
+
return s.issues ? this.migrate(r, this._defaultValue) : this.migrate(s.value, this._defaultValue);
|
|
280
|
+
} catch {
|
|
281
|
+
return this._defaultValue;
|
|
202
282
|
}
|
|
203
283
|
}
|
|
204
|
-
|
|
284
|
+
canReadWriteFile(e) {
|
|
205
285
|
try {
|
|
206
|
-
return
|
|
286
|
+
return k.accessSync(e, k.constants.R_OK | k.constants.W_OK), !0;
|
|
207
287
|
} catch {
|
|
208
288
|
return !1;
|
|
209
289
|
}
|
|
210
290
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
super(e);
|
|
218
|
-
l(this, "options");
|
|
219
|
-
this.options = e;
|
|
220
|
-
}
|
|
221
|
-
get data() {
|
|
222
|
-
const e = this.options.schema["~standard"].validate(super.data);
|
|
223
|
-
if (e instanceof Promise)
|
|
224
|
-
throw new Error("StructuredConfigFile does not support async validation");
|
|
225
|
-
return e.issues ? this.options.default : e.value;
|
|
226
|
-
}
|
|
227
|
-
set data(e) {
|
|
228
|
-
const n = this.options.schema["~standard"].validate(e);
|
|
229
|
-
if (n instanceof Promise)
|
|
230
|
-
throw new Error("StructuredConfigFile does not support async validation");
|
|
231
|
-
n.issues || (super.data = n.value);
|
|
291
|
+
fileExists(e) {
|
|
292
|
+
try {
|
|
293
|
+
return k.accessSync(e, k.constants.F_OK), !0;
|
|
294
|
+
} catch {
|
|
295
|
+
return !1;
|
|
296
|
+
}
|
|
232
297
|
}
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return
|
|
298
|
+
migrate(e, t) {
|
|
299
|
+
const r = { ...e };
|
|
300
|
+
for (const s in t)
|
|
301
|
+
Object.prototype.hasOwnProperty.call(t, s) && (s in e ? e[s] !== null && t[s] !== null && typeof e[s] == "object" && typeof t[s] == "object" && !Array.isArray(e[s]) && !Array.isArray(t[s]) ? r[s] = this.migrate(e[s], t[s]) : Array.isArray(t[s]) && (r[s] = e[s]) : r[s] = t[s]);
|
|
302
|
+
return r;
|
|
303
|
+
}
|
|
304
|
+
reportInvalidConfigFile(e) {
|
|
305
|
+
E.getInstance().error("Invalid config file", "INVALID_CONFIG_FILE", {
|
|
306
|
+
issues: e.map((t) => t.message),
|
|
307
|
+
filePath: this._path,
|
|
308
|
+
data: this.data
|
|
309
|
+
});
|
|
238
310
|
}
|
|
239
311
|
}
|
|
240
|
-
const
|
|
241
|
-
scope: (
|
|
242
|
-
log: (...
|
|
243
|
-
console.log(
|
|
312
|
+
const Me = {
|
|
313
|
+
scope: (n) => ({
|
|
314
|
+
log: (...e) => {
|
|
315
|
+
console.log(n, ...e);
|
|
244
316
|
},
|
|
245
|
-
error: (...
|
|
246
|
-
console.error(
|
|
317
|
+
error: (...e) => {
|
|
318
|
+
console.error(n, ...e);
|
|
247
319
|
},
|
|
248
|
-
warn: (...
|
|
249
|
-
console.warn(
|
|
320
|
+
warn: (...e) => {
|
|
321
|
+
console.warn(n, ...e);
|
|
250
322
|
},
|
|
251
|
-
info: (...
|
|
252
|
-
console.info(
|
|
323
|
+
info: (...e) => {
|
|
324
|
+
console.info(n, ...e);
|
|
253
325
|
},
|
|
254
|
-
debug: (...
|
|
255
|
-
console.debug(
|
|
326
|
+
debug: (...e) => {
|
|
327
|
+
console.debug(n, ...e);
|
|
256
328
|
},
|
|
257
|
-
captureSentryException: (...
|
|
258
|
-
console.error(
|
|
329
|
+
captureSentryException: (...e) => {
|
|
330
|
+
console.error(n, ...e);
|
|
259
331
|
},
|
|
260
|
-
sentryError: (...
|
|
261
|
-
console.error(
|
|
332
|
+
sentryError: (...e) => {
|
|
333
|
+
console.error(n, ...e);
|
|
262
334
|
},
|
|
263
|
-
sentryLog: (...
|
|
264
|
-
console.log(
|
|
335
|
+
sentryLog: (...e) => {
|
|
336
|
+
console.log(n, ...e);
|
|
265
337
|
},
|
|
266
|
-
sentryWarn: (...
|
|
267
|
-
console.warn(
|
|
338
|
+
sentryWarn: (...e) => {
|
|
339
|
+
console.warn(n, ...e);
|
|
268
340
|
}
|
|
269
341
|
}),
|
|
270
|
-
error: (...
|
|
271
|
-
console.error(name, ...
|
|
342
|
+
error: (...n) => {
|
|
343
|
+
console.error(name, ...n);
|
|
272
344
|
},
|
|
273
|
-
warn: (...
|
|
274
|
-
console.warn(name, ...
|
|
345
|
+
warn: (...n) => {
|
|
346
|
+
console.warn(name, ...n);
|
|
275
347
|
},
|
|
276
|
-
info: (...
|
|
277
|
-
console.info(name, ...
|
|
348
|
+
info: (...n) => {
|
|
349
|
+
console.info(name, ...n);
|
|
278
350
|
},
|
|
279
|
-
debug: (...
|
|
280
|
-
console.debug(name, ...
|
|
351
|
+
debug: (...n) => {
|
|
352
|
+
console.debug(name, ...n);
|
|
281
353
|
},
|
|
282
|
-
captureSentryException: (...
|
|
283
|
-
console.error(name, ...
|
|
354
|
+
captureSentryException: (...n) => {
|
|
355
|
+
console.error(name, ...n);
|
|
284
356
|
},
|
|
285
|
-
sentryError: (...
|
|
286
|
-
console.error(name, ...
|
|
357
|
+
sentryError: (...n) => {
|
|
358
|
+
console.error(name, ...n);
|
|
287
359
|
},
|
|
288
|
-
sentryLog: (...
|
|
289
|
-
console.log(name, ...
|
|
360
|
+
sentryLog: (...n) => {
|
|
361
|
+
console.log(name, ...n);
|
|
290
362
|
},
|
|
291
|
-
sentryWarn: (...
|
|
292
|
-
console.warn(name, ...
|
|
363
|
+
sentryWarn: (...n) => {
|
|
364
|
+
console.warn(name, ...n);
|
|
293
365
|
},
|
|
294
|
-
sentryInfo: (...
|
|
295
|
-
console.info(name, ...
|
|
366
|
+
sentryInfo: (...n) => {
|
|
367
|
+
console.info(name, ...n);
|
|
296
368
|
}
|
|
297
|
-
},
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
369
|
+
}, Y = () => m.join(process.env.APPDATA ?? "", "overlayed");
|
|
370
|
+
function ut() {
|
|
371
|
+
return m.normalize(Y());
|
|
372
|
+
}
|
|
373
|
+
function dt(n = []) {
|
|
374
|
+
return m.normalize(m.join(Y(), global.OVERLAYED.APP_NAME, ...n));
|
|
375
|
+
}
|
|
376
|
+
const ht = K({
|
|
377
|
+
game: "string",
|
|
378
|
+
type: "string",
|
|
379
|
+
creation_time: "number"
|
|
380
|
+
});
|
|
381
|
+
class Ae {
|
|
382
|
+
constructor(e) {
|
|
383
|
+
c(this, "logger");
|
|
384
|
+
c(this, "initialized", !1);
|
|
385
|
+
this.logger = Me.scope(e);
|
|
304
386
|
}
|
|
305
387
|
init() {
|
|
306
388
|
this.logger.log("Initializing"), this.initialized = !0;
|
|
@@ -309,12 +391,12 @@ class st {
|
|
|
309
391
|
this.logger.log("Destroying"), this.initialized = !1;
|
|
310
392
|
}
|
|
311
393
|
}
|
|
312
|
-
class
|
|
313
|
-
constructor(
|
|
394
|
+
class G extends Se {
|
|
395
|
+
constructor(t) {
|
|
314
396
|
super();
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
this.logger =
|
|
397
|
+
c(this, "logger");
|
|
398
|
+
c(this, "initialized", !1);
|
|
399
|
+
this.logger = Me.scope(t);
|
|
318
400
|
}
|
|
319
401
|
init() {
|
|
320
402
|
this.logger.log("Initializing"), this.initialized = !0;
|
|
@@ -323,403 +405,388 @@ class C extends et {
|
|
|
323
405
|
this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
|
|
324
406
|
}
|
|
325
407
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
this.emit("error", {
|
|
332
|
-
code: e,
|
|
333
|
-
message: t,
|
|
334
|
-
data: n,
|
|
335
|
-
timestamp: Date.now()
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
warn(t, e, n) {
|
|
339
|
-
this.emit("warning", {
|
|
340
|
-
code: e,
|
|
341
|
-
message: t,
|
|
342
|
-
data: n,
|
|
343
|
-
timestamp: Date.now()
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
const be = k(it);
|
|
348
|
-
function ot() {
|
|
349
|
-
return p.normalize(F);
|
|
350
|
-
}
|
|
351
|
-
var I = "object", Ee = "function", we = "prototype", q = "text", re = "json", le = "abort", J = "paramsSerializer", ue = "addEventListener", O = "status", v = "headers", W = Object, _ = void 0, N = null, Q = W[we], j = W.keys, M = Array.isArray, he = "method", _e = "HEAD", Y = "GET", ke = "OPTIONS", at = "POST", ct = "PUT", lt = "PATCH", ut = "DELETE";
|
|
352
|
-
function ht(r, t) {
|
|
353
|
-
let e = new AbortController();
|
|
354
|
-
function n(a) {
|
|
355
|
-
e.abort(a), i();
|
|
408
|
+
var L = "object", Le = "function", Oe = "prototype", ee = "text", ce = "json", ye = "abort", ne = "paramsSerializer", me = "addEventListener", V = "status", w = "headers", Z = Object, S = void 0, W = null, re = Z[Oe], Q = Z.keys, x = Array.isArray, be = "method", Re = "HEAD", se = "GET", Fe = "OPTIONS", gt = "POST", ft = "PUT", pt = "PATCH", yt = "DELETE";
|
|
409
|
+
function mt(n, e) {
|
|
410
|
+
let t = new AbortController();
|
|
411
|
+
function r(o) {
|
|
412
|
+
t.abort(o), i();
|
|
356
413
|
}
|
|
357
414
|
let s = [];
|
|
358
|
-
for (let
|
|
359
|
-
if ((
|
|
360
|
-
|
|
415
|
+
for (let o of n) {
|
|
416
|
+
if ((o == null ? void 0 : o.aborted) === !0) {
|
|
417
|
+
r(o.reason);
|
|
361
418
|
break;
|
|
362
419
|
}
|
|
363
|
-
if (
|
|
364
|
-
let
|
|
365
|
-
|
|
420
|
+
if (o != null && o[me]) {
|
|
421
|
+
let l = () => {
|
|
422
|
+
r(o.reason);
|
|
366
423
|
};
|
|
367
424
|
s.push(() => {
|
|
368
425
|
var d;
|
|
369
|
-
(d =
|
|
370
|
-
}),
|
|
426
|
+
(d = o.removeEventListener) == null || d.call(o, ye, l);
|
|
427
|
+
}), o[me](ye, l);
|
|
371
428
|
}
|
|
372
429
|
}
|
|
373
430
|
function i() {
|
|
374
|
-
s.forEach((
|
|
431
|
+
s.forEach((o) => o()), e == null || e();
|
|
375
432
|
}
|
|
376
|
-
let
|
|
377
|
-
return
|
|
433
|
+
let a = t.signal;
|
|
434
|
+
return a.clear = i, a;
|
|
378
435
|
}
|
|
379
|
-
var
|
|
380
|
-
if (
|
|
381
|
-
if (typeof
|
|
382
|
-
let
|
|
383
|
-
return
|
|
436
|
+
var ve = Z.getPrototypeOf, Ee = (n) => {
|
|
437
|
+
if (n !== W && typeof n === L) {
|
|
438
|
+
if (typeof ve === Le) {
|
|
439
|
+
let e = ve(n);
|
|
440
|
+
return e === re || e === W;
|
|
384
441
|
}
|
|
385
|
-
return
|
|
442
|
+
return re.toString.call(n) === `[${L} Object]`;
|
|
386
443
|
}
|
|
387
444
|
return !1;
|
|
388
|
-
},
|
|
389
|
-
if (
|
|
390
|
-
return
|
|
391
|
-
["__proto__", "constructor",
|
|
392
|
-
}),
|
|
445
|
+
}, ue = (...n) => n.reduce((e, t) => {
|
|
446
|
+
if (x(t)) throw new TypeError(`Arguments must be ${L}s, not arrays.`);
|
|
447
|
+
return Q(t).forEach((r) => {
|
|
448
|
+
["__proto__", "constructor", Oe].includes(r) || (x(e[r]) && x(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : Ee(e[r]) && Ee(t[r]) ? e[r] = ue(e[r], t[r]) : e[r] = t[r]);
|
|
449
|
+
}), e;
|
|
393
450
|
}, {});
|
|
394
|
-
function
|
|
395
|
-
if (
|
|
396
|
-
let s = [], i =
|
|
397
|
-
if (
|
|
398
|
-
if (
|
|
399
|
-
if (
|
|
400
|
-
if (
|
|
451
|
+
function de(n, e = !0, t = W, r) {
|
|
452
|
+
if (n === S || n === W) return "";
|
|
453
|
+
let s = [], i = e ? encodeURIComponent : (g) => g, a = x(n), { arrayFormat: o, allowDots: l, serializeDate: d } = r || {}, h = (g) => {
|
|
454
|
+
if (l && !a) return `.${g}`;
|
|
455
|
+
if (a) {
|
|
456
|
+
if (o === "brackets") return "[]";
|
|
457
|
+
if (o === "repeat") return "";
|
|
401
458
|
}
|
|
402
459
|
return `[${g}]`;
|
|
403
460
|
};
|
|
404
|
-
for (let g in
|
|
405
|
-
let u =
|
|
406
|
-
if (u !==
|
|
407
|
-
let
|
|
408
|
-
if (!isNaN(u) && u instanceof Date && (u = d ? d(u) : u.toISOString()), typeof u ===
|
|
409
|
-
let f =
|
|
461
|
+
for (let g in n) if (re.hasOwnProperty.call(n, g)) {
|
|
462
|
+
let u = n[g];
|
|
463
|
+
if (u !== S) {
|
|
464
|
+
let p = t ? `${t}${h(g)}` : i(g);
|
|
465
|
+
if (!isNaN(u) && u instanceof Date && (u = d ? d(u) : u.toISOString()), typeof u === L) {
|
|
466
|
+
let f = de(u, e, p, r);
|
|
410
467
|
f !== "" && s.push(f);
|
|
411
|
-
} else s.push(`${i(
|
|
468
|
+
} else s.push(`${i(p)}=${i(u)}`);
|
|
412
469
|
}
|
|
413
470
|
}
|
|
414
471
|
return s.join("&");
|
|
415
472
|
}
|
|
416
|
-
function
|
|
417
|
-
return
|
|
418
|
-
let
|
|
419
|
-
|
|
420
|
-
}),
|
|
473
|
+
function ie(n) {
|
|
474
|
+
return x(n) ? n.map(ie) : (n && typeof n === L && Q(n).forEach((e) => {
|
|
475
|
+
let t = n[e];
|
|
476
|
+
t === S ? delete n[e] : ie(t);
|
|
477
|
+
}), n);
|
|
421
478
|
}
|
|
422
|
-
function
|
|
423
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(
|
|
479
|
+
function bt(n) {
|
|
480
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(n);
|
|
424
481
|
}
|
|
425
|
-
function
|
|
426
|
-
return
|
|
482
|
+
function vt(n, e) {
|
|
483
|
+
return n ? e ? (n.endsWith("/") ? n : n + "/") + (e[0] === "/" ? e.slice(1) : e) : n : e || "";
|
|
427
484
|
}
|
|
428
|
-
var
|
|
429
|
-
constructor(
|
|
430
|
-
super(
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
|
-
constructor(
|
|
434
|
-
super(
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
for (var
|
|
438
|
-
if (
|
|
439
|
-
return
|
|
440
|
-
},
|
|
441
|
-
var
|
|
442
|
-
for (var
|
|
443
|
-
if (
|
|
444
|
-
return
|
|
445
|
-
},
|
|
446
|
-
var i = (
|
|
485
|
+
var Et = "XiorError", It = "XiorTimeoutError", xe = class extends Error {
|
|
486
|
+
constructor(n, e, t) {
|
|
487
|
+
super(n), this.name = Et, this.request = e, this.config = e, this.response = t;
|
|
488
|
+
}
|
|
489
|
+
}, wt = class extends xe {
|
|
490
|
+
constructor(e, t, r) {
|
|
491
|
+
super(e, t, r), this.name = It;
|
|
492
|
+
}
|
|
493
|
+
}, _t = Object.defineProperty, kt = Object.defineProperties, Pt = Object.getOwnPropertyDescriptors, X = Object.getOwnPropertySymbols, De = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable, Ie = (n, e, t) => e in n ? _t(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, D = (n, e) => {
|
|
494
|
+
for (var t in e || (e = {})) De.call(e, t) && Ie(n, t, e[t]);
|
|
495
|
+
if (X) for (var t of X(e)) $e.call(e, t) && Ie(n, t, e[t]);
|
|
496
|
+
return n;
|
|
497
|
+
}, z = (n, e) => kt(n, Pt(e)), Ct = (n, e) => {
|
|
498
|
+
var t = {};
|
|
499
|
+
for (var r in n) De.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
|
500
|
+
if (n != null && X) for (var r of X(n)) e.indexOf(r) < 0 && $e.call(n, r) && (t[r] = n[r]);
|
|
501
|
+
return t;
|
|
502
|
+
}, $ = (n, e, t) => new Promise((r, s) => {
|
|
503
|
+
var i = (l) => {
|
|
447
504
|
try {
|
|
448
|
-
|
|
505
|
+
o(t.next(l));
|
|
449
506
|
} catch (d) {
|
|
450
507
|
s(d);
|
|
451
508
|
}
|
|
452
|
-
},
|
|
509
|
+
}, a = (l) => {
|
|
453
510
|
try {
|
|
454
|
-
|
|
511
|
+
o(t.throw(l));
|
|
455
512
|
} catch (d) {
|
|
456
513
|
s(d);
|
|
457
514
|
}
|
|
458
|
-
},
|
|
459
|
-
|
|
460
|
-
}),
|
|
461
|
-
function
|
|
462
|
-
return [
|
|
515
|
+
}, o = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(i, a);
|
|
516
|
+
o((t = t.apply(n, e)).next());
|
|
517
|
+
}), he = "application/", Te = `${he}x-www-form-urlencoded`, Be = RegExp, Kt = new Be(`^${Te}`, "i"), St = `${he}${ce}`, Mt = new Be(`^${he}.*${ce}.*`, "i");
|
|
518
|
+
function At(n = se) {
|
|
519
|
+
return [Re, se, Fe].includes(n);
|
|
463
520
|
}
|
|
464
|
-
var
|
|
465
|
-
function
|
|
466
|
-
return
|
|
467
|
-
let
|
|
468
|
-
if (
|
|
469
|
-
let u = "",
|
|
470
|
-
if (
|
|
471
|
-
let f =
|
|
472
|
-
f && (
|
|
521
|
+
var Lt = typeof URLSearchParams != `${S}`;
|
|
522
|
+
function Ot(n) {
|
|
523
|
+
return $(this, null, function* () {
|
|
524
|
+
let e = n[ne] || de, t = n.encodeURI !== !1, r = n[be] && n[be].toUpperCase(), s = n.url, i = s, a = Lt && n.data instanceof URLSearchParams, o = a ? Z.fromEntries(n.data.entries()) : n.data, l = o, d = n != null && n[w] ? D({}, n[w]) : {}, h = n.params, g = At(r);
|
|
525
|
+
if (o && typeof o.append !== Le) {
|
|
526
|
+
let u = "", p = "content-type";
|
|
527
|
+
if (n != null && n[w]) {
|
|
528
|
+
let f = Q(n[w]).find((I) => I.toLowerCase() === p);
|
|
529
|
+
f && (p = f, u = n[w][f]);
|
|
473
530
|
}
|
|
474
|
-
(!u ||
|
|
531
|
+
(!u || a) && (u = g || a ? Te : St, d[p] = u), typeof o === L && (g && h && (h = ue(o, h)), Mt.test(u) ? l = JSON.stringify(ie(o)) : !g && Kt.test(u) && (l = e(o)));
|
|
475
532
|
}
|
|
476
|
-
if (h &&
|
|
477
|
-
let u =
|
|
533
|
+
if (h && Q(h).length > 0) {
|
|
534
|
+
let u = e(h, t);
|
|
478
535
|
s += s.includes("?") ? `&${u}` : `?${u}`;
|
|
479
536
|
}
|
|
480
|
-
return
|
|
537
|
+
return z(D({}, n), { _data: l, _url: s, data: o, url: i, method: r, [w]: d, isGet: g });
|
|
481
538
|
});
|
|
482
539
|
}
|
|
483
|
-
var
|
|
484
|
-
function
|
|
485
|
-
return
|
|
486
|
-
let
|
|
487
|
-
if (!
|
|
488
|
-
if (
|
|
489
|
-
|
|
540
|
+
var Rt = typeof AbortController != `${S}`;
|
|
541
|
+
function Ft(n, e) {
|
|
542
|
+
return $(this, null, function* () {
|
|
543
|
+
let t;
|
|
544
|
+
if (!e || !n.ok || [ee, ce].includes(e)) {
|
|
545
|
+
if (t = yield n[ee](), t && e !== ee) try {
|
|
546
|
+
t = JSON.parse(t);
|
|
490
547
|
} catch {
|
|
491
548
|
}
|
|
492
549
|
} else {
|
|
493
|
-
if (
|
|
494
|
-
if (
|
|
550
|
+
if (e === "blob") return n.blob();
|
|
551
|
+
if (e === "arraybuffer") return n.arrayBuffer();
|
|
495
552
|
}
|
|
496
|
-
return
|
|
553
|
+
return t;
|
|
497
554
|
});
|
|
498
555
|
}
|
|
499
|
-
var
|
|
500
|
-
constructor(
|
|
501
|
-
this.REQI = [], this.RESI = [], this.P = [], this.config =
|
|
556
|
+
var xt = (n) => new A(n), A = class {
|
|
557
|
+
constructor(e) {
|
|
558
|
+
this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [w]: {} };
|
|
502
559
|
}
|
|
503
560
|
get interceptors() {
|
|
504
|
-
return { request: { use: (
|
|
505
|
-
this.REQI = this.REQI.filter((
|
|
561
|
+
return { request: { use: (e, t, r) => (this.REQI.push(e), e), eject: (e) => {
|
|
562
|
+
this.REQI = this.REQI.filter((t) => t !== e);
|
|
506
563
|
}, clear: () => {
|
|
507
564
|
this.REQI = [];
|
|
508
|
-
} }, response: { use: (
|
|
509
|
-
this.RESI = this.RESI.filter((
|
|
565
|
+
} }, response: { use: (e, t) => (this.RESI.push({ fn: e, onRejected: t }), e), eject: (e) => {
|
|
566
|
+
this.RESI = this.RESI.filter((t) => t.fn !== e);
|
|
510
567
|
}, clear: () => {
|
|
511
568
|
this.RESI = [];
|
|
512
569
|
} } };
|
|
513
570
|
}
|
|
514
571
|
get plugins() {
|
|
515
|
-
return { use: (
|
|
516
|
-
this.P = this.P.filter((
|
|
572
|
+
return { use: (e) => (this.P.push(e), e), eject: (e) => {
|
|
573
|
+
this.P = this.P.filter((t) => t !== e);
|
|
517
574
|
}, clear: () => {
|
|
518
575
|
this.P = [];
|
|
519
576
|
} };
|
|
520
577
|
}
|
|
521
|
-
request(
|
|
522
|
-
return
|
|
523
|
-
let
|
|
524
|
-
|
|
525
|
-
for (let
|
|
578
|
+
request(e) {
|
|
579
|
+
return $(this, null, function* () {
|
|
580
|
+
let t = ue(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
|
|
581
|
+
t.withCredentials && !t[r] && (t[r] = "include"), t[ne] || (t[ne] = de);
|
|
582
|
+
for (let a of this.REQI) t = yield a(t);
|
|
526
583
|
let s = this._.bind(this);
|
|
527
|
-
this.P.forEach((
|
|
528
|
-
s =
|
|
584
|
+
this.P.forEach((a) => {
|
|
585
|
+
s = a(s, this);
|
|
529
586
|
});
|
|
530
|
-
let i = s(
|
|
531
|
-
if (!
|
|
532
|
-
let
|
|
533
|
-
for (this.RESI.forEach(function(
|
|
534
|
-
|
|
535
|
-
});
|
|
587
|
+
let i = s(t);
|
|
588
|
+
if (!t._did) {
|
|
589
|
+
let a = 0, o = [];
|
|
590
|
+
for (this.RESI.forEach(function(l) {
|
|
591
|
+
o.push(l.fn, l.onRejected);
|
|
592
|
+
}); o.length > a; ) i = i.then(o[a++], o[a++]);
|
|
536
593
|
}
|
|
537
594
|
return i;
|
|
538
595
|
});
|
|
539
596
|
}
|
|
540
|
-
_(
|
|
541
|
-
return
|
|
542
|
-
let
|
|
543
|
-
|
|
544
|
-
let f,
|
|
545
|
-
if (
|
|
546
|
-
let
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
},
|
|
597
|
+
_(e) {
|
|
598
|
+
return $(this, null, function* () {
|
|
599
|
+
let t = yield Ot(e), { url: r, method: s, headers: i, timeout: a, signal: o, data: l, _data: d, _url: h, isGet: g, fetch: u } = t, p = Ct(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
|
|
600
|
+
e._url = h;
|
|
601
|
+
let f, I = [], j = S;
|
|
602
|
+
if (a && Rt) {
|
|
603
|
+
let b = new AbortController();
|
|
604
|
+
j = setTimeout(() => {
|
|
605
|
+
b.abort(new wt(`timeout of ${a}ms exceeded`, e));
|
|
606
|
+
}, a), I.push(b.signal);
|
|
550
607
|
}
|
|
551
|
-
|
|
552
|
-
clearTimeout(
|
|
608
|
+
o && I.push(o), f = I[0], I.length > 1 && (f = mt(I, () => {
|
|
609
|
+
clearTimeout(j);
|
|
553
610
|
}));
|
|
554
|
-
let
|
|
555
|
-
return
|
|
556
|
-
let { responseType:
|
|
557
|
-
if (!
|
|
558
|
-
let
|
|
559
|
-
return Promise.reject(
|
|
611
|
+
let N = h || r, fe = "baseURL";
|
|
612
|
+
return e[fe] && !bt(N) && (N = vt(e[fe], N)), (u || fetch)(N, z(D({ body: g ? S : d }, p), { signal: f, method: s, headers: i })).then((b) => $(this, null, function* () {
|
|
613
|
+
let { responseType: Ve } = e, pe = { data: yield Ft(b, Ve), response: b, config: e, request: e, [V]: b[V], statusText: b.statusText, [w]: b[w] };
|
|
614
|
+
if (!b.ok) {
|
|
615
|
+
let He = new xe(b[V] ? `Request failed with status code ${b[V]}` : "Network error", e, pe);
|
|
616
|
+
return Promise.reject(He);
|
|
560
617
|
}
|
|
561
|
-
return
|
|
618
|
+
return pe;
|
|
562
619
|
})).finally(() => {
|
|
563
|
-
var
|
|
564
|
-
|
|
620
|
+
var b;
|
|
621
|
+
j && clearTimeout(j), (b = f == null ? void 0 : f.clear) == null || b.call(f);
|
|
565
622
|
});
|
|
566
623
|
});
|
|
567
624
|
}
|
|
568
|
-
cG(
|
|
569
|
-
return (
|
|
625
|
+
cG(e) {
|
|
626
|
+
return (t, r) => this.request(r ? z(D({}, r), { method: e, url: t }) : { method: e, url: t });
|
|
570
627
|
}
|
|
571
|
-
cP(
|
|
572
|
-
return (
|
|
628
|
+
cP(e) {
|
|
629
|
+
return (t, r, s) => this.request(s ? z(D({}, s), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
|
|
573
630
|
}
|
|
574
|
-
get(
|
|
575
|
-
return this.cG(
|
|
631
|
+
get(e, t) {
|
|
632
|
+
return this.cG(se)(e, t);
|
|
576
633
|
}
|
|
577
|
-
head(
|
|
578
|
-
return this.cG(
|
|
634
|
+
head(e, t) {
|
|
635
|
+
return this.cG(Re)(e, t);
|
|
579
636
|
}
|
|
580
|
-
post(
|
|
581
|
-
return this.cP(
|
|
637
|
+
post(e, t, r) {
|
|
638
|
+
return this.cP(gt)(e, t, r);
|
|
582
639
|
}
|
|
583
|
-
put(
|
|
584
|
-
return this.cP(
|
|
640
|
+
put(e, t, r) {
|
|
641
|
+
return this.cP(ft)(e, t, r);
|
|
585
642
|
}
|
|
586
|
-
patch(
|
|
587
|
-
return this.cP(
|
|
643
|
+
patch(e, t, r) {
|
|
644
|
+
return this.cP(pt)(e, t, r);
|
|
588
645
|
}
|
|
589
|
-
delete(
|
|
590
|
-
return this.cG(
|
|
646
|
+
delete(e, t) {
|
|
647
|
+
return this.cG(yt)(e, t);
|
|
591
648
|
}
|
|
592
|
-
options(
|
|
593
|
-
return this.cG(
|
|
649
|
+
options(e, t) {
|
|
650
|
+
return this.cG(Fe)(e, t);
|
|
594
651
|
}
|
|
595
652
|
};
|
|
596
|
-
|
|
597
|
-
var
|
|
598
|
-
const
|
|
653
|
+
A.create = xt, A.VERSION = "0.7.7";
|
|
654
|
+
var Dt = Object.assign(A.create(), { create: A.create, VERSION: A.VERSION }), Ge = Dt;
|
|
655
|
+
const je = Ge.create({
|
|
599
656
|
baseURL: "https://updater.stats.cc",
|
|
600
657
|
headers: {
|
|
601
658
|
Accept: "application/json",
|
|
602
659
|
"Accept-Encoding": "gzip, deflate, br"
|
|
603
660
|
}
|
|
604
|
-
}),
|
|
661
|
+
}), ge = Ge.create({
|
|
605
662
|
baseURL: "https://api.stats.cc",
|
|
606
663
|
headers: {
|
|
607
664
|
Accept: "application/json",
|
|
608
665
|
"Accept-Encoding": "gzip, deflate, br"
|
|
609
666
|
}
|
|
610
667
|
});
|
|
611
|
-
function
|
|
612
|
-
return
|
|
613
|
-
params: { channel:
|
|
668
|
+
function $t(n, e) {
|
|
669
|
+
return je.get(`/v1/native/${n}/version.txt`, {
|
|
670
|
+
params: { channel: e },
|
|
614
671
|
responseType: "text"
|
|
615
672
|
});
|
|
616
673
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
619
|
-
params: { channel:
|
|
674
|
+
function Tt(n, e) {
|
|
675
|
+
return je.get(`/v1/native/${n}/files`, {
|
|
676
|
+
params: { channel: e },
|
|
620
677
|
responseType: "arraybuffer"
|
|
621
678
|
});
|
|
622
679
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
680
|
+
function Bt() {
|
|
681
|
+
return ge.get("/v1/raven/config");
|
|
625
682
|
}
|
|
626
|
-
function
|
|
627
|
-
return
|
|
683
|
+
function Gt(n, e) {
|
|
684
|
+
return ge.get(`/v1/raven/games/${n}/builds/${e}/check`);
|
|
628
685
|
}
|
|
629
|
-
function
|
|
630
|
-
const
|
|
631
|
-
return
|
|
686
|
+
function jt(n, e) {
|
|
687
|
+
const t = new FormData();
|
|
688
|
+
return t.append("file", e), ge.post(`/v1/raven/games/${n}/builds/upload`, t, {});
|
|
632
689
|
}
|
|
633
|
-
function
|
|
634
|
-
return
|
|
690
|
+
function Nt(n) {
|
|
691
|
+
return n instanceof Error && (n.name === "XiorError" || n.name === "XiorTimeoutError");
|
|
635
692
|
}
|
|
636
|
-
function
|
|
637
|
-
return !!(
|
|
693
|
+
function Vt(n) {
|
|
694
|
+
return !!(n && "kind" in n.data && "message" in n.data);
|
|
638
695
|
}
|
|
639
|
-
const
|
|
696
|
+
const Ht = {
|
|
640
697
|
buildChannel: "alpha"
|
|
641
698
|
};
|
|
642
|
-
class
|
|
699
|
+
class Ut extends G {
|
|
643
700
|
constructor() {
|
|
644
701
|
super("NativeDllManager");
|
|
645
|
-
|
|
702
|
+
c(this, "UPDATE_CHECK_INTERVAL_MS", 1e3 * 60 * 5);
|
|
646
703
|
// 5 minutes
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
this.targetDir =
|
|
704
|
+
c(this, "targetDir");
|
|
705
|
+
c(this, "updateInterval");
|
|
706
|
+
this.targetDir = m.join(Y(), "resources"), this.logger.log("Target directory", this.targetDir);
|
|
650
707
|
}
|
|
651
|
-
async initWithDlls(
|
|
652
|
-
super.init(), await
|
|
708
|
+
async initWithDlls(t) {
|
|
709
|
+
super.init(), await v.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
|
|
653
710
|
}
|
|
654
711
|
destroy() {
|
|
655
712
|
this.updateInterval && (clearInterval(this.updateInterval), this.updateInterval = void 0), super.destroy();
|
|
656
713
|
}
|
|
657
|
-
async getCurrentVersion(
|
|
714
|
+
async getCurrentVersion(t) {
|
|
658
715
|
try {
|
|
659
|
-
const
|
|
660
|
-
return await
|
|
716
|
+
const r = m.join(this.targetDir, t, "version.txt");
|
|
717
|
+
return await v.readFile(r, "utf-8");
|
|
661
718
|
} catch {
|
|
662
719
|
return null;
|
|
663
720
|
}
|
|
664
721
|
}
|
|
665
|
-
getTargetPath(
|
|
666
|
-
return
|
|
722
|
+
getTargetPath(t) {
|
|
723
|
+
return m.join(this.targetDir, t);
|
|
667
724
|
}
|
|
668
|
-
getTargetVersionPath(
|
|
669
|
-
return
|
|
725
|
+
getTargetVersionPath(t, r) {
|
|
726
|
+
return m.join(this.getTargetPath(t), r);
|
|
670
727
|
}
|
|
671
|
-
async checkForUpdates(
|
|
672
|
-
const
|
|
728
|
+
async checkForUpdates(t) {
|
|
729
|
+
const r = Ht.buildChannel;
|
|
673
730
|
this.logger.log("Checking for updates");
|
|
674
|
-
for (const s of
|
|
731
|
+
for (const s of t)
|
|
675
732
|
try {
|
|
676
|
-
const { data: i } = await
|
|
677
|
-
this.logger.log(`${s} > Update Check. current: ${
|
|
733
|
+
const { data: i } = await $t(s, r), a = await this.getCurrentVersion(s);
|
|
734
|
+
this.logger.log(`${s} > Update Check. current: ${a}, latest: ${i}`);
|
|
735
|
+
const o = i !== a;
|
|
736
|
+
this.logger.log(`${s} > Update found: ${a} -> ${i}`), await this.downloadAndExtractDll(s, i, r, o), this.logger.log(`${s} > Downloaded and extracted`), o && (this.logger.log(`${s} > Cleaning up versions older than ${i}`), await this.cleanupOldVersions(s, i)), this.emit("dllUpdated", { identifier: s, version: i });
|
|
678
737
|
} catch (i) {
|
|
679
738
|
this.logger.captureSentryException(`${s} > Error checking/updating`, i);
|
|
680
739
|
}
|
|
681
740
|
}
|
|
682
|
-
async downloadAndExtractDll(
|
|
683
|
-
const { data:
|
|
684
|
-
await
|
|
685
|
-
const
|
|
686
|
-
await
|
|
687
|
-
const
|
|
688
|
-
const
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
|
|
741
|
+
async downloadAndExtractDll(t, r, s, i) {
|
|
742
|
+
const { data: a } = await Tt(t, s), o = this.getTargetPath(t), l = this.getTargetVersionPath(t, r);
|
|
743
|
+
await v.mkdir(l, { recursive: !0 });
|
|
744
|
+
const d = new ke();
|
|
745
|
+
await d.loadAsync(a);
|
|
746
|
+
const h = Object.keys(d.files).map(async (u) => {
|
|
747
|
+
const p = d.files[u];
|
|
748
|
+
if (p && !p.dir) {
|
|
749
|
+
const f = m.join(l, u);
|
|
750
|
+
if (!i)
|
|
751
|
+
try {
|
|
752
|
+
await v.access(f, v.constants.F_OK);
|
|
753
|
+
return;
|
|
754
|
+
} catch {
|
|
755
|
+
this.logger.warn(`${t} > File missing, re-downloading: ${f}`);
|
|
756
|
+
}
|
|
757
|
+
const I = await p.async("nodebuffer");
|
|
758
|
+
await v.writeFile(f, I);
|
|
692
759
|
}
|
|
693
760
|
});
|
|
694
|
-
await Promise.all(
|
|
695
|
-
const
|
|
696
|
-
this.logger.log("Saving version file",
|
|
761
|
+
await Promise.all(h);
|
|
762
|
+
const g = m.join(o, "version.txt");
|
|
763
|
+
this.logger.log("Saving version file", g), await v.writeFile(g, r);
|
|
697
764
|
}
|
|
698
|
-
async cleanupOldVersions(
|
|
699
|
-
const s =
|
|
700
|
-
for (const
|
|
701
|
-
|
|
765
|
+
async cleanupOldVersions(t, r) {
|
|
766
|
+
const s = m.join(this.targetDir, t), i = await v.readdir(s, { withFileTypes: !0 });
|
|
767
|
+
for (const a of i)
|
|
768
|
+
a.isDirectory() && a.name !== r && await v.rm(m.join(s, a.name), { recursive: !0, force: !0 });
|
|
702
769
|
}
|
|
703
770
|
}
|
|
704
|
-
const
|
|
705
|
-
class
|
|
771
|
+
const J = _(Ut);
|
|
772
|
+
class zt extends G {
|
|
706
773
|
constructor() {
|
|
707
774
|
super("RavenManager");
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
775
|
+
c(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
|
|
776
|
+
c(this, "FAILED_REFETCH_INTERVAL", 1e3 * 30);
|
|
777
|
+
c(this, "_ravenConfig");
|
|
778
|
+
c(this, "_executableToGameMap", /* @__PURE__ */ new Map());
|
|
779
|
+
c(this, "_executablesArray", []);
|
|
780
|
+
c(this, "_refetchIntervalHandler", null);
|
|
781
|
+
c(this, "_failedRefetchTimeoutHandler", null);
|
|
715
782
|
}
|
|
716
783
|
init() {
|
|
717
784
|
super.init(), this.fetchRavenConfig(), this._refetchIntervalHandler = setInterval(() => {
|
|
718
785
|
this._failedRefetchTimeoutHandler && (clearTimeout(this._failedRefetchTimeoutHandler), this._failedRefetchTimeoutHandler = null), this.fetchRavenConfig();
|
|
719
786
|
}, this.REFETCH_INTERVAL);
|
|
720
787
|
}
|
|
721
|
-
getExecutableData(
|
|
722
|
-
return this._executableToGameMap.get(
|
|
788
|
+
getExecutableData(t) {
|
|
789
|
+
return this._executableToGameMap.get(t.toLowerCase()) ?? null;
|
|
723
790
|
}
|
|
724
791
|
get executables() {
|
|
725
792
|
return this._executablesArray;
|
|
@@ -728,85 +795,94 @@ class Nt extends C {
|
|
|
728
795
|
return this._executableToGameMap;
|
|
729
796
|
}
|
|
730
797
|
destroy() {
|
|
731
|
-
this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler),
|
|
798
|
+
this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), J.getInstance().destroy(), super.destroy();
|
|
732
799
|
}
|
|
733
800
|
async fetchRavenConfig() {
|
|
734
801
|
try {
|
|
735
|
-
const
|
|
736
|
-
this._ravenConfig =
|
|
737
|
-
const
|
|
802
|
+
const t = await Bt();
|
|
803
|
+
this._ravenConfig = t.data, this.resetState();
|
|
804
|
+
const r = /* @__PURE__ */ new Set();
|
|
738
805
|
for (const s of this._ravenConfig.games) {
|
|
739
806
|
for (const i of s.executables) {
|
|
740
|
-
const
|
|
741
|
-
this._executableToGameMap.set(
|
|
807
|
+
const a = i.toLowerCase();
|
|
808
|
+
this._executableToGameMap.set(a, s), this._executablesArray.push(a);
|
|
742
809
|
}
|
|
743
|
-
s.dlls_to_inject.forEach((i) =>
|
|
810
|
+
s.dlls_to_inject.forEach((i) => r.add(i));
|
|
744
811
|
}
|
|
745
|
-
await
|
|
746
|
-
} catch (
|
|
747
|
-
this.logger.captureSentryException("Failed to fetch Raven config",
|
|
812
|
+
await J.getInstance().initWithDlls(Array.from(r)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
|
|
813
|
+
} catch (t) {
|
|
814
|
+
this.logger.captureSentryException("Failed to fetch Raven config", t), this._failedRefetchTimeoutHandler = setTimeout(() => this.fetchRavenConfig(), this.FAILED_REFETCH_INTERVAL);
|
|
748
815
|
}
|
|
749
816
|
}
|
|
750
817
|
resetState() {
|
|
751
818
|
this._executableToGameMap.clear(), this._executablesArray = [];
|
|
752
819
|
}
|
|
753
820
|
}
|
|
754
|
-
const
|
|
755
|
-
|
|
821
|
+
const T = _(zt), qt = oe(import.meta.url), {
|
|
822
|
+
PipeEventServer: Hn,
|
|
823
|
+
PipeEventClient: Un,
|
|
824
|
+
PipeEventBase: zn,
|
|
825
|
+
ProcessMonitor: Wt,
|
|
826
|
+
Process: H,
|
|
827
|
+
InjectionMethod: qn,
|
|
828
|
+
AccessLevel: Wn,
|
|
829
|
+
HardwareInterface: Qt
|
|
830
|
+
} = qt("./build/overlayed_native_interface_x64.node");
|
|
831
|
+
class Xt extends G {
|
|
756
832
|
constructor() {
|
|
757
833
|
super("ProcessManager");
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
this._processMonitor = new
|
|
834
|
+
c(this, "_processMonitor");
|
|
835
|
+
c(this, "_processes", /* @__PURE__ */ new Map());
|
|
836
|
+
c(this, "boundOnRavenManagerExecutablesUpdated", this.onRavenManagerExecutablesUpdated.bind(this));
|
|
837
|
+
this._processMonitor = new Wt();
|
|
762
838
|
}
|
|
763
839
|
get hasAnyActiveProcesses() {
|
|
764
840
|
return this.activeProcesses.length > 0;
|
|
765
841
|
}
|
|
766
842
|
get activeProcesses() {
|
|
767
|
-
return Array.from(this._processes.values()).flat().filter((
|
|
843
|
+
return Array.from(this._processes.values()).flat().filter((t) => !t.destroyedAt);
|
|
768
844
|
}
|
|
769
845
|
init() {
|
|
770
|
-
super.init(),
|
|
771
|
-
this.logger.log("Process created",
|
|
772
|
-
}), this._processMonitor.on("destroy", (
|
|
773
|
-
this.logger.log("Process destroyed",
|
|
846
|
+
super.init(), T.getInstance().on("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processMonitor.on("create", (t) => {
|
|
847
|
+
this.logger.log("Process created", t), this.addProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("create", { process: t });
|
|
848
|
+
}), this._processMonitor.on("destroy", (t) => {
|
|
849
|
+
this.logger.log("Process destroyed", t), this.deleteProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("destroy", { process: t });
|
|
774
850
|
});
|
|
775
851
|
}
|
|
776
852
|
destroy() {
|
|
777
|
-
|
|
853
|
+
T.getInstance().off("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processes.clear(), this._processMonitor.removeAllListeners(), super.destroy();
|
|
778
854
|
}
|
|
779
|
-
isProcessRunning(
|
|
780
|
-
const
|
|
781
|
-
return (
|
|
855
|
+
isProcessRunning(t) {
|
|
856
|
+
const r = this._processes.get(t);
|
|
857
|
+
return (r == null ? void 0 : r.some((s) => !s.destroyedAt)) ?? !1;
|
|
782
858
|
}
|
|
783
|
-
onRavenManagerExecutablesUpdated(
|
|
784
|
-
|
|
785
|
-
this.logger.log("Monitoring process",
|
|
859
|
+
onRavenManagerExecutablesUpdated(t) {
|
|
860
|
+
t.executables.forEach((r) => {
|
|
861
|
+
this.logger.log("Monitoring process", r), this._processMonitor.registerProcess(r);
|
|
786
862
|
});
|
|
787
863
|
}
|
|
788
|
-
addProcess(
|
|
789
|
-
if (!
|
|
864
|
+
addProcess(t) {
|
|
865
|
+
if (!t.name)
|
|
790
866
|
return;
|
|
791
|
-
const
|
|
792
|
-
if (!
|
|
793
|
-
this._processes.set(
|
|
867
|
+
const r = this._processes.get(t.name);
|
|
868
|
+
if (!r) {
|
|
869
|
+
this._processes.set(t.name, [t]);
|
|
794
870
|
return;
|
|
795
871
|
}
|
|
796
|
-
this._processes.set(
|
|
872
|
+
this._processes.set(t.name, r.concat(t));
|
|
797
873
|
}
|
|
798
|
-
deleteProcess(
|
|
799
|
-
if (!
|
|
874
|
+
deleteProcess(t) {
|
|
875
|
+
if (!t.name)
|
|
800
876
|
return;
|
|
801
|
-
const
|
|
802
|
-
s.length === 0 ? this._processes.delete(
|
|
877
|
+
const r = this._processes.get(t.name), s = (r == null ? void 0 : r.filter((i) => i.id !== t.id)) ?? [];
|
|
878
|
+
s.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, s);
|
|
803
879
|
}
|
|
804
880
|
}
|
|
805
|
-
const
|
|
806
|
-
var
|
|
807
|
-
class
|
|
808
|
-
constructor(
|
|
809
|
-
|
|
881
|
+
const C = _(Xt), Jt = oe(import.meta.url), { RenderInterface: Yt, renderHookPath: Qn } = Jt("./build/overlayed_render_interface_x64.node");
|
|
882
|
+
var Zt = Object.defineProperty, en = (n, e, t) => e in n ? Zt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, q = (n, e, t) => en(n, typeof e != "symbol" ? e + "" : e, t);
|
|
883
|
+
class tn {
|
|
884
|
+
constructor(e) {
|
|
885
|
+
q(this, "_instance"), q(this, "_resolution"), q(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
|
|
810
886
|
}
|
|
811
887
|
destroy() {
|
|
812
888
|
this._instance.off("resolution", this.boundOnResolutionChanged);
|
|
@@ -817,140 +893,196 @@ class Gt {
|
|
|
817
893
|
get resolution() {
|
|
818
894
|
return this._resolution;
|
|
819
895
|
}
|
|
820
|
-
onResolutionChanged(
|
|
821
|
-
this._resolution = { width:
|
|
896
|
+
onResolutionChanged(e, t) {
|
|
897
|
+
this._resolution = { width: e, height: t };
|
|
822
898
|
}
|
|
823
899
|
}
|
|
824
|
-
class
|
|
900
|
+
let nn = class {
|
|
901
|
+
constructor() {
|
|
902
|
+
q(this, "interfaces", {});
|
|
903
|
+
}
|
|
904
|
+
createInterface(e) {
|
|
905
|
+
return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new tn(new Yt(e, { access: 1 })), this.interfaces[e]);
|
|
906
|
+
}
|
|
907
|
+
getInterface(e) {
|
|
908
|
+
return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
const O = _(nn);
|
|
912
|
+
var rn = Object.defineProperty, sn = (n, e, t) => e in n ? rn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, R = (n, e, t) => sn(n, typeof e != "symbol" ? e + "" : e, t);
|
|
913
|
+
class an {
|
|
825
914
|
constructor() {
|
|
826
|
-
|
|
915
|
+
R(this, "data", []);
|
|
916
|
+
}
|
|
917
|
+
get size() {
|
|
918
|
+
return this.data.length;
|
|
919
|
+
}
|
|
920
|
+
add(e) {
|
|
921
|
+
this.data.push(e);
|
|
827
922
|
}
|
|
828
|
-
|
|
829
|
-
return this.
|
|
923
|
+
next() {
|
|
924
|
+
return this.data.shift();
|
|
830
925
|
}
|
|
831
|
-
|
|
832
|
-
|
|
926
|
+
clear() {
|
|
927
|
+
this.data.length = 0;
|
|
928
|
+
}
|
|
929
|
+
*flush() {
|
|
930
|
+
for (; this.size > 0; ) {
|
|
931
|
+
const e = this.next();
|
|
932
|
+
e && (yield e);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
class on {
|
|
937
|
+
constructor(e) {
|
|
938
|
+
R(this, "_clientId", null), R(this, "_userId", null), R(this, "options"), R(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new an(), this.setupFlushInterval();
|
|
939
|
+
}
|
|
940
|
+
set clientId(e) {
|
|
941
|
+
this._clientId = e;
|
|
942
|
+
}
|
|
943
|
+
set userId(e) {
|
|
944
|
+
this._userId = e;
|
|
945
|
+
}
|
|
946
|
+
track(e, t) {
|
|
947
|
+
this.eventQueue.add({ name: e, data: t, createdAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
948
|
+
}
|
|
949
|
+
flush() {
|
|
950
|
+
return Array.from(this.eventQueue.flush());
|
|
951
|
+
}
|
|
952
|
+
setupFlushInterval() {
|
|
953
|
+
setInterval(() => {
|
|
954
|
+
this.flush();
|
|
955
|
+
}, this.options.batchIntervalSeconds * 1e3);
|
|
956
|
+
}
|
|
957
|
+
resolveOptions(e) {
|
|
958
|
+
return {
|
|
959
|
+
batchIntervalSeconds: (e == null ? void 0 : e.batchIntervalSeconds) ?? 15
|
|
960
|
+
};
|
|
833
961
|
}
|
|
834
962
|
}
|
|
835
|
-
const
|
|
836
|
-
class
|
|
963
|
+
const P = _(on);
|
|
964
|
+
class ln extends G {
|
|
837
965
|
constructor() {
|
|
838
966
|
super("GameLaunchManager");
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
967
|
+
c(this, "RENDER_INTERFACE_PATH", "node_modules/@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
|
|
968
|
+
c(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
|
|
969
|
+
c(this, "boundOnProcessDestroy", this.onProcessDestroy.bind(this));
|
|
842
970
|
}
|
|
843
971
|
init() {
|
|
844
|
-
super.init(),
|
|
972
|
+
super.init(), O.getInstance().createInterface("OGG_SIEGE"), C.getInstance().on("create", this.boundOnProcessCreate), C.getInstance().on("destroy", this.boundOnProcessDestroy);
|
|
845
973
|
}
|
|
846
974
|
destroy() {
|
|
847
|
-
|
|
975
|
+
C.getInstance().off("create", this.boundOnProcessCreate), C.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
|
|
848
976
|
}
|
|
849
|
-
async onProcessCreate({ process:
|
|
850
|
-
const
|
|
851
|
-
if (!
|
|
977
|
+
async onProcessCreate({ process: t }) {
|
|
978
|
+
const r = this.getRavenGame(t);
|
|
979
|
+
if (!r)
|
|
852
980
|
return;
|
|
853
|
-
if (this.logger.log("Game Launched",
|
|
854
|
-
|
|
855
|
-
appElevated:
|
|
856
|
-
gameElevated:
|
|
981
|
+
if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", H.currentProcess.isElevated), t.isElevated && !H.currentProcess.isElevated) {
|
|
982
|
+
E.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
|
|
983
|
+
appElevated: !!H.currentProcess.isElevated,
|
|
984
|
+
gameElevated: !!t.isElevated
|
|
857
985
|
}), this.logger.sentryLog("Game elevated but App is not", {
|
|
858
|
-
appElevated:
|
|
859
|
-
gameElevated:
|
|
986
|
+
appElevated: H.currentProcess.isElevated,
|
|
987
|
+
gameElevated: t.isElevated
|
|
860
988
|
});
|
|
861
989
|
return;
|
|
862
990
|
}
|
|
863
991
|
const s = this.copyDll(this.RENDER_INTERFACE_PATH);
|
|
864
992
|
if (s)
|
|
865
993
|
try {
|
|
866
|
-
await
|
|
867
|
-
} catch (
|
|
868
|
-
this.logger.captureSentryException("Render Interface Injection Failed",
|
|
994
|
+
await t.injectDll(s), this.logger.log("Render Interface Injection Successful", s);
|
|
995
|
+
} catch (a) {
|
|
996
|
+
this.logger.captureSentryException("Render Interface Injection Failed", a), this.logger.sentryError("Render Interface Injection Failed", {
|
|
869
997
|
renderInterfacePath: s
|
|
870
998
|
});
|
|
871
999
|
}
|
|
872
|
-
const i =
|
|
873
|
-
const
|
|
874
|
-
if (!
|
|
875
|
-
return this.logger.sentryError("No version found for DLL", { identifier:
|
|
876
|
-
const
|
|
877
|
-
this.logger.log("DLL Path",
|
|
878
|
-
const d = await this.getDllFiles(
|
|
1000
|
+
const i = r == null ? void 0 : r.dlls_to_inject.map(async (a) => {
|
|
1001
|
+
const o = await J.getInstance().getCurrentVersion(a);
|
|
1002
|
+
if (!o)
|
|
1003
|
+
return this.logger.sentryError("No version found for DLL", { identifier: a }), Promise.resolve();
|
|
1004
|
+
const l = J.getInstance().getTargetVersionPath(a, o);
|
|
1005
|
+
this.logger.log("DLL Path", l);
|
|
1006
|
+
const d = await this.getDllFiles(l);
|
|
879
1007
|
return this.logger.log("DLL Files", d), Promise.all(
|
|
880
1008
|
d.map(async (h) => {
|
|
881
|
-
const g =
|
|
1009
|
+
const g = m.basename(h), u = m.join(l, g);
|
|
882
1010
|
if (!u)
|
|
883
1011
|
return Promise.resolve();
|
|
884
1012
|
this.logger.log("Injecting: ", u);
|
|
885
1013
|
try {
|
|
886
|
-
return
|
|
1014
|
+
return t.injectDll(u).then(() => {
|
|
887
1015
|
this.logger.log("Injection Successful", u);
|
|
888
|
-
}).catch((
|
|
889
|
-
this.logger.sentryError("Injection Failed [1]", { targetPath: u },
|
|
1016
|
+
}).catch((p) => {
|
|
1017
|
+
this.logger.sentryError("Injection Failed [1]", { targetPath: u }, p);
|
|
890
1018
|
});
|
|
891
|
-
} catch (
|
|
892
|
-
return this.logger.sentryError("Injection Failed [2]", { targetPath: u },
|
|
1019
|
+
} catch (p) {
|
|
1020
|
+
return this.logger.sentryError("Injection Failed [2]", { targetPath: u }, p), Promise.reject(p);
|
|
893
1021
|
}
|
|
894
1022
|
})
|
|
895
1023
|
);
|
|
896
1024
|
});
|
|
897
|
-
await Promise.allSettled(i), this.emit("
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
1025
|
+
await Promise.allSettled(i), this.emit("gameLaunchInternal", { ravenGame: r, process: t }), this.emit("gameLaunch", { game: r.identifier }), P.getInstance().track("game_launch", {
|
|
1026
|
+
game: r.identifier
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
copyDll(t) {
|
|
1030
|
+
this.logger.log(ut());
|
|
1031
|
+
const r = t.split("/");
|
|
1032
|
+
if (r.length < 2)
|
|
1033
|
+
return this.logger.sentryError("Path is invalid", { dllPath: t }), !1;
|
|
1034
|
+
const s = r.at(-1);
|
|
905
1035
|
if (!s)
|
|
906
|
-
return this.logger.sentryError("Dll name is invalid", { dllPath:
|
|
907
|
-
const i =
|
|
908
|
-
this.logger.debug("Copying", i, "to",
|
|
1036
|
+
return this.logger.sentryError("Dll name is invalid", { dllPath: t }), !1;
|
|
1037
|
+
const i = Je(t), a = m.join(Y(), "resources"), o = m.join(a, s);
|
|
1038
|
+
this.logger.debug("Copying", i, "to", o);
|
|
909
1039
|
try {
|
|
910
|
-
|
|
911
|
-
const
|
|
912
|
-
|
|
913
|
-
} catch (
|
|
914
|
-
return
|
|
1040
|
+
qe(a) || We(a, { recursive: !0 });
|
|
1041
|
+
const l = _e(i);
|
|
1042
|
+
Qe(o, l), Xe(i, o);
|
|
1043
|
+
} catch (l) {
|
|
1044
|
+
return l.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", l), this.logger.sentryError("Failed to copy", { originalPath: i, targetPath: o }), !1);
|
|
915
1045
|
}
|
|
916
|
-
return
|
|
1046
|
+
return o;
|
|
917
1047
|
}
|
|
918
|
-
async getDllFiles(
|
|
1048
|
+
async getDllFiles(t) {
|
|
919
1049
|
try {
|
|
920
|
-
return (await
|
|
921
|
-
} catch (
|
|
922
|
-
return this.logger.captureSentryException("Failed to read DLL directory",
|
|
1050
|
+
return (await v.readdir(t)).filter((s) => s.endsWith(".dll")).map((s) => m.join(t, s));
|
|
1051
|
+
} catch (r) {
|
|
1052
|
+
return this.logger.captureSentryException("Failed to read DLL directory", r), this.logger.sentryError("Failed to read DLL directory", { dllPath: t }), [];
|
|
923
1053
|
}
|
|
924
1054
|
}
|
|
925
|
-
onProcessDestroy({ process:
|
|
926
|
-
const
|
|
927
|
-
|
|
1055
|
+
onProcessDestroy({ process: t }) {
|
|
1056
|
+
const r = this.getRavenGame(t);
|
|
1057
|
+
r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }), P.getInstance().track("game_close", {
|
|
1058
|
+
game: r.identifier
|
|
1059
|
+
}));
|
|
928
1060
|
}
|
|
929
|
-
getRavenGame(
|
|
930
|
-
if (!
|
|
1061
|
+
getRavenGame(t) {
|
|
1062
|
+
if (!t.name)
|
|
931
1063
|
return;
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
934
|
-
this.logger.sentryError("No raven game found for process", { process:
|
|
1064
|
+
const r = T.getInstance().getExecutableData(t.name);
|
|
1065
|
+
if (!r) {
|
|
1066
|
+
this.logger.sentryError("No raven game found for process", { process: t });
|
|
935
1067
|
return;
|
|
936
1068
|
}
|
|
937
|
-
return
|
|
1069
|
+
return r;
|
|
938
1070
|
}
|
|
939
1071
|
}
|
|
940
|
-
const
|
|
941
|
-
class
|
|
1072
|
+
const B = _(ln);
|
|
1073
|
+
class cn extends Ae {
|
|
942
1074
|
constructor() {
|
|
943
1075
|
super("GameBuildManager");
|
|
944
|
-
|
|
1076
|
+
c(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
|
|
945
1077
|
}
|
|
946
1078
|
init() {
|
|
947
|
-
super.init(),
|
|
1079
|
+
super.init(), B.getInstance().on("gameLaunchInternal", this.boundOnGameLaunch);
|
|
948
1080
|
}
|
|
949
1081
|
destroy() {
|
|
950
|
-
|
|
1082
|
+
B.getInstance().off("gameLaunchInternal", this.boundOnGameLaunch), super.destroy();
|
|
951
1083
|
}
|
|
952
|
-
async onGameLaunch(
|
|
953
|
-
const { ravenGame:
|
|
1084
|
+
async onGameLaunch(t) {
|
|
1085
|
+
const { ravenGame: r, process: s } = t;
|
|
954
1086
|
if (!s.path || !s.name) {
|
|
955
1087
|
this.logger.sentryError(
|
|
956
1088
|
"Process path or name not found, could not check for build hash",
|
|
@@ -959,30 +1091,30 @@ class Wt extends st {
|
|
|
959
1091
|
);
|
|
960
1092
|
return;
|
|
961
1093
|
}
|
|
962
|
-
const i =
|
|
963
|
-
this.logger.log("Process Path", s.path), this.logger.log("Process Name", s.name), this.logger.log("Build Hash",
|
|
964
|
-
let
|
|
1094
|
+
const i = _e(s.path), a = Ye("sha256").update(i).digest("hex");
|
|
1095
|
+
this.logger.log("Process Path", s.path), this.logger.log("Process Name", s.name), this.logger.log("Build Hash", a);
|
|
1096
|
+
let o = !1;
|
|
965
1097
|
try {
|
|
966
|
-
|
|
1098
|
+
o = (await Gt(r.identifier, a)).data.upload;
|
|
967
1099
|
} catch (h) {
|
|
968
1100
|
this.logger.captureSentryException("Error checking game build hash", h);
|
|
969
1101
|
return;
|
|
970
1102
|
}
|
|
971
|
-
if (!
|
|
1103
|
+
if (!o) {
|
|
972
1104
|
this.logger.log("Build hash already exists, skipping upload");
|
|
973
1105
|
return;
|
|
974
1106
|
}
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
const d = await
|
|
1107
|
+
const l = new ke();
|
|
1108
|
+
l.file(s.name, i);
|
|
1109
|
+
const d = await l.generateAsync({ type: "blob" });
|
|
978
1110
|
try {
|
|
979
|
-
this.logger.log("Uploading build (size: ", d.size, " bytes)"), await
|
|
1111
|
+
this.logger.log("Uploading build (size: ", d.size, " bytes)"), await jt(r.identifier, d), this.logger.log("Build uploaded successfully");
|
|
980
1112
|
} catch (h) {
|
|
981
|
-
|
|
1113
|
+
Nt(h) ? Vt(h.response) ? this.logger.captureSentryException("Error uploading build hash, api error", h) : this.logger.captureSentryException("Error uploading build hash, request error", h) : this.logger.captureSentryException("Error uploading build hash, unknown error", h);
|
|
982
1114
|
}
|
|
983
1115
|
}
|
|
984
1116
|
}
|
|
985
|
-
const
|
|
1117
|
+
const Ne = _(cn), ae = /* @__PURE__ */ new Map([
|
|
986
1118
|
[1, "LeftButton"],
|
|
987
1119
|
[2, "RightButton"],
|
|
988
1120
|
[3, "Cancel"],
|
|
@@ -1175,211 +1307,422 @@ const qt = k(Wt), te = /* @__PURE__ */ new Map([
|
|
|
1175
1307
|
[252, "Noname"],
|
|
1176
1308
|
[253, "PA1"],
|
|
1177
1309
|
[254, "OEM_Clear"]
|
|
1178
|
-
]),
|
|
1310
|
+
]), we = new Map(ae.entries().map(([n, e]) => [e, n])), un = K({
|
|
1179
1311
|
"[string]": {
|
|
1180
1312
|
keys: "string[]",
|
|
1181
|
-
mode:
|
|
1313
|
+
mode: K("'toggle' | 'hold'").pipe((n) => n ?? "toggle")
|
|
1182
1314
|
}
|
|
1183
1315
|
});
|
|
1184
|
-
class
|
|
1185
|
-
constructor(
|
|
1316
|
+
class dn extends G {
|
|
1317
|
+
constructor(t) {
|
|
1186
1318
|
super("KeybindManager");
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
this
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1319
|
+
c(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
|
|
1320
|
+
c(this, "pressedKeys", /* @__PURE__ */ new Set());
|
|
1321
|
+
c(this, "activeKeybinds", /* @__PURE__ */ new Set());
|
|
1322
|
+
c(this, "triggeredToggleKeybinds", /* @__PURE__ */ new Set());
|
|
1323
|
+
c(this, "boundHandleKeyboardFocus", this.handleKeyboardFocus.bind(this));
|
|
1324
|
+
c(this, "boundHandleKeyDown", this.handleKeyDown.bind(this));
|
|
1325
|
+
c(this, "boundHandleKeyUp", this.handleKeyUp.bind(this));
|
|
1326
|
+
c(this, "keybindsFile");
|
|
1327
|
+
// TODO try to figure out a better way to handle this
|
|
1328
|
+
c(this, "keybindListeningPaused", !1);
|
|
1329
|
+
this.keybindsFile = new ct({
|
|
1330
|
+
path: dt(["keybinds.json"]),
|
|
1331
|
+
schema: un,
|
|
1332
|
+
default: t
|
|
1200
1333
|
});
|
|
1201
1334
|
}
|
|
1202
1335
|
init() {
|
|
1203
1336
|
super.init();
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1337
|
+
const t = O.getInstance().getInterface("OGG_SIEGE");
|
|
1338
|
+
t.instance.on("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.on("keyDown", this.boundHandleKeyDown), t.instance.on("keyUp", this.boundHandleKeyUp);
|
|
1339
|
+
}
|
|
1340
|
+
// TODO support multiple callbacks
|
|
1341
|
+
async onKeybindToggled(t, r) {
|
|
1342
|
+
const s = this.preferencesKeybindToCallbacks.get(t) || {};
|
|
1343
|
+
s.toggle = r, this.preferencesKeybindToCallbacks.set(t, s);
|
|
1344
|
+
}
|
|
1345
|
+
async onKeybindDown(t, r) {
|
|
1346
|
+
const s = this.preferencesKeybindToCallbacks.get(t) || {};
|
|
1347
|
+
s.down = r, this.preferencesKeybindToCallbacks.set(t, s);
|
|
1206
1348
|
}
|
|
1207
|
-
async
|
|
1208
|
-
const s = this.preferencesKeybindToCallbacks.get(
|
|
1209
|
-
s.
|
|
1349
|
+
async onKeybindUp(t, r) {
|
|
1350
|
+
const s = this.preferencesKeybindToCallbacks.get(t) || {};
|
|
1351
|
+
s.up = r, this.preferencesKeybindToCallbacks.set(t, s);
|
|
1210
1352
|
}
|
|
1211
|
-
async
|
|
1212
|
-
|
|
1213
|
-
|
|
1353
|
+
async updateKeybind(t, r) {
|
|
1354
|
+
this.keybindsFile.set({
|
|
1355
|
+
[t]: r
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
async updateKeybinds(t) {
|
|
1359
|
+
const r = Object.fromEntries(
|
|
1360
|
+
Object.entries(t).filter(([s, i]) => i !== void 0)
|
|
1361
|
+
);
|
|
1362
|
+
this.keybindsFile.set({
|
|
1363
|
+
...this.keybindsFile.get(),
|
|
1364
|
+
...r
|
|
1365
|
+
});
|
|
1214
1366
|
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
s.up = n, this.preferencesKeybindToCallbacks.set(e, s);
|
|
1367
|
+
getConfig() {
|
|
1368
|
+
return this.keybindsFile.get();
|
|
1218
1369
|
}
|
|
1219
1370
|
destroy() {
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1371
|
+
const t = O.getInstance().getInterface("OGG_SIEGE");
|
|
1372
|
+
t.instance.off("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.off("keyDown", this.boundHandleKeyDown), t.instance.off("keyUp", this.boundHandleKeyUp), super.destroy();
|
|
1222
1373
|
}
|
|
1223
|
-
handleKeyDown(
|
|
1224
|
-
if (this.
|
|
1374
|
+
handleKeyDown(t) {
|
|
1375
|
+
if (this.keybindListeningPaused)
|
|
1225
1376
|
return;
|
|
1226
|
-
const
|
|
1227
|
-
if (!
|
|
1228
|
-
this.logger.error("Unknown key down",
|
|
1377
|
+
const r = ae.get(t.key);
|
|
1378
|
+
if (!r) {
|
|
1379
|
+
this.logger.error("Unknown key down", t);
|
|
1229
1380
|
return;
|
|
1230
1381
|
}
|
|
1231
|
-
this.pressedKeys.add(
|
|
1382
|
+
this.pressedKeys.add(r), this.checkKeybindings();
|
|
1232
1383
|
}
|
|
1233
1384
|
handleKeyboardFocus() {
|
|
1234
1385
|
this.pressedKeys.clear(), this.activeKeybinds.clear(), this.triggeredToggleKeybinds.clear();
|
|
1235
1386
|
}
|
|
1236
|
-
async handleKeyUp(
|
|
1237
|
-
if (this.
|
|
1387
|
+
async handleKeyUp(t) {
|
|
1388
|
+
if (this.keybindListeningPaused)
|
|
1238
1389
|
return;
|
|
1239
|
-
const
|
|
1240
|
-
if (!
|
|
1390
|
+
const r = ae.get(t.key);
|
|
1391
|
+
if (!r)
|
|
1241
1392
|
return;
|
|
1242
|
-
this.pressedKeys.delete(
|
|
1243
|
-
const s = this.
|
|
1393
|
+
this.pressedKeys.delete(r);
|
|
1394
|
+
const s = this.keybindsFile.get();
|
|
1244
1395
|
for (const [i] of this.preferencesKeybindToCallbacks.entries())
|
|
1245
|
-
s[i].keys.includes(
|
|
1246
|
-
this.
|
|
1396
|
+
s[i].keys.includes(r) && this.triggeredToggleKeybinds.delete(i);
|
|
1397
|
+
this.checkKeybindUps();
|
|
1247
1398
|
}
|
|
1248
|
-
async
|
|
1249
|
-
const
|
|
1250
|
-
for (const [
|
|
1399
|
+
async checkKeybindUps() {
|
|
1400
|
+
const t = this.keybindsFile.get();
|
|
1401
|
+
for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1251
1402
|
if (!s.up) continue;
|
|
1252
|
-
const i =
|
|
1253
|
-
this.activeKeybinds.has(
|
|
1403
|
+
const i = t[r];
|
|
1404
|
+
this.activeKeybinds.has(r) && i.keys.some((a) => !this.pressedKeys.has(a)) && (this.activeKeybinds.delete(r), s.up(), this.logger.log("Keybind up triggered", this.getKeybindToString(i)));
|
|
1254
1405
|
}
|
|
1255
1406
|
}
|
|
1256
1407
|
async checkKeybindings() {
|
|
1257
|
-
const
|
|
1258
|
-
for (const [
|
|
1259
|
-
const i =
|
|
1260
|
-
if (i.keys.length === this.pressedKeys.size && i.keys.every((
|
|
1261
|
-
this.
|
|
1408
|
+
const t = this.keybindsFile.get();
|
|
1409
|
+
for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1410
|
+
const i = t[r];
|
|
1411
|
+
if (i.keys.length === this.pressedKeys.size && i.keys.every((o) => we.has(o) ? this.pressedKeys.has(o) : !1)) {
|
|
1412
|
+
this.triggerKeybind(i, s, r);
|
|
1262
1413
|
return;
|
|
1263
1414
|
}
|
|
1264
1415
|
}
|
|
1265
|
-
for (const [
|
|
1266
|
-
const i =
|
|
1267
|
-
i.keys.every((
|
|
1416
|
+
for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1417
|
+
const i = t[r];
|
|
1418
|
+
i.keys.every((o) => we.has(o) ? this.pressedKeys.has(o) : (this.logger.error("Unknown key", o, i), !1)) && this.triggerKeybind(i, s, r);
|
|
1268
1419
|
}
|
|
1269
1420
|
}
|
|
1270
|
-
|
|
1271
|
-
const i =
|
|
1272
|
-
if (i === "toggle" &&
|
|
1273
|
-
const
|
|
1421
|
+
triggerKeybind(t, r, s) {
|
|
1422
|
+
const i = t.mode;
|
|
1423
|
+
if (i === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(s)) {
|
|
1424
|
+
const a = r.toggle();
|
|
1274
1425
|
this.triggeredToggleKeybinds.add(s), this.logger.log(
|
|
1275
|
-
|
|
1276
|
-
this.
|
|
1426
|
+
a ? `Keybind pressed rejected: ${a}` : "Keybind pressed accepted",
|
|
1427
|
+
this.getKeybindToString(t)
|
|
1277
1428
|
);
|
|
1278
1429
|
}
|
|
1279
|
-
if (i === "hold" &&
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1430
|
+
if (i === "hold" && r.down && !this.activeKeybinds.has(s)) {
|
|
1431
|
+
const a = r.down();
|
|
1432
|
+
a ? this.logger.log(`Keybind down rejected: ${a}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(s), this.logger.log("Keybind down accepted", this.getKeybindToString(t)));
|
|
1282
1433
|
}
|
|
1283
1434
|
}
|
|
1284
|
-
|
|
1285
|
-
return `(${
|
|
1435
|
+
getKeybindToString(t) {
|
|
1436
|
+
return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
|
|
1286
1437
|
}
|
|
1287
1438
|
}
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1439
|
+
class hn extends Ae {
|
|
1440
|
+
constructor(t) {
|
|
1441
|
+
super("OverridesManager");
|
|
1442
|
+
c(this, "renderInterface");
|
|
1443
|
+
c(this, "globalCursorOverrideCount", /* @__PURE__ */ new Set());
|
|
1444
|
+
c(this, "globalMouseBlockCount", /* @__PURE__ */ new Set());
|
|
1445
|
+
c(this, "globalKeyboardBlockCount", /* @__PURE__ */ new Set());
|
|
1446
|
+
c(this, "keyInputBlocks", {});
|
|
1447
|
+
this.renderInterface = O.getInstance().getInterface(t);
|
|
1448
|
+
}
|
|
1449
|
+
scope(t) {
|
|
1450
|
+
return {
|
|
1451
|
+
setGlobalCursorOverride: (r) => this.setGlobalCursorOverride(t, r),
|
|
1452
|
+
setGlobalMouseBlock: (r) => this.setGlobalMouseBlock(t, r),
|
|
1453
|
+
setGlobalKeyboardBlock: (r) => this.setGlobalKeyboardBlock(t, r),
|
|
1454
|
+
setKeyInputBlock: (r, s) => this.setKeyInputBlock(t, r, s)
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1457
|
+
setGlobalCursorOverride(t, r) {
|
|
1458
|
+
r ? this.globalCursorOverrideCount.add(t) : this.globalCursorOverrideCount.delete(t), r && this.globalCursorOverrideCount.size === 1 ? this.renderInterface.instance.setGlobalCursorOverride(!0) : !r && this.globalCursorOverrideCount.size === 0 && this.renderInterface.instance.setGlobalCursorOverride(!1);
|
|
1459
|
+
}
|
|
1460
|
+
setGlobalMouseBlock(t, r) {
|
|
1461
|
+
r ? this.globalMouseBlockCount.add(t) : this.globalMouseBlockCount.delete(t), r && this.globalMouseBlockCount.size === 1 ? this.renderInterface.instance.setGlobalMouseBlock(!0) : !r && this.globalMouseBlockCount.size === 0 && this.renderInterface.instance.setGlobalMouseBlock(!1);
|
|
1462
|
+
}
|
|
1463
|
+
setGlobalKeyboardBlock(t, r) {
|
|
1464
|
+
r ? this.globalKeyboardBlockCount.add(t) : this.globalKeyboardBlockCount.delete(t), r && this.globalKeyboardBlockCount.size === 1 ? this.renderInterface.instance.setGlobalKeyboardBlock(!0) : !r && this.globalKeyboardBlockCount.size === 0 && this.renderInterface.instance.setGlobalKeyboardBlock(!1);
|
|
1465
|
+
}
|
|
1466
|
+
setKeyInputBlock(t, r, s) {
|
|
1467
|
+
this.keyInputBlocks[r] || (this.keyInputBlocks[r] = /* @__PURE__ */ new Set()), s ? this.keyInputBlocks[r].add(t) : this.keyInputBlocks[r].delete(t), s && this.keyInputBlocks[r].size === 1 ? this.renderInterface.instance.setKeyInputBlock(r, !0) : !s && this.keyInputBlocks[r].size === 0 && this.renderInterface.instance.setKeyInputBlock(r, !1);
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
const gn = _(hn, "OGG_SIEGE");
|
|
1471
|
+
let te = !1, U;
|
|
1472
|
+
function Jn(n) {
|
|
1473
|
+
const { init: e = !0 } = n;
|
|
1474
|
+
if (fn(n), te)
|
|
1475
|
+
return U;
|
|
1476
|
+
function t() {
|
|
1477
|
+
_n(n);
|
|
1478
|
+
const r = /* @__PURE__ */ new Map(), s = mn(n.modules, r), i = bn(), a = En(n.keybinds), o = In(), l = wn();
|
|
1479
|
+
pn(), vn(n, r), te = !0, U = {
|
|
1480
|
+
...s,
|
|
1481
|
+
...i,
|
|
1482
|
+
keybinds: a,
|
|
1483
|
+
windows: o,
|
|
1484
|
+
input: l,
|
|
1485
|
+
hasAnyActiveProcesses: () => C.getInstance().hasAnyActiveProcesses,
|
|
1486
|
+
init: t
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
return e ? (t(), U) : new Proxy(
|
|
1490
|
+
{
|
|
1491
|
+
init: t
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
get: (r, s) => {
|
|
1495
|
+
if (s !== "init" && !te)
|
|
1496
|
+
throw new Error("overlayed was called before initialized");
|
|
1497
|
+
return s === "init" ? r[s] : U[s];
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
global.OVERLAYED = new Proxy({}, {
|
|
1503
|
+
get: () => {
|
|
1504
|
+
throw new Error("function overlayed was not called");
|
|
1505
|
+
}
|
|
1506
|
+
});
|
|
1507
|
+
function fn(n) {
|
|
1508
|
+
global.OVERLAYED = {
|
|
1509
|
+
APP_NAME: n.appName
|
|
1294
1510
|
};
|
|
1295
1511
|
}
|
|
1296
|
-
function
|
|
1297
|
-
|
|
1512
|
+
function pn() {
|
|
1513
|
+
Ne.getInstance().init(), B.getInstance().init(), C.getInstance().init(), T.getInstance().init(), Pe.on("quit", () => {
|
|
1514
|
+
yn();
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
function yn() {
|
|
1518
|
+
T.getInstance().destroy(), B.getInstance().destroy(), Ne.getInstance().destroy(), C.getInstance().destroy(), O.getInstance().getInterface("OGG_SIEGE").destroy(), le.getInstance().destroy(), E.getInstance().destroy();
|
|
1298
1519
|
}
|
|
1299
|
-
function
|
|
1300
|
-
return
|
|
1301
|
-
const s =
|
|
1302
|
-
return
|
|
1520
|
+
function mn(n, e) {
|
|
1521
|
+
return n.reduce((t, r) => {
|
|
1522
|
+
const s = r.key;
|
|
1523
|
+
return t[s] = {
|
|
1524
|
+
// prettier-ignore
|
|
1525
|
+
on(i, a) {
|
|
1526
|
+
const o = M(s, i), l = e.get(o) ?? /* @__PURE__ */ new Set();
|
|
1527
|
+
l.add(a), e.set(o, l);
|
|
1528
|
+
},
|
|
1529
|
+
onAny(i) {
|
|
1530
|
+
const a = M(s, "*"), o = e.get(a) ?? /* @__PURE__ */ new Set();
|
|
1531
|
+
o.add(i), e.set(a, o);
|
|
1532
|
+
},
|
|
1303
1533
|
// prettier-ignore
|
|
1304
|
-
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1534
|
+
off(i, a) {
|
|
1535
|
+
const o = M(s, i), l = e.get(o) ?? /* @__PURE__ */ new Set();
|
|
1536
|
+
l.delete(a), e.set(o, l);
|
|
1307
1537
|
},
|
|
1308
1538
|
// prettier-ignore
|
|
1309
|
-
|
|
1310
|
-
const a =
|
|
1311
|
-
|
|
1539
|
+
offAny(i) {
|
|
1540
|
+
const a = M(s, "*"), o = e.get(a) ?? /* @__PURE__ */ new Set();
|
|
1541
|
+
o.delete(i), e.set(a, o);
|
|
1312
1542
|
}
|
|
1313
|
-
},
|
|
1543
|
+
}, t;
|
|
1314
1544
|
}, {});
|
|
1315
1545
|
}
|
|
1316
|
-
function
|
|
1317
|
-
const
|
|
1546
|
+
function bn() {
|
|
1547
|
+
const n = E.getInstance(), e = B.getInstance();
|
|
1318
1548
|
return {
|
|
1319
|
-
on: (
|
|
1320
|
-
switch (
|
|
1549
|
+
on: (t, r) => {
|
|
1550
|
+
switch (t) {
|
|
1551
|
+
case "fatal":
|
|
1552
|
+
n.on("fatal", r);
|
|
1553
|
+
break;
|
|
1554
|
+
case "error":
|
|
1555
|
+
n.on("error", r);
|
|
1556
|
+
break;
|
|
1557
|
+
case "warning":
|
|
1558
|
+
n.on("warning", r);
|
|
1559
|
+
break;
|
|
1560
|
+
case "gameLaunch":
|
|
1561
|
+
e.on("gameLaunch", r);
|
|
1562
|
+
break;
|
|
1563
|
+
case "gameClose":
|
|
1564
|
+
e.on("gameClose", r);
|
|
1565
|
+
break;
|
|
1566
|
+
default:
|
|
1567
|
+
throw new Error(`Event type not implemented ${t}`, { cause: [t, r] });
|
|
1568
|
+
}
|
|
1569
|
+
},
|
|
1570
|
+
off: (t, r) => {
|
|
1571
|
+
switch (t) {
|
|
1572
|
+
case "fatal":
|
|
1573
|
+
n.off("fatal", r);
|
|
1574
|
+
break;
|
|
1321
1575
|
case "error":
|
|
1322
|
-
|
|
1576
|
+
n.off("error", r);
|
|
1323
1577
|
break;
|
|
1324
1578
|
case "warning":
|
|
1325
|
-
|
|
1579
|
+
n.off("warning", r);
|
|
1326
1580
|
break;
|
|
1327
1581
|
case "gameLaunch":
|
|
1328
|
-
|
|
1582
|
+
e.off("gameLaunch", r);
|
|
1329
1583
|
break;
|
|
1330
1584
|
case "gameClose":
|
|
1331
|
-
|
|
1585
|
+
e.off("gameClose", r);
|
|
1332
1586
|
break;
|
|
1333
1587
|
default:
|
|
1334
|
-
throw new Error(
|
|
1588
|
+
throw new Error(`Event type not implemented ${t}`, { cause: [t, r] });
|
|
1335
1589
|
}
|
|
1336
1590
|
}
|
|
1337
1591
|
};
|
|
1338
1592
|
}
|
|
1339
|
-
function
|
|
1340
|
-
return `${
|
|
1593
|
+
function M(n, e) {
|
|
1594
|
+
return `${n}:${e}`;
|
|
1341
1595
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const
|
|
1344
|
-
function
|
|
1345
|
-
const i =
|
|
1346
|
-
if (i instanceof
|
|
1596
|
+
function vn(n, e) {
|
|
1597
|
+
const t = le.getInstance();
|
|
1598
|
+
function r(s) {
|
|
1599
|
+
const i = ht(s);
|
|
1600
|
+
if (i instanceof K.errors) {
|
|
1601
|
+
E.getInstance().warn("Invalid event", "INVALID_EVENT", {
|
|
1602
|
+
summary: i.summary
|
|
1603
|
+
});
|
|
1347
1604
|
return;
|
|
1348
|
-
|
|
1349
|
-
|
|
1605
|
+
}
|
|
1606
|
+
const a = n.modules.find((f) => f.key === i.game), o = a == null ? void 0 : a.events.event;
|
|
1607
|
+
if (!o)
|
|
1350
1608
|
return;
|
|
1351
|
-
const
|
|
1352
|
-
if (
|
|
1609
|
+
const l = o(s);
|
|
1610
|
+
if (l instanceof K.errors) {
|
|
1611
|
+
E.getInstance().warn("Invalid event", "INVALID_EVENT", {
|
|
1612
|
+
summary: l.summary
|
|
1613
|
+
});
|
|
1353
1614
|
return;
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1615
|
+
}
|
|
1616
|
+
const d = M(a.key, l.type), h = M(a.key, "*"), g = e.get(d), u = e.get(h), p = [...Array.from(g ?? []), ...Array.from(u ?? [])];
|
|
1617
|
+
p.length !== 0 && p.forEach((f) => {
|
|
1618
|
+
f(l);
|
|
1357
1619
|
});
|
|
1358
1620
|
}
|
|
1359
|
-
return
|
|
1621
|
+
return t.on("data", (s) => s.forEach(r)), t.on("error", (s) => {
|
|
1622
|
+
E.getInstance().error("Pipe server error", "PIPE_SERVER_ERROR", {
|
|
1623
|
+
error: s
|
|
1624
|
+
});
|
|
1625
|
+
}), t;
|
|
1360
1626
|
}
|
|
1361
|
-
function
|
|
1362
|
-
const
|
|
1363
|
-
for (const
|
|
1364
|
-
t[
|
|
1365
|
-
on: (
|
|
1366
|
-
switch (
|
|
1627
|
+
function En(n) {
|
|
1628
|
+
const e = new dn(n), t = {};
|
|
1629
|
+
for (const s in n)
|
|
1630
|
+
t[s] = {
|
|
1631
|
+
on: (i, a) => {
|
|
1632
|
+
switch (i) {
|
|
1367
1633
|
case "down":
|
|
1368
|
-
e.
|
|
1634
|
+
e.onKeybindDown(s, a);
|
|
1369
1635
|
break;
|
|
1370
1636
|
case "up":
|
|
1371
|
-
e.
|
|
1637
|
+
e.onKeybindUp(s, a);
|
|
1372
1638
|
break;
|
|
1373
1639
|
case "toggle":
|
|
1374
|
-
e.
|
|
1640
|
+
e.onKeybindToggled(s, a);
|
|
1375
1641
|
break;
|
|
1376
1642
|
default:
|
|
1377
|
-
throw new Error(
|
|
1643
|
+
throw new Error(`Event type not implemented ${i}`, { cause: [i, a] });
|
|
1378
1644
|
}
|
|
1379
1645
|
}
|
|
1380
1646
|
};
|
|
1381
|
-
|
|
1647
|
+
const r = {
|
|
1648
|
+
...t,
|
|
1649
|
+
getConfig: () => e.getConfig(),
|
|
1650
|
+
pauseKeybindListening: () => {
|
|
1651
|
+
e.keybindListeningPaused = !0;
|
|
1652
|
+
},
|
|
1653
|
+
resumeKeybindListening: () => {
|
|
1654
|
+
e.keybindListeningPaused = !1;
|
|
1655
|
+
},
|
|
1656
|
+
updateKeybind: (s, i) => {
|
|
1657
|
+
e.updateKeybind(s, i);
|
|
1658
|
+
},
|
|
1659
|
+
updateKeybinds: (s) => {
|
|
1660
|
+
e.updateKeybinds(s);
|
|
1661
|
+
}
|
|
1662
|
+
};
|
|
1663
|
+
return e.init(), Pe.on("quit", () => {
|
|
1664
|
+
e.destroy();
|
|
1665
|
+
}), r;
|
|
1666
|
+
}
|
|
1667
|
+
function In() {
|
|
1668
|
+
return {
|
|
1669
|
+
createWindow: (n) => y().instance.newWindowInternal(Ze.BrowserWindow, n),
|
|
1670
|
+
on: (n, e) => y().instance.on(n, e),
|
|
1671
|
+
off: (n, e) => y().instance.off(n, e),
|
|
1672
|
+
once: (n, e) => y().instance.once(n, e),
|
|
1673
|
+
addListener: (n, e) => y().instance.addListener(n, e),
|
|
1674
|
+
removeListener: (n, e) => y().instance.removeListener(n, e),
|
|
1675
|
+
removeAllListeners: () => y().instance.removeAllListeners(),
|
|
1676
|
+
prependListener: (n, e) => y().instance.prependListener(n, e),
|
|
1677
|
+
prependOnceListener: (n, e) => y().instance.prependOnceListener(n, e),
|
|
1678
|
+
getActiveGameInfo: () => {
|
|
1679
|
+
const n = y(), e = le.getInstance();
|
|
1680
|
+
return {
|
|
1681
|
+
resolution: n.resolution,
|
|
1682
|
+
isConnected: e.hasConnection
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
function wn() {
|
|
1688
|
+
return {
|
|
1689
|
+
scope: (n) => gn.getInstance().scope(n),
|
|
1690
|
+
raw: {
|
|
1691
|
+
setGlobalMouseBlock: (n) => y().instance.setGlobalMouseBlock(n),
|
|
1692
|
+
setGlobalKeyboardBlock: (n) => y().instance.setGlobalKeyboardBlock(n),
|
|
1693
|
+
setGlobalCursorOverride: (n) => y().instance.setGlobalCursorOverride(n),
|
|
1694
|
+
setKeyInputBlock: (n, e) => y().instance.setKeyInputBlock(n, e),
|
|
1695
|
+
getGlobalMouseBlock: () => y().instance.getGlobalMouseBlock(),
|
|
1696
|
+
getGlobalKeyboardBlock: () => y().instance.getGlobalKeyboardBlock(),
|
|
1697
|
+
getGlobalCursorOverride: () => y().instance.getGlobalCursorOverride(),
|
|
1698
|
+
getKeyInputBlock: (n) => y().instance.getKeyInputBlock(n)
|
|
1699
|
+
}
|
|
1700
|
+
};
|
|
1701
|
+
}
|
|
1702
|
+
function _n(n) {
|
|
1703
|
+
P.getInstance().clientId = n.appName, P.getInstance().userId = Qt.generateUniqueIdentifier(), E.getInstance().on("fatal", (e) => {
|
|
1704
|
+
P.getInstance().track("fatal", {
|
|
1705
|
+
message: e.message,
|
|
1706
|
+
code: e.code,
|
|
1707
|
+
data: e.data
|
|
1708
|
+
});
|
|
1709
|
+
}), E.getInstance().on("error", (e) => {
|
|
1710
|
+
P.getInstance().track("error", {
|
|
1711
|
+
message: e.message,
|
|
1712
|
+
code: e.code,
|
|
1713
|
+
data: e.data
|
|
1714
|
+
});
|
|
1715
|
+
}), E.getInstance().on("warning", (e) => {
|
|
1716
|
+
P.getInstance().track("warning", {
|
|
1717
|
+
message: e.message,
|
|
1718
|
+
code: e.code,
|
|
1719
|
+
data: e.data
|
|
1720
|
+
});
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
function y() {
|
|
1724
|
+
return O.getInstance().getInterface("OGG_SIEGE");
|
|
1382
1725
|
}
|
|
1383
1726
|
export {
|
|
1384
|
-
|
|
1727
|
+
Jn as overlayed
|
|
1385
1728
|
};
|