noxworld-dev / opennox

OpenNox main repository.
GNU General Public License v3.0
446 stars 24 forks source link

Ubuntu file names and game data path #613

Open kemsky opened 12 months ago

kemsky commented 12 months ago

I've tried to run it on my ubuntu 22.04. Game starts but in console I see that many files are not found:

...
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/flagwar/flagwar.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/endgame/endgame.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/capflag/capflag.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/freezout/freezout.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/kingdoms/kingdoms.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/flagball/flagball.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/bankshot/bankshot.map: no such file or directory
....

Files are actually in place, but their case differs e.g. game expects flagball.map but actual file can be FlagBall.map.

Another problem is that game overwrites path to game data in config. Initial config has the following line:

game:
  data: '/home/dookie/Downloads/Nox/'

after first run path is replaced with . but it is not correct and next time it wont start.

Evengard commented 12 months ago

As a temporary solution, just change the case of map files and folders to lowercase.

dennwc commented 12 months ago

The client actually attempts to search for upper case match. But what is happening here, I think is that the client lists all maps, lower-cases them and then tries to find the exact match. We should fix it.

But yeah, Evengard is right, the best way to deal with problems like these is to lower-case folder/file names on your end. We should probably make it automatic at some point :thinking:

Evengard commented 12 months ago

Another solution is to wrap the folder listing routines and make them return only lowercased filenames to the engine...

kemsky commented 12 months ago

I've added only one example to this issue, but there are cases when game expects non lower case names. So converting everything to lower will not help. The issue with config can be reproduced if you put it to the nox dir.