Kagamia / WzComparerR2

Maplestory online Extractor
MIT License
406 stars 132 forks source link

CMS v199 -> CMST v193 比对到 Roguelike Skill 时出现问题 #226

Closed HikariCalyx closed 1 year ago

HikariCalyx commented 1 year ago

目前确定比对到 Skill\Roguelike\Skill 的时候就会直接报错,从比对报告很难看出来是哪个部分出现了问题,因此Skill往后的只能手动分别打开WZ目录来比对(估计NEXON又搞坏了什么东西 1 2 此问题在多种分支版本的 WzComparerR2 都能重现。

Kagamia commented 1 year ago

root cause: file path too long.

Kagamia commented 1 year ago

新引入的img有非常深的路径,在对比时如果出现图片差异,对比器会拼凑出一个非常长的图片文件名。 目前可以观测到,文件名最长可以超过255或260。

这部分可以简单处理支持long path,但即使正常生成了,可观测到全部浏览器在windows上都没有支持本地长路径文件打开。

最终方案可能是提供选项对全部生成图片文件名强制md5,不维持原有路径,细节还在商榷中。

Kagamia commented 1 year ago

添加了一个选项使所有输出图片文件名为wz路径的md5 hash。

因为浏览器在读取本地文件时不兼容长路径,所以wc生成也没有意义。在没有完美解决方案之前,该方案为最终修复方式。

KENNYSOFT commented 1 year ago

TMS 253 → 254 makes the same problem.

May use \\?\ as https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation ; even using this method, NTFS has a limitation of segment (directory or file) name length to 255, so some truncation is also needed.

Kagamia commented 1 year ago

@KENNYSOFT Yes, actually there're two limitations in this issue:

  1. Filename too long, because we join the entire node path into one string then exceeded the path segment limit.
  2. Even we can save the full file name in UNC path, the browser even doesn't have long path support for local file

I've tried Edge, Chrome and FF, none of them support it. Also tried to serve the output folder as static website with nginx/IIS, still can't do the trick.

wslg+Edge for linux works but poor performance. In theory wsl+nginx may also work, but I don't want to train wcR2 end users on linux skills.

HikariCalyx commented 1 month ago

回顾一下这个问题: 本次 GMS 252 更新在未勾选这个选项时出现了相同的错误。 目前我尝试采取不勾选HashPNGFileName,直接检测总路径的长度来解决这个问题。 如果路径长度过长,就会自动转变成较短的文件名。

https://github.com/HikariCalyx/WzComparerR2-JMS/commit/07770f3d6690a65176d70c34afc9a1602d917412