Skip to content

Commit

Permalink
✨ feat: 新的判断规则
Browse files Browse the repository at this point in the history
  • Loading branch information
HRxiaohu committed Aug 6, 2023
1 parent d1719c0 commit 67fe758
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 30 deletions.
77 changes: 61 additions & 16 deletions docs/.vitepress/theme/components/Analyzer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
</template>

<script setup>
import JSZip from "jszip"
import { ref } from "vue"
import JSZip from "jszip";
import { ref } from "vue";
// 变量初始化
var isBtnDisabled = ref(false)
Expand Down Expand Up @@ -222,7 +222,7 @@ function StartAnalysis(file, ext) {
) {
return zip.files[key].async("string")
} else {
FinishAnalysis("CanFetchLogFile", "(#°Д°)")
FinishAnalysis("FetchLogErr", "(#°Д°)")
return
}
}
Expand Down Expand Up @@ -269,7 +269,7 @@ function LogAnalysis(log) {
"Success",
"32 位 Java 内存分配超过 1 G",
SYSTEM_URL + "#内存问题",
"32 位 Java 内存分配超过 1 G",
"32_Bit_Java_Memory",
)
} else if (
log.includes("Couldn't set pixel format") |
Expand All @@ -278,11 +278,41 @@ function LogAnalysis(log) {
) {
ShowAnalysisResult(
"Success",
"显卡驱动 / 显卡驱动问题",
"显卡 / 显卡驱动问题",
SYSTEM_URL + "#显卡-显卡驱动问题",
"显卡-显卡驱动问题",
"GPU_DRIVER",
)
} else {
} else if (
log.includes("Open J9 is not supported") |
log.includes("OpenJ9 is incompatible") |
log.includes(".J9VMInternals.")
) {
ShowAnalysisResult(
"Success",
"使用了 OpenJ9",
SYSTEM_URL + "#使用-openj9",
"Used_OpenJ9",
)
} else if (
log.includes("Caused by: net.minecraft.util.ResourceLocationException: Non [a-z0-9_.-] character in namespace of location: .DS_Store:") |
log.includes("net.minecraft.util.ResourceLocationException: Non [a-z0-9_.-] character in namespace of location: .DS_Store:")
) {
ShowAnalysisResult(
"Success",
"存在 .DS_Store 文件导致报错",
SYSTEM_URL + "#mac-下存在-ds-store-文件导致报错",
"DS_Store",
)
} else if (
log.search(/java.lang.IllegalStateException: GLFW error before init: [*]Cocoa: Failed to find service port for display/) != -1
) {
ShowAnalysisResult(
"Success",
"Mac 下初始化 OpenGL 窗口问题",
SYSTEM_URL + "#mac-下初始化-opengl-窗口问题",
"Mac_OpenGL_Init",
)
}else {
ShowAnalysisResult(
"Unrecord",
"本工具还未收录您所遇到的错误,请点击下方按钮前往 Github 反馈。",
Expand Down Expand Up @@ -358,12 +388,12 @@ function ShowAnalysisResult(status, msg, result_url, status_msg) {
*/
function FinishAnalysis(status, msg) {
switch (status) {
case "CanFetchLogFile":
case "FetchLogErr":
labelMsg.value = "Zip 文件中不含有有效的 Log 文件"
btnMsg.value = "重新上传"
isBtnDisabled = false
umami.track("Analysis Error", {
Status: "Zip 文件中不含有有效的 Log 文件",
Status: "No_Log_File_In_Zip",
ErrMsg: msg,
})
break
Expand All @@ -373,7 +403,7 @@ function FinishAnalysis(status, msg) {
btnMsg.value = "重新上传"
isBtnDisabled = false
umami.track("Analysis Error", {
Status: "Log 文件读取错误",
Status: "Cannot_Read_Log_File",
ErrMsg: msg,
})
break
Expand All @@ -383,26 +413,32 @@ function FinishAnalysis(status, msg) {
btnMsg.value = "重新上传"
isBtnDisabled = false
umami.track("Analysis Error", {
Status: "日志文件解压错误",
Status: "Cannot_Unzip_Log_File",
ErrMsg: msg,
})
break
case "ErrOpenRstPage":
umami.track("Analysis Error", {
Status: "Cannot_Redirect_To_Resolution",
Launcher: launcher,
})
break
case "Unrecord":
umami.track("Unrecord Crash", {
Status: "Unrecord",
Status: "Unrecord_Crash",
Launcher: launcher,
})
redirectMsg = ref("提交反馈")
redirectMsg.value = "提交反馈"
case "Success":
umami.track("Analysis Finish", {
Status: "Success",
Status: "Analysis_Success",
Launcher: launcher,
CrashReason: msg,
})
break
default:
umami.track("Analysis Error", {
Status: "未知错误",
Status: "Unknown_Error",
Launcher: launcher,
})
break
Expand All @@ -413,7 +449,16 @@ function FinishAnalysis(status, msg) {
* 重定向按钮
*/
function redirectBtnClick() {
window.location.href = redirect_url
if (
redirect_url == "https://github.com/GlobeMC/crashmc.com/issues/new/choose"
) {
window.open(redirect_url)
} else if (redirect_url == null || redirect_url == undefined) {
labelMsg.value = "无法重定向到解决方案页面"
FinishAnalysis("ErrOpenRstPage", redirect_url)
} else {
window.location.href = redirect_url
}
}
</script>

Expand Down
27 changes: 13 additions & 14 deletions docs/client/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ OpenJ9 is incompatible
解释:由于使用了 32 位 Java 且分配了 1G 以上内存,导致游戏无法正常启动。

解决方法:

1. :::warning 注意
此方法仅适用于 64 位系统。
:::
卸载当前 Java ,然后去其他地方重新获取 64 位的 Java。
:::warning 注意
此方法仅适用于 64 位系统。
:::
1. 卸载当前 Java ,然后去其他地方重新获取 64 位的 Java。

:::details 常见的第三方启动器获取 Java 方法
在<LauncherBadge type="bakaxl" text="BakaXL" />启动器设置中获取 Java:前往 `本体设置` -> `Java 虚拟机与内存` ,点击获取对应的 Java 版本。
Expand All @@ -128,15 +127,15 @@ OpenJ9 is incompatible
获取 (Java 9+) 且已存档的 JDK 包: <https://jdk.java.net/archive/>
:::

2. :::warning 注意
不推荐使用此方法,可能会导致游戏卡顿,但 32 位系统只能这么做。
:::
在启动器的内存设置中调整游戏内存分配至小于等于 1G (1G = 1024M)。
:::warning 注意
不推荐使用此方法,可能会导致游戏卡顿,但 32 位系统只能这么做。
:::
2. 在启动器的内存设置中调整游戏内存分配至小于等于 1G (1G = 1024M)。

3. :::warning 注意
需要一定技术基础,适用于 32 位系统,但为 64 位处理器。
:::
自行重装系统为 64 位。你可以使用微软官方提供的重装工具,抑或是使用 `EasyRC 一键重装` 等无捆绑一键重装工具。
:::warning 注意
需要一定技术基础,适用于 32 位系统,但为 64 位处理器。
:::
3.自行重装系统为 64 位。你可以使用微软官方提供的重装工具,抑或是使用 `EasyRC 一键重装` 等无捆绑一键重装工具。

关键词:

Expand All @@ -150,7 +149,7 @@ TO BE COLLECTED

## MacOS 问题

### Mac 下存在 .DS_Store 文件报错
### Mac 下存在 .DS_Store 文件导致报错

```
Caused by: net.minecraft.util.ResourceLocationException: Non [a-z0-9_.-] character in namespace of location: .DS_Store:
Expand Down

0 comments on commit 67fe758

Please sign in to comment.