Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable HMCL to export jstack dump file 让 HMCL 能够导出游戏运行栈文件 #2582

Merged
merged 26 commits into from
Jan 8, 2024

Conversation

burningtnt
Copy link
Member

#2200

} else {
exportDumpButton.setText(i18n("logwindow.export_dump.no_dependency.button"));
exportDumpButton.setTooltip(new Tooltip(i18n("logwindow.export_dump.no_dependency.tooltip")));
exportDumpButton.setButtonType(JFXButton.ButtonType.RAISED);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么不支持的时候反而是 RAISED 的?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

抱歉,想写 setDisabled 的,写错了

@@ -20,6 +20,7 @@ subprojects {
}
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://libraries.minecraft.net")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

什么库需要libraries.minecraft.net?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(?应该是当时的代码遗留,抱歉

@huanghongxun
Copy link
Collaborator

不明觉厉

@burningtnt
Copy link
Member Author

……

@burningtnt
Copy link
Member Author

burningtnt commented Dec 31, 2023

是 BCIG 库(依赖 Mojang Brigadier)…… 最开始引入于 SimpleWEBP,用于支持不同 JavaFX 版本(后来就拉进来了)
那段 BCII(就是传给 @BytecodeImpl)的 String[],是让 BCIG 生成一个 getPID 的调用

@huanghongxun
Copy link
Collaborator

这个库不是已经替换成你自己的名字了么,还需要libraries.minecraft.net?

@burningtnt
Copy link
Member Author

但 Mojang Brigadier 需要从 libraries.minecraft.net 下载

@burningtnt
Copy link
Member Author

修复了一个 Bug,并移除了通过正则隐藏 access token 的方法。转而使用 Logging 中现成的轮子

@huanghongxun huanghongxun merged commit 5d3660f into HMCL-dev:javafx Jan 8, 2024
3 checks passed
@burningtnt burningtnt deleted the threaddump branch January 8, 2024 12:39
half-nothing pushed a commit to half-nothing/HMCL-liteUI that referenced this pull request Jan 11, 2024
)

* Enable HMCL to create game thread dump while game is running

* Fix checkstyle

* Hide accessToken

* Code cleanup

* Code cleanup

* Enhance I18N and declare the charset (UTF-8) of output file

* Inline variables

* Update the modifier of org.jackhuang.hmcl.game.GameDumpCreator#writeDumpHeadTo from public to private

* Refactor

* Add license for GameDumpCreator, remove support for Java 8

* Remove unnecessary Arrays.copyOf

* Fix checkstyle

* Use system charset to read the inputstream from JVM

* opt GameDumpCreator

* retry on failed attach to vm

* update GameDumpCreator

* Opt GameDumpCreator

* Fix

* Include BCIG

* Use BCIG to get PID.

* Fix.

* Fix again.

* Code cleanup. Fix bugs.

---------

Co-authored-by: Glavo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants