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

修正 Image 消息中 path 的含义 #409

Merged
merged 3 commits into from
Aug 9, 2021
Merged

Conversation

Wybxc
Copy link
Contributor

@Wybxc Wybxc commented Jul 18, 2021

我写的应该没错吧……

目前修改为:路径相对于 JVM 工作路径(默认是当前路径,可通过 -Duser.dir=...指定),也可传入绝对路径。。

我写的应该没错吧……
@ryoii
Copy link
Collaborator

ryoii commented Jul 19, 2021

我也不太清楚,我有空测试一下先

@Mister-Hope
Copy link

我现在也很困扰,我放在文档中的目录下是不生效的。

@Wybxc
Copy link
Contributor Author

Wybxc commented Jul 29, 2021

我现在也很困扰,我放在文档中的目录下是不生效的。

所以干脆用绝对路径吧

@Mister-Hope
Copy link

我有在多平台下运行的需求,所以我没法用绝对路径

@Mister-Hope
Copy link

请问一下你的console的路径指的具体是哪个文件夹?console对于mcl来说在lib下。我现在已经整个项目快贴满了我的测试图片仍然找不到

@Wybxc
Copy link
Contributor Author

Wybxc commented Jul 29, 2021

请问一下你的console的路径指的具体是哪个文件夹?console对于mcl来说在lib下。我现在已经整个项目快贴满了我的测试图片仍然找不到

我用的是 Windows 下的 MCL,应该是 libs 的上一级目录

@Wybxc
Copy link
Contributor Author

Wybxc commented Jul 29, 2021

请问一下你的console的路径指的具体是哪个文件夹?console对于mcl来说在lib下。我现在已经整个项目快贴满了我的测试图片仍然找不到

也可能是 miral-console 启动时的命令行当前路径

@Mister-Hope
Copy link

那你的PR描述显然有问题,应该描述为 mirai-console-loader (MCL) 的路径。

@Wybxc
Copy link
Contributor Author

Wybxc commented Jul 29, 2021

那你的PR描述显然有问题,应该描述为 mirai-console-loader (MCL) 的路径。

我再测试一下,之后修改

@Mister-Hope
Copy link

感谢,我在mcl目录下直接启动,图片在这个文件夹下有效了!!!!!至少可以暂时解决问题。

@Mister-Hope
Copy link

期待你的进一步测试和PR完善。😉

@ArcticLampyrid
Copy link

个人认为应该通过修改mah代码符合原描述,才是解决问题
该目录不应该和mclworking dir强关联

@Mister-Hope
Copy link

话是这么说没错,但是我觉得先把文档改了并注明这是个bug也是好的。

@Wybxc
Copy link
Contributor Author

Wybxc commented Aug 1, 2021

翻了翻 mah 和 mirai 的源码,有了一个初步推断:

mah 没有对传入的 path 作检测和改动,直接传递给 mirai-core,mirai-core 会把路径构造为 java.io.File。

这样一来,相对路径应该是相对于 mirai-core 的当前目录,也就是在命令行启动 mirai-console 时的当前目录。

(本来想通过在其他目录启动 mcl 进行测试的,但是 mcl 不支持在其他目录启动,于是只能作罢。)

目前已经修改为:路径相对于 mirai-console 启动时的命令行当前路径,也可传入绝对路径。

@ryoii
Copy link
Collaborator

ryoii commented Aug 6, 2021

如果不是通过MCL,而是直接启动 Console,这个结论也成立吗

@Wybxc
Copy link
Contributor Author

Wybxc commented Aug 7, 2021

今天再次测试。
已经确定相对路径会基于 mirai-console 启动时的命令行当前路径。

顺便发现了 mirai-console 的一个问题:过于依赖当前路径。mirai-console 只会在当前路径寻找配置文件,换一个路径启动就要把 data plugins 这些复制一遍。

按照#394的方法重新测试。
目前的结果是:相对路径基于 JVM 参数 -Duser.dir= 指定的工作路径,默认是命令行当前路径。

@Wybxc
Copy link
Contributor Author

Wybxc commented Aug 7, 2021

目前修改为:路径相对于 JVM 工作路径(默认是当前路径,可通过 -Duser.dir=...指定),也可传入绝对路径。

@ryoii ryoii merged commit 117e259 into project-mirai:master Aug 9, 2021
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.

None yet

4 participants