-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.old
793 lines (745 loc) · 34.4 KB
/
index.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
const WARN = "#b96800";
const fileInput = document.querySelector("#file-input");
const fileClickInput = document.getElementById("file-click-input");
fileInput.addEventListener("dragenter", (_) => {
fileInput.classList.add("dragging");
});
fileInput.addEventListener("dragleave", (_) => {
fileInput.classList.remove("dragging");
});
fileInput.addEventListener("dragover", e => {
e.preventDefault();
e.stopPropagation();
});
fileInput.addEventListener("drop", e => {
e.preventDefault();
e.stopPropagation();
loadFile(e.dataTransfer.files[0])
});
fileInput.addEventListener("click", e => {
fileClickInput.click();
});
fileClickInput.addEventListener("change", e => {
loadFile(e.target.files[0])
});
function escapeHTML(str) {
var p = document.createElement("p");
p.appendChild(document.createTextNode(str));
return p.innerHTML;
}
String.prototype.hashCode = function () {
var hash = 0, i, chr;
if (this.length === 0) return hash;
for (i = 0; i < this.length; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;
};
class GameInfo {
version = "";
build = "";
platform = "Unknown (pirated?)";
hmd = "Unknown";
hmdModel = "Unknown";
renderer = "Unknown";
vram = "Unknown";
driver = "Unknown";
gameDir = ""
mods = {};
events = [];
loadErrors = {};
loadedDLLs = [];
incompatibleMods = {};
missingAddresses = []
missingCatalogData = [];
summaries = new Set();
brokenMods = new Set();
}
let lastLevel = null;
let potion = null;
let tags = {
unmodded: { icon: "info-circle", text: "This exception traceback does not mention any modded code.<br><br>It may be a base-game issue, but more likely it's the game reacting poorly to something a mod has done." },
modded: { icon: "plugin", text: "This exception likely comes from modded code." },
harmony: { icon: "screw-driver", text: "This exception likely comes from code injected using Harmony." },
}
const ignoredArgs = [
"ThunderRoad.",
"Generic.",
"UnityEngine.",
"System.",
"Collections.",
"ResourceManagement.",
"AsyncOperations.",
]
let summaries = {
pirated: {
cause: () => "You are running a pirated version of the game, and shouldn't expect mods to work.",
solution: () => "Buy the game through Steam or Oculus.",
color: "#883333"
},
incompatibleMods: {
cause: () => "One or more of your mods is not compatible with your game version.",
solution: () => "Head to the 'Incompatible Mods' section below to see which mods aren't up to date."
},
brokenMods: {
cause: () => `The following mods encountered errors: <ul>${Array.from(gameInfo.brokenMods).map(mod => `<li>${mod}</li>`).join('')}</ul>`,
solution: () => `<span>There are more details in the exception logs below; look for the <i class="icofont-plugin"></i> icon and contact the developer of the mod.<span><br>`
},
loadErrors: {
cause: () => `The following mods did not load properly: <ul>${Array.from(Object.keys(gameInfo.loadErrors)).map(mod => `<li>${mod}</li>`).join('')}</ul>`,
solution: () => `You may need to reinstall these mods if you want them to work.`
},
jsonVersionMismatch: {
cause: () => `One or more of your mods has a JSON version mismatch. The files that do not have the correct version will not be loaded.`,
solution: () => `Change the <code>"version":</code> key to the correct value.`
}
}
function checkLine(string, regex, callback) {
let match = string.match(regex);
if (match) {
callback(match.groups);
}
}
let gameInfo = new GameInfo();
class Mod {
constructor(modFolder, modName, modTags) {
this.folder = modFolder;
this.name = modName;
this.author = 'Unknown'
this.tags = modTags;
}
}
class MissingAddressError {
constructor(id, type, requester, requesterType) {
this.id = id;
this.type = type;
this.requester = requester;
this.requesterType = requesterType;
}
}
class MissingDataError {
constructor(id, type) {
this.id = id;
this.type = type;
}
}
class IncompatibleMod {
constructor(mod, version, minVersion) {
this.mod = mod;
this.version = version;
this.minVersion = minVersion;
}
}
class LoadError {
constructor(file, error) {
this.file = file;
this.error = error;
}
}
class LoadedDLL {
constructor(modFolder, dllName) {
this.modFolder = modFolder;
this.dllName = dllName;
}
}
class GlobalEvent {
constructor(text, description, color, props) {
this.color = color ?? "#338833";
this.text = text;
this.description = description;
this.props = props ?? {};
this.eventType = "global";
}
render() {
let desc = []
if (this.description !== undefined)
desc.push(`<div>${this.description}</div>`);
if (this.props !== undefined)
Object.keys(this.props).forEach(key => {
desc.push(`<div class="split" style="max-width: 20%; min-width: 200px; margin: auto;"><span class="dim">${key}:</span><span class="code select">${this.props[key]}</span></div>`);
});
return `<div class="global event" style="background-color: ${this.color}">
<div class="event-title">${this.text}</div>
${desc.length > 0 ? `<div class="event-details">${desc.join("")}</div>` : ""}
</div>`
}
}
class PotionEvent {
constructor(reagent, strength) {
this.count = 1;
this.reagent = reagent;
this.strength = strength;
this.ingredients = []
}
render() {
return `<div class="global event" style="background-color: #8833AA">
${(this.count > 1) ? `<span class="dim count">${this.count}x</span>` : ""}
<div class="event-title">Created ${this.reagent} Potion <span class="dim">${this.strength}%</span></div>
${this.ingredients.length > 0 ? `<div class="event-details">${this.ingredients.map(ingredient => `<div>${ingredient.render()}</div>`).join("")}</div>` : ""}
</div>`
}
}
class Ingredient {
constructor(ingredient, strength, inverted, modifiers) {
this.ingredient = ingredient;
this.strength = strength;
this.inverted = inverted;
this.modifiers = modifiers;
}
render() {
return `<span>${this.ingredient}</span><span class="dim"> - ${this.strength}%</span> ${this.inverted ? `<span class="dim italic">- inverted</span>`: ""}`;
}
}
class OnTrigger {
constructor(ingredient) {
this.ingredient = ingredient;
}
render() {
return `<span>On Trigger: ${this.ingredient}</span>`
}
}
class LogException {
constructor(type, error, lines, tags, mods) {
this.type = type;
this.error = error;
this.lines = lines;
this.count = 1;
this.eventType = "exception";
this.tags = tags;
this.mods = mods;
this.extras = {
'modded': `<br><span style="margin-bottom: 5px;">Possible causes:</span><br>${Array.from(this.mods).map(mod => ` - <span class="hover-mod-name">${mod}</span>`).join('<br>')}`
}
}
render() {
return `<div class="exception event" onclick="expandException(this)">
${(this.count > 1) ? `<span class="dim count">${this.count}x</span>` : ""}
<span class="tags">
${Array.from(this.tags).map(tag => `<i class="tag icofont-${tags[tag].icon}"><p>${tags[tag].text}${this.extras[tag] ? this.extras[tag] : ''}</p></i>`).join('')}
</span>
<div class="event-title">${this.type}</div>
${(this.error) ? `<span class="exception-title">${this.error}</span>` : ''}
${(this.lines.length > 0)
? `<div class="event-details event-hidden">
<div class="exception-lines">${this.lines.map(line => line.render()).join("")}</div>
</div>`
: ''}
</div>`
}
}
class ExceptionLine {
constructor(location, address, filename, line) {
this.location = location;
this.address = address;
this.filename = filename;
this.line = line;
if (filename?.match(/<(.+)>/)) {
this.filename = filename.match(/<(?<address>.+)>/).groups.address;
this.line = -1;
}
}
getPath() {
const funcSig = this.location.match(/(?<func>.+?) ?\((?<args>.+)?\)/);
if (funcSig) {
const funcPart = [...funcSig.groups.func
.matchAll(/(\w+(<.+?>)?)(?:[^:. ()]+)?/g)]
.map(x => x[1].replace(/<(.+)>/, (_, type) => ` <span class="dim"><${type.split(".").pop()}></span>`))
.map(x => x == 'ctor' ? '<span class="italic">constructor</span>' : `<span>${x}</span>`)
.join(`<span class="dim"> > </span>`);
let argsPart = [];
if (funcSig.groups.args)
argsPart = [...funcSig.groups.args.matchAll(/(?:([^`, ]+)[^, ]*( ([^`, ]+)[^ ,]*)?)/g)].map(x => x[1] + (x[2] ? x[2] : ''));
let argsString = "";
argsPart = argsPart.map(part => {
let argPortions = [...part.split(' ')[0].matchAll(/(\w+(\.|\+|\\)?)/g)].map(x => x[1]);
if (argPortions.length > 1) {
let portions = argPortions
.slice(0, argPortions.length - 1)
.map(portion => portion
.replace(/\+|\\/, '.'))
.filter(portion => ignoredArgs.indexOf(portion) == -1)
.map(portion => `<span class="arg dim">${portion}</span>`);
portions.push(`<span class="arg">${argPortions[argPortions.length - 1]}</span>`);
return portions.join('') + (part.split(' ').length > 1 ? ` <span>${part.split(' ')[1]}</span>` : '');
} else {
return `<span class="arg">${argPortions[0]}</span>${part.split(' ').length > 1 ? ` <span>${part.split(' ')[1]}</span>` : ''}`
}
});
argsPart = argsPart.map(x => x.replace(/(\.\w+)/g, `<span class="arg">$1</span>`));
argsString = argsPart
.map(part => `${part}`)
.join(`<span class="dim">,</span>|`)
.split('|')
.map(part => `<span class="block">${part}</span>`)
.join(' ');
return `${funcPart} <span>(</span>${argsString}<span>)</span>`;
}
return this.location;
}
renderFilename() {
return this.filename
.replace(/\\/g, "/")
.replace(/E:\/Dev\/BladeAndSorcery\/Library\/PackageCache\/(?<package>.+?)@(?<version>.+?)\//, (_, name, version) => `<span class="dim">[${name} @ ${version}]</span> `)
.replace("E:/Dev/BladeAndSorcery/", `<span class="dim">[ThunderRoad]</span> `)
.replace("C:/buildslave/unity/build/", `<span class="dim">[Unity]</span> `)
.replace(/[A-Z]:\/Users\/.+?\/AppData\/Local\/JetBrains\/Shared\/vAny\/DecompilerCache\/decompiler\/.+?\/.+?\/.+?\//, `<span class="dim">[ThunderRoad]</span> `)
.replace("C:/Users/atrag/source/repos/", `<span class="dim">[lyneca]</span> `);
}
render() {
return `<span class="dim">at </span><div class="exception-line">
<div class="exception-line-location" title="${this.address}">${this.getPath()}</div>
${(this.filename != undefined && this.line >= 0)
? (`<span><span class="prefix dim">=></span>
<span><span class="dim code">line</span> <span class="exception-line-line">${this.line}</span> <span class="dim code">of</span> </span><span class="exception-line-filename">${this.renderFilename()}</span>
</span>`)
: ""}
</div>`
}
}
class Block {
constructor(string) {
let isStackTrace = false;
let isException = false;
let exceptionType = "";
let exceptionError = "";
let exceptionLines = [];
let exceptionIsModded = false;
let exceptionTags = new Set();
let modsMentioned = new Set();
let isExceptionLine = false;
let bundleLoadErrors = {}
for (let line of string.split("\n")) {
line = line.replace(/\//g, '\\');
isExceptionLine = false;
checkLine(line, /Mono path\[0\] = '(?<path>.+)'$/, groups => {
gameInfo.gameDir = groups.path;
});
checkLine(line, /Mono path\[0\] = '.+(Oculus)?\\Software.+/i, () => {
gameInfo.platform = "Oculus";
});
checkLine(line, /Mono path\[0\] = '.+steamapps\\common.+/i, () => {
gameInfo.platform = "Steam";
});
checkLine(line, /\(Filename: (?<filename>.+)? Line: (?<line>\d+)?\)/, groups => {
this.filename = groups.filename;
this.line = groups.line;
});
checkLine(line, /Game version: (?<version>.+)/, groups => {
gameInfo.version = groups.version;
});
checkLine(line, /Initialize engine version: (?<version>.+)/, groups => {
gameInfo.build = groups.version;
});
checkLine(line, /Loading plugin assembly .+BladeAndSorcery_Data\\StreamingAssets\\Mods\\(?<dirName>[^/\\]+)\\(.+\\)*(?<dllName>[^/\\]+).dll/, groups => {
gameInfo.loadedDLLs.push(new LoadedDLL(groups.dirName, groups.dllName));
});
checkLine(line, /Device model : (?<model>.+)/, groups => {
gameInfo.hmdModel = groups.model;
if (groups.model == "Miramar")
gameInfo.hmdModel += " (Quest 2)";
});
checkLine(line, /HeadDevice: (?<model>.+)/, groups => {
gameInfo.hmdModel = groups.model;
if (groups.model == "Miramar")
gameInfo.hmdModel += " (Quest 2)";
});
checkLine(line, /LoadedDeviceName : (?<device>.+)/, groups => {
gameInfo.hmd = groups.device;
});
checkLine(line, /Loader: (?<device>.+) \|/, groups => {
gameInfo.hmd = groups.device;
});
checkLine(line, / +Renderer: +(?<gpu>.+)( \(ID=.+\))/, groups => {
gameInfo.renderer = groups.gpu;
});
checkLine(line, / +VRAM: +(?<vram>\d+ MB)/, groups => {
gameInfo.vram = groups.vram;
});
checkLine(line, / +Driver: +(?<driver>.+)/, groups => {
gameInfo.driver = groups.driver;
});
checkLine(line, /\[ModManager\] Added valid mod folder: (?<folder>.+)\. Mod: (?<name>.+)/, groups => {
let existing = gameInfo.mods[groups.name];
if (existing) {
existing.tags.push('plugin');
} else {
gameInfo.mods[groups.name] = new Mod(groups.folder, groups.name, []);
}
});
checkLine(line, /\[ModManager\]\[Assembly\] - Loading mod: (?<name>.+)/, groups => {
let existing = gameInfo.mods[groups.name];
if (existing) {
existing.tags.push('dll');
}
});
checkLine(line, /Loading mod catalog (?<name>.+) by (?<author>.+)/, groups => {
let existing = gameInfo.mods[groups.name];
if (existing) {
existing.tags.push('catalog');
existing.author = groups.author;
}
});
checkLine(line, /\[JSON\]\[(?<modFolder>.+)\] - Loading catalog (?<modName>.+) by (?<modAuthor>.+)/, groups => {
let existing = gameInfo.mods[groups.modFolder];
if (existing) {
} else {
gameInfo.mods[groups.modFolder] = new Mod(groups.modFolder, groups.modName, groups.modAuthor, ['plugin']);
}
});
checkLine(line, /Crash!!!/, () => {
gameInfo.events.push(new GlobalEvent("Hard crash!", "Check the log for stack traces.<br>This may an underlying problem with your PC, or GPU drivers.", WARN))
});
checkLine(line, /^(Exception in Update Loop: )?(System\.)?(?<exceptionType>(\w+\.)*\w*Exception)(: (?<error>.+))?$/, groups => {
// Skip dependency exceptions, they are covered by Mod Load Errors
if (groups.error !== undefined && groups.error.startsWith("Dependency Exception --->")) return;
isException = true;
exceptionType = groups.exceptionType;
exceptionError = groups.error;
exceptionTags = new Set();
modsMentioned = new Set();
exceptionLines = [];
exceptionIsModded = false;
isExceptionLine = true;
});
checkLine(line, /Number of parameters specified does not match the expected number./, () => {
isException = true;
exceptionType = "Incorrect Parameter Count";
exceptionError = "Number of parameters specified does not match the expected number.";
exceptionTags = new Set();
modsMentioned = new Set();
exceptionLines = [];
exceptionIsModded = false;
isExceptionLine = true;
});
checkLine(line, /Version mismatch \(file (?<fileVersion>\d), current (?<currentVersion>\d)\) ignoring file: (?<path>.+StreamingAssets\\Mods\\(?<mod>[^\/]+)(\\.+)?\\(?<file>.+).json)/, groups => {
if (!gameInfo.loadErrors[groups.mod]) {
gameInfo.loadErrors[groups.mod] = [];
}
gameInfo.loadErrors[groups.mod].push(new LoadError(groups.file + '.json', `<div>Version mismatch in </div><pre class="directory">${groups.path}</pre><br> The file has version <code>${groups.fileVersion}</code>, but it needs version <code>${groups.currentVersion}</code>.<br>This is likely an error with the mod itself, not your installation.`));
gameInfo.summaries.add("jsonVersionMismatch");
});
checkLine(line, /Unable to open archive file: (?<file>.+StreamingAssets\\Mods\\(?<mod>.+)(\\.+)?\\(?<bundle>.+).bundle)/, groups => {
if (!gameInfo.loadErrors[groups.mod]) {
gameInfo.loadErrors[groups.mod] = [];
}
gameInfo.loadErrors[groups.mod].push(new LoadError(groups.bundle + '.bundle', `<div>Unable to open archive file:</div><pre class="directory">${groups.file}</pre><br>This is a mod installation issue, so try re-installing. It can also happen if you use Vortex and forget to enable and deploy your mods.`));
gameInfo.summaries.add("loadErrors");
});
checkLine(line, /^( at )?(\(wrapper (managed-to-native|dynamic-method)\) )?(?<location>[\w\.:`<>+/\[\]]+? ?\(.*?\)) ?((\[(?<address>0x[a-zA-Z0-9]+)\] in |\(at )(?<filename>.+):(?<line>\d+)\)?)?/, groups => {
if (isException) {
exceptionLines.push(
new ExceptionLine(
groups.location,
groups.address,
groups.filename,
groups.line));
if (groups.location.match(/__instance|Prefix|Postfix/))
exceptionTags.add("harmony");
if (!groups.location.match(/^(ThunderRoad|Unity|DelegateList|ONSPAudioSource|SteamVR|OVR|OculusVR|System|\(wrapper|Valve|delegate|MonoBehaviourCallbackHooks)/)) {
let match = groups.location.match(/^(?<namespace>(\w|\+)+)\./)
if (match != null)
modsMentioned.add(match.groups.namespace);
exceptionIsModded = true;
}
isExceptionLine = true;
}
});
checkLine(line, /Parameter name: (?<parameter>.+)/, groups => {
if (isException) {
exceptionType += ": " + groups.parameter;
isExceptionLine = true;
}
});
checkLine(line, /\[ModManager\] - Mod (?<mod>.+) for \((?<version>.+)\) is not compatible with current minimum mod version (?<minVersion>.+)/, groups => {
gameInfo.incompatibleMods[groups.mod] = new IncompatibleMod(groups.mod, groups.version, groups.minVersion);
gameInfo.summaries.add("incompatibleMods");
});
checkLine(line, /LoadJson : Cannot read file (.+StreamingAssets[\\\/]Mods[\\\/])(?<file>(?<modFolder>.+?)\\.+) \((?<error>.+)\)/, groups => {
if (!gameInfo.loadErrors[groups.modFolder]) {
gameInfo.loadErrors[groups.modFolder] = [];
}
gameInfo.loadErrors[groups.modFolder].push(new LoadError(groups.file, groups.error));
gameInfo.summaries.add("loadErrors");
});
checkLine(line, /Address \[(?<id>.+?)\] not found for object \[(?<object>.+?)( \((?<type>.+)\))?\]/, groups => {
gameInfo.missingAddresses.push(new MissingAddressError(groups.id, "", groups.object, groups.type ?? ""));
});
checkLine(line, /Data \[(?<id>.+?) \| -?\d+\] of type \[(?<dataType>.+?)\] cannot be found in catalog/, groups => {
if (groups.id != "null")
gameInfo.missingCatalogData.push(new MissingDataError(groups.id, groups.dataType));
});
checkLine(line, /Content catalog loaded/, () => {
gameInfo.events.push(new GlobalEvent("Catalog Loaded"));
});
checkLine(line, /Master level loaded/, () => {
gameInfo.events.push(new GlobalEvent("Master level loaded"));
});
checkLine(line, /Game loaded/, () => {
gameInfo.events.push(new GlobalEvent("Game loaded"));
});
checkLine(line, /Player take possession of/, () => {
gameInfo.events.push(new GlobalEvent("Player possessed creature"));
});
checkLine(line, /Load level (?<level>\w+)/, groups => {
lastLevel = new GlobalEvent(`Loaded level ${groups.level}`)
gameInfo.events.push(lastLevel);
});
checkLine(line, /Game is quitting/, () => {
gameInfo.events.push(new GlobalEvent('Game is quitting'));
});
checkLine(line, /Option: Difficulty: (?<difficulty>\d+)/, groups => {
lastLevel.props.difficulty = groups.difficulty;
});
checkLine(line, /Option: DungeonLength: (?<dungeonLength>\d+)/, groups => {
lastLevel.props.length = groups.dungeonLength;
});
checkLine(line, /Seed: (?<seed>\d+)/, groups => {
lastLevel.props.seed = groups.seed;
});
checkLine(line, /The AssetBundle 'StreamingAssets\\Mods\\(?<modFolder>[^\\]+)\\(?<bundleName>.+).bundle' (?<reason>.+)/, groups => {
if (!gameInfo.loadErrors[groups.modFolder]) {
gameInfo.loadErrors[groups.modFolder] = [];
}
gameInfo.loadErrors[groups.modFolder].push(new LoadError(groups.bundleName + '.bundle', "Bundle " + groups.reason));
gameInfo.summaries.add("loadErrors");
});
checkLine(line, /CRC Mismatch. Provided .+, calculated .+ from data. Will not load AssetBundle '(?<bundleName>.+).bundle'/, groups => {
bundleLoadErrors[groups.bundleName] = "CRC mismatch in Asset Bundle. This is a problem with your installation, delete and fully re-install the mod.";
});
checkLine(line, /Invalid path in AssetBundleProvider: '(.+\\StreamingAssets\\Mods\\(?<modFolder>[^\\]+)\\(?<bundleName>.+))\.bundle'\.$/, groups => {
if (!gameInfo.loadErrors[groups.modFolder]) {
gameInfo.loadErrors[groups.modFolder] = [];
}
if (gameInfo.loadErrors[groups.modFolder].find(elem => elem.file) == undefined)
gameInfo.loadErrors[groups.modFolder].push(new LoadError(groups.bundleName + '.bundle', bundleLoadErrors[groups.bundleName] ?? "Could not load asset bundle."));
gameInfo.summaries.add("loadErrors");
});
checkLine(line, /Unable to find asset at ress?ource location \[(?<location>.+)\] of type \[(?<dataType>.+)\] for object \[(?<requester>.+) \((?<requesterType>.+)\)\]/, groups => {
gameInfo.missingAddresses.push(new MissingAddressError(groups.location, groups.dataType, groups.requester, groups.requesterType))
});
if (isException && !isExceptionLine) {
exceptionTags.add(exceptionIsModded ? "modded" : "unmodded");
Array.from(modsMentioned).forEach(mod => gameInfo.brokenMods.add(mod));
if (exceptionIsModded)
gameInfo.summaries.add("brokenMods");
gameInfo.events.push(new LogException(exceptionType, exceptionError, exceptionLines, exceptionTags, modsMentioned));
isException = false;
}
checkLine(line, /========== OUTPUTTING STACK TRACE ==================/, () => {
isStackTrace = true;
});
checkLine(line, /\[Alquemie\] \[Alquemie.Potion.Complete\] Completed potion! Created: (?<reagent>.+) \((?<strength>\d+)%\) Potion/, group => {
potion = new PotionEvent(group.reagent, group.strength);
gameInfo.events.push(potion);
});
checkLine(line, / - (?<ingredient>.+) \((?<strength>\d+)%(?<inverted> inverted)?\): (?<modifiers>.+)/, group => {
potion?.ingredients.push(new Ingredient(group.ingredient, group.strength, group.inverted, group.modifiers));
});
checkLine(line, /On Trigger:(?<ingredient>.+)/, group => {
potion?.ingredients.push(new OnTrigger(group.ingredient));
});
/*
[Alquemie] [Alquemie.Potion.Complete] Completed potion! Created: Basic (100%) Potion with:
- Vecura Spores (100% inverted): Safety: -1 (0 * -1), Duration: 1280 (5 * 256)
- Vecura Spores (100% inverted): Safety: -1 (0 * -1), Duration: 1280 (5 * 256)
[Alquemie] [Alquemie.Potion.Complete] Completed potion! Created: Glomervytrum (100%) Potion
On Trigger:Perlaco
*/
}
if (isException) {
exceptionTags.add(exceptionIsModded ? "modded" : "unmodded");
Array.from(modsMentioned).forEach(mod => gameInfo.brokenMods.add(mod));
if (exceptionIsModded)
gameInfo.summaries.add("brokenMods");
gameInfo.events.push(new LogException(exceptionType, exceptionError, exceptionLines, exceptionTags, modsMentioned));
}
}
}
function checkPotionDupes() {
const collapsedEvents = [];
let lastEvent = null;
let lastEventHash = "";
gameInfo.events.forEach(event => {
if (event.reagent !== undefined) {
const json = JSON.stringify(event);
if (json != lastEventHash) {
lastEventHash = json;
lastEvent = event;
lastEvent.count = 1;
collapsedEvents.push(event);
} else {
lastEvent.count++;
}
} else {
collapsedEvents.push(event);
}
});
gameInfo.events = collapsedEvents;
}
function checkExceptionDupes() {
const collapsedEvents = [];
let lastEvent = null;
let lastEventHash = "";
gameInfo.events.forEach(event => {
if (event.eventType == "exception") {
const json = JSON.stringify(event);
if (json != lastEventHash) {
lastEventHash = json;
lastEvent = event;
lastEvent.count = 1;
collapsedEvents.push(event);
} else {
lastEvent.count++;
}
} else {
collapsedEvents.push(event);
lastEventHash = "";
}
});
gameInfo.events = collapsedEvents;
}
function loadFile(file) {
const reader = new FileReader();
gameInfo = new GameInfo();
reader.readAsText(file);
reader.onload = () => analyseFile(reader.result);
}
function analyseFile(log) {
const blocks = [];
log = log.replace(/\r\n/g, "\n")
.split(/\n/)
.map(line => line.replace(/^\d+-\d+ \d+:\d+:\d+.\d+\s+\d+\s+\d+ [A-Z] Unity\s+: /g, ''))
.join('\n')
.split(/\n\n/);
for (const block of log) {
blocks.push(new Block(block));
}
checkPotionDupes();
checkExceptionDupes();
display();
}
const infoSpans = {
version: document.querySelector(".game-info#version"),
build: document.querySelector(".game-info#build"),
platform: document.querySelector(".game-info#platform"),
hmd: document.querySelector(".game-info#hmd"),
hmdModel: document.querySelector(".game-info#model"),
renderer: document.querySelector(".game-info#renderer"),
vram: document.querySelector(".game-info#vram"),
driver: document.querySelector(".game-info#driver"),
}
function display() {
document.getElementById("output").classList.remove("hidden");
displayInfo();
displayMods();
displayOldMods();
displayLoadErrors();
displayMissingCatalogData();
displayMissingAddresses();
displayExceptions();
displayEvents();
displaySummary();
}
function displayInfo() {
for (key of Object.keys(infoSpans)) {
infoSpans[key].innerHTML = gameInfo[key];
infoSpans[key].style.display = "inline-block";
}
document.querySelector('#directory').innerHTML = gameInfo.gameDir;
}
function displayMods() {
if (gameInfo.mods.length == 0) {
document.querySelector('#mods').innerHTML = `<div class="dim italic">No mods installed.</div>`;
return;
}
document.querySelector('#mods').innerHTML = Object.values(gameInfo.mods).map(
mod => `<span class="mod">${mod.name}<span class="dim line-left">${mod.author}</span></span>`
).join('');
}
function displayOldMods() {
if (Object.values(gameInfo.incompatibleMods).length == 0) {
document.querySelector('#incompatible-mods').innerHTML = `<div class="dim italic">No incompatible mods.</div>`;
return;
}
document.querySelector('#incompatible-mods').innerHTML = Object.values(gameInfo.incompatibleMods).map(
data => `<div class="incompatible-mod missing-data-item">${data.mod}<span class="dim normal line-left">mod v${data.version}, needs v${data.minVersion}</span></div>`
).join('');
}
function displayLoadErrors() {
if (Object.keys(gameInfo.loadErrors).length == 0) {
document.querySelector('#load-errors').innerHTML = `<div class="dim italic">No mod load errors.</div>`;
return;
}
document.querySelector('#load-errors').innerHTML = Object.keys(gameInfo.loadErrors).map(
key => `<div class="load-error-category">
<h3 class="load-error-name" onclick="expandLoadErrorCategory(this)"><span class="load-error-count">${gameInfo.loadErrors[key].length}</span>${key}</h3>
<div class="load-error-list">
${gameInfo.loadErrors[key].map(error => `<div class="load-error" onclick="expandLoadError(this)">
<span class="load-error-file">${error.file.replace(/\\/g, `<span class="dim"> > </span>`)}</span>
<span class="load-error-error">${error.error}</span></div>`).join("")}
</div>
</div>`
).join('');
}
function displayMissingAddresses() {
document.querySelector('#missing-addresses').innerHTML = "<tr><th>Address / Location</th><th>Type</th><th>Requester</th><th>Requester Type</th></tr>" +
gameInfo.missingAddresses.map(
data => `<tr class="missing-address-row"><td class="code">${data.id}</td><td class="dim code">${data.type}</td><td class="dim code">${data.requester}</td><td class="dim code">${data.requesterType}</td></tr>`
).join('');
}
function displayMissingCatalogData() {
document.querySelector('#missing-data').innerHTML = "<tr><th>Catalog ID</th><th>Type</th></tr>" +
gameInfo.missingCatalogData.map(
data => `<tr><td class="code">${data.id}</td><td class="code dim">${data.type}</td></tr>`
).join('');
}
function displayExceptions() { }
function displayEvents() {
document.querySelector('#events').innerHTML = gameInfo.events
.map(event => event.render())
.join('');
}
function displaySummary() {
if (gameInfo.platform == "Unknown (pirated?)") gameInfo.summaries.add("pirated");
if (gameInfo.summaries.size == 0) {
document.querySelector('#summary').innerHTML = `<div class="dim italic">No summaries available.</div>`
return;
}
document.querySelector('#summary').innerHTML = Array
.from(gameInfo.summaries)
.map(tag =>
`<div class="summary-item" style="background-color: ${summaries[tag].color ?? "#4a4a5a"}">
<i class="icofont-exclamation-circle summary-icon"></i>
<div class="cause">${summaries[tag].cause()}</div>
<div class="solution"><span class="dim">Solution:</span><span>${summaries[tag].solution()}</span></div>
</div>`)
.join('');
}
function expandException(elem) {
let error = elem.querySelector(".event-details");
if (error == null)
return;
if (!error.classList.contains("event-hidden")) {
error.classList.add("event-hidden");
} else {
error.classList.remove("event-hidden");
}
}
function expandLoadErrorCategory(elem) {
let error = elem.parentElement.querySelector(".load-error-list");
if (!error.classList.contains("category-expanded")) {
error.classList.add("category-expanded");
} else {
error.classList.remove("category-expanded");
}
}
function expandLoadError(elem) {
let error = elem.querySelector(".load-error-error");
if (!error.classList.contains("expanded")) {
error.classList.add("expanded");
} else {
error.classList.remove("expanded");
}
}