add m1
This commit is contained in:
parent
dcd1d2a17d
commit
c0cb2fed0b
3 changed files with 37 additions and 20 deletions
|
@ -1,5 +1,4 @@
|
||||||
import { FiltersEngine, Request } from '@cliqz/adblocker';
|
import { FiltersEngine, Request } from '@cliqz/adblocker';
|
||||||
import fetch from 'node-fetch';
|
|
||||||
|
|
||||||
let engine: FiltersEngine;
|
let engine: FiltersEngine;
|
||||||
|
|
||||||
|
|
54
src/logs.ts
54
src/logs.ts
|
@ -1,15 +1,16 @@
|
||||||
import { getLatest } from './version';
|
import { getLatest } from './version';
|
||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
|
|
||||||
// log providers
|
// log providers
|
||||||
import { readMcLogs } from './logproviders/mclogs';
|
import { readMcLogs } from './logproviders/mclogs';
|
||||||
import { read0x0 } from './logproviders/0x0';
|
import { read0x0 } from './logproviders/0x0';
|
||||||
import { readPasteGG } from './logproviders/pastegg';
|
import { readPasteGG } from './logproviders/pastegg';
|
||||||
import { readHastebin } from './logproviders/haste';
|
import { readHastebin } from './logproviders/haste';
|
||||||
|
|
||||||
type analyzer = (text: string) => Promise<Array<string> | null>;
|
type Analyzer = (text: string) => Promise<Array<string> | null>;
|
||||||
type logProvider = (text: string) => Promise<null | string>;
|
type LogProvider = (text: string) => Promise<null | string>;
|
||||||
|
|
||||||
const javaAnalyzer: analyzer = async (text) => {
|
const javaAnalyzer: Analyzer = async (text) => {
|
||||||
if (text.includes('This instance is not compatible with Java version')) {
|
if (text.includes('This instance is not compatible with Java version')) {
|
||||||
const xp =
|
const xp =
|
||||||
/Please switch to one of the following Java versions for this instance:[\r\n]+([^\r\n]+)/g;
|
/Please switch to one of the following Java versions for this instance:[\r\n]+([^\r\n]+)/g;
|
||||||
|
@ -30,7 +31,7 @@ const javaAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const versionAnalyzer: analyzer = async (text) => {
|
const versionAnalyzer: Analyzer = async (text) => {
|
||||||
const vers = text.match(/PolyMC version: [0-9].[0-9].[0-9]/g);
|
const vers = text.match(/PolyMC version: [0-9].[0-9].[0-9]/g);
|
||||||
if (vers && vers[0]) {
|
if (vers && vers[0]) {
|
||||||
const latest = await getLatest();
|
const latest = await getLatest();
|
||||||
|
@ -45,7 +46,7 @@ const versionAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const flatpakNvidiaAnalyzer: analyzer = async (text) => {
|
const flatpakNvidiaAnalyzer: Analyzer = async (text) => {
|
||||||
if (
|
if (
|
||||||
text.includes('org.lwjgl.LWJGLException: Could not choose GLX13 config')
|
text.includes('org.lwjgl.LWJGLException: Could not choose GLX13 config')
|
||||||
) {
|
) {
|
||||||
|
@ -57,7 +58,7 @@ const flatpakNvidiaAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const forgeJavaAnalyzer: analyzer = async (text) => {
|
const forgeJavaAnalyzer: Analyzer = async (text) => {
|
||||||
if (
|
if (
|
||||||
text.includes(
|
text.includes(
|
||||||
'java.lang.NoSuchMethodError: sun.security.util.ManifestEntryVerifier.<init>(Ljava/util/jar/Manifest;)V'
|
'java.lang.NoSuchMethodError: sun.security.util.ManifestEntryVerifier.<init>(Ljava/util/jar/Manifest;)V'
|
||||||
|
@ -71,7 +72,7 @@ const forgeJavaAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const intelHDAnalyzer: analyzer = async (text) => {
|
const intelHDAnalyzer: Analyzer = async (text) => {
|
||||||
if (text.includes('org.lwjgl.LWJGLException: Pixel format not accelerated')) {
|
if (text.includes('org.lwjgl.LWJGLException: Pixel format not accelerated')) {
|
||||||
return [
|
return [
|
||||||
'Intel HD Windows 10',
|
'Intel HD Windows 10',
|
||||||
|
@ -81,7 +82,7 @@ const intelHDAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const macOSNSWindowAnalyzer: analyzer = async (text) => {
|
const macOSNSWindowAnalyzer: Analyzer = async (text) => {
|
||||||
if (
|
if (
|
||||||
text.includes(
|
text.includes(
|
||||||
"Terminating app due to uncaught exception 'NSInternalInconsistencyException'"
|
"Terminating app due to uncaught exception 'NSInternalInconsistencyException'"
|
||||||
|
@ -95,7 +96,7 @@ const macOSNSWindowAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const quiltFabricInternalsAnalyzer: analyzer = async (text) => {
|
const quiltFabricInternalsAnalyzer: Analyzer = async (text) => {
|
||||||
const base = 'Caused by: java.lang.ClassNotFoundException: ';
|
const base = 'Caused by: java.lang.ClassNotFoundException: ';
|
||||||
if (
|
if (
|
||||||
text.includes(base + 'net.fabricmc.fabric.impl') ||
|
text.includes(base + 'net.fabricmc.fabric.impl') ||
|
||||||
|
@ -116,7 +117,7 @@ const quiltFabricInternalsAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const oomAnalyzer: analyzer = async (text) => {
|
const oomAnalyzer: Analyzer = async (text) => {
|
||||||
if (text.includes('java.lang.OutOfMemoryError: Java heap space')) {
|
if (text.includes('java.lang.OutOfMemoryError: Java heap space')) {
|
||||||
return [
|
return [
|
||||||
'Out of Memory',
|
'Out of Memory',
|
||||||
|
@ -126,7 +127,7 @@ const oomAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const shenadoahGCAnalyzer: analyzer = async (text) => {
|
const shenadoahGCAnalyzer: Analyzer = async (text) => {
|
||||||
if (text.includes("Unrecognized VM option 'UseShenandoahGC'")) {
|
if (text.includes("Unrecognized VM option 'UseShenandoahGC'")) {
|
||||||
return [
|
return [
|
||||||
"Java 8 doesn't support ShenandoahGC",
|
"Java 8 doesn't support ShenandoahGC",
|
||||||
|
@ -136,7 +137,7 @@ const shenadoahGCAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const optifineAnalyzer: analyzer = async (text) => {
|
const optifineAnalyzer: Analyzer = async (text) => {
|
||||||
const matchesOpti = text.match(/\[✔️\] OptiFine_[\w,.]*/);
|
const matchesOpti = text.match(/\[✔️\] OptiFine_[\w,.]*/);
|
||||||
const matchesOptiFabric = text.match(/\[✔️\] optifabric-[\w,.]*/);
|
const matchesOptiFabric = text.match(/\[✔️\] optifabric-[\w,.]*/);
|
||||||
if (matchesOpti || matchesOptiFabric) {
|
if (matchesOpti || matchesOptiFabric) {
|
||||||
|
@ -148,7 +149,7 @@ const optifineAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const tempForge119IssueAnalyzer: analyzer = async (text) => {
|
const tempForge119IssueAnalyzer: Analyzer = async (text) => {
|
||||||
const matches = text.match(
|
const matches = text.match(
|
||||||
/Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException\n.at MC-BOOTSTRAP\/cpw.mods.modlauncher@[0-9]\.[0-9]\.[0-9]\/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch\(LaunchServiceHandlerDecorator.java:[0-9]*\)/
|
/Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException\n.at MC-BOOTSTRAP\/cpw.mods.modlauncher@[0-9]\.[0-9]\.[0-9]\/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch\(LaunchServiceHandlerDecorator.java:[0-9]*\)/
|
||||||
);
|
);
|
||||||
|
@ -161,7 +162,23 @@ const tempForge119IssueAnalyzer: analyzer = async (text) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const analyzers: analyzer[] = [
|
const tempM1Analyzer: Analyzer = async (text) => {
|
||||||
|
const lwjglFail = text.includes('[LWJGL] Failed to load a library');
|
||||||
|
const m1 =
|
||||||
|
(text.includes('natives-macos') || text.includes('natives-osx')) &&
|
||||||
|
(text.includes('aarch64') || text.includes('arm64'));
|
||||||
|
|
||||||
|
if (lwjglFail && m1) {
|
||||||
|
return [
|
||||||
|
'M1 issues',
|
||||||
|
"PolyMC doesn't support Apple M1 for sub-1.19 versions yet. Use ManyMC https://github.com/MinecraftMachina/ManyMC or PolyM1 https://github.com/ryanccn/PolyM1 if you still want to use PolyMC",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const analyzers: Analyzer[] = [
|
||||||
javaAnalyzer,
|
javaAnalyzer,
|
||||||
versionAnalyzer,
|
versionAnalyzer,
|
||||||
flatpakNvidiaAnalyzer,
|
flatpakNvidiaAnalyzer,
|
||||||
|
@ -173,9 +190,10 @@ const analyzers: analyzer[] = [
|
||||||
shenadoahGCAnalyzer,
|
shenadoahGCAnalyzer,
|
||||||
optifineAnalyzer,
|
optifineAnalyzer,
|
||||||
tempForge119IssueAnalyzer,
|
tempForge119IssueAnalyzer,
|
||||||
|
tempM1Analyzer,
|
||||||
];
|
];
|
||||||
|
|
||||||
const providers: logProvider[] = [
|
const providers: LogProvider[] = [
|
||||||
readMcLogs,
|
readMcLogs,
|
||||||
read0x0,
|
read0x0,
|
||||||
readPasteGG,
|
readPasteGG,
|
||||||
|
@ -209,11 +227,13 @@ export async function parseLog(s: string): Promise<MessageEmbed | null> {
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setTitle('Log analysis')
|
.setTitle('Log analysis')
|
||||||
.setColor('DARK_GREEN');
|
.setColor('DARK_GREEN');
|
||||||
|
|
||||||
for (const i in analyzers) {
|
for (const i in analyzers) {
|
||||||
const analyzer = analyzers[i];
|
const Analyzer = analyzers[i];
|
||||||
const out = await analyzer(log);
|
const out = await Analyzer(log);
|
||||||
if (out) embed.addField(out[0], out[1]);
|
if (out) embed.addField(out[0], out[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (embed.fields[0]) return embed;
|
if (embed.fields[0]) return embed;
|
||||||
else {
|
else {
|
||||||
embed.addField('Analyze failed', 'No issues found automatically');
|
embed.addField('Analyze failed', 'No issues found automatically');
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import fetch from 'node-fetch';
|
|
||||||
|
|
||||||
interface SimplifiedMetaVersion {
|
interface SimplifiedMetaVersion {
|
||||||
recommended: boolean;
|
recommended: boolean;
|
||||||
type: 'release' | 'snapshot';
|
type: 'release' | 'snapshot';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue