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

Linux build. Noggit can work only with lowercase named local files. #104

Open
gratural opened this issue Oct 1, 2021 · 7 comments
Open

Comments

@gratural
Copy link

gratural commented Oct 1, 2021

Hello. I'm trying to build a Noggit on the current Manjaro Linux.
It builds (d'oh...how many warnings...) and works wonderful, even faster than on Windows. And the working log file looks are normal.
But I found a problem with local files and folders in the project folder - Noggit see them only when they are named in lower case.
For example: "dbfilesclient/map.dbc"
This problem affects all files and folders: DBC, M2, WMO, BLP and others.
Also, Noggit uses a lowercase path on saving (like "world/maps/azeroth/azeroth.wdt", see attached log)

Files packed in MPQ are loaded normally.

Did I choose something wrong in cmake?
What other files do I need to attach to the message?

log.txt

@ihm-tswow
Copy link
Collaborator

ihm-tswow commented Oct 2, 2021

Paths on linux are case-sensitive, compared to windows where case doesn't matter in pathnames. I find it a bit strange if we default to casing that's different from in the MPQs, but i'm not too familiar exactly with how casing is treated on different locales so there might be a good reason for it.

The short solution is to just use the format that noggit wants in the project path, but I'm not sure if we should start using the casing found in listfiles

@bloerwald
Copy link
Contributor

I find it a bit strange if we default to casing that's different from in the MPQs

BACKSLASHES ARE NOT A THING ON NON-WINDOWS AND UPPERCASE IS HARDER TO READ ALL THE TIME, AT LEAST IMHO.

That’s why I chose lower/.

I think there was at least a try to also search case insensitively, but I guess that’s broken or gone or missing somewhere.

@ihm-tswow
Copy link
Collaborator

i just thought it might break mpq folder tools, but I wouldn't even bother changing it if it doesn't break the client. I haven't really tried it

@bloerwald
Copy link
Contributor

It should break neither (unless they have an issue like the one we have). The fun part is that even blizzard uses the same path with different letter cases, so there is no correct one, and one model may be able to load a texture and another won’t, even though the normalized path is the same.

The bug here is not searching case insensitively independent of file system. This does not happen in the wow client (iirc), and if it happens in some other tool as well, file a big there, don’t try to fix it by renaming files.

The correct resolution to this ticket is to normalize filenames at all points, and treating A/ and a/ the same when accessing disk. This will slow down accesses of course, but that’s not possible to work around (except for caching which will always be “broken” for an editor since people expect to drop in and be able to use without reload. Wow local Manifest does exactly this.)

@gratural
Copy link
Author

Update. I didn't want to use lowcase file links and solved this trouble by commenting out the ::tolower and ::toupper calls in normalized_filename from MPQ.cpp.
What are they even for?

@bloerwald
Copy link
Contributor

In blizzard’s world, World/ and WORLD/ are the same. That’s annoying but not really an issue until you have two references to the same file disagreeing and you need to check for duplicates, or when you have the listfile using one variant and the ADT using another. By normalizing, duplicates are trivial, and the case of disagreeing references does no longer exist. I’m your case, you can have two files on disk and it is impossible for noggit to differ between them: the OS says they are different files, the ADT references them by yet another casing, and which one should it pick now?

Everything being lower case is annoying on extracting files, but only then. Not having normalization is more annoying, believe me.

@gratural
Copy link
Author

And not only on extracting.
Also using lowercase files will cause a lot of troubles on the server. (If he is on Linux. That is, in 99% of cases).

From Trinity:
mpqFileName = Trinity::StringFormat("World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y);

DBCFile dbc("DBFilesClient\\GameObjectDisplayInfo.dbc");

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

No branches or pull requests

3 participants