HMCL-dev / HMCL-dev/HMCL

[Feature] 对于Windows平台 添加游戏文件夹的 路径 字符数量 不得小于4

Open
#4,106 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
10.1k
Forks
934
Avg merge
1d 5h
Merged PRs (30d)
82

Description

概述 | Summary

对于Windows平台 添加游戏文件夹的路径字符不得小于4
就是禁止让用户将游戏目录设置在某个分区的根目录下 例如X:\

原因 | Reason
[01:42:12] [@.task.AsyncTaskExecutor.lambda$executeNormalTask$31/TRACE] Task failed: 导出整合包
java.nio.file.AccessDeniedException: F:\Config.Msi
	at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsDirectoryStream.<init>(Unknown Source)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(Unknown Source)
	at java.base/java.nio.file.Files.newDirectoryStream(Unknown Source)
	at java.base/java.nio.file.FileTreeWalker.visit(Unknown Source)
	at java.base/java.nio.file.FileTreeWalker.next(Unknown Source)
	at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
	at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
	at org.jackhuang.hmcl.util.io.Zipper.putDirectory(Zipper.java:89)
	at org.jackhuang.hmcl.mod.mcbbs.McbbsModpackExportTask.execute(McbbsModpackExportTask.java:72)
	at org.jackhuang.hmcl.task.AsyncTaskExecutor.lambda$executeNormalTask$22(AsyncTaskExecutor.java:244)
	at org.jackhuang.hmcl.util.Lang.lambda$wrap$2(Lang.java:291)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

这个问题很搞死人的

详情 | Description

至于用户操作逻辑是从Dialog那添加检测 或者是确认添加后检查若不符合要求则弹出无效路径请重新选择
看你们的选择了

或者是添加进去的路径,进行一次解析,比如说把那些变量自动替换成正确的,然后解析完毕之后再判断

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the game-folder add flow from its dialog, then compare it with the export path shown in McbbsModpackExportTask.execute and Zipper.putDirectory. Determine where path normalization and validation belong, and verify that a Windows drive root is rejected while a valid game directory is accepted before export.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.