EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
966 stars 183 forks source link

Player web does not load non-lcf files properly #3241

Open elsemieni opened 1 week ago

elsemieni commented 1 week ago

Tested on player-web-master.

There is an issue related with player-web and projects mixed with LCF and XML (generated with lcf2xml - emu, edb, etc) files.

Let's put a minimal project with a Map0001.emu as inital scenario (with Map0001.lmu deleted). In a normal-nonweb-executable Player is able to load Map0001.emu normally (and if Map0001.lmu exists, it will load Map0001.emu first). However, that's not the scenario at player-web.

For reference this is an extract from the output of gencache regarding Map0001.emu:

"map0001.emu":"Map0001.emu",

Right, if you load the game, the game freezes with the following log on console:

index.js:1 Loading of Map Map0001.lmu failed.
The map was not found.
(Stack trace ommited as it was compilled and seems nonsense, plus the error is quite understandable).

index.js:1 Uncaught 
ErrnoError {name: 'ErrnoError', node: undefined, errno: 44, message: 'FS error', setErrno: ƒ, …} 

This happens in both cases when this is the start map and when you want to transfer player to that map.

If I put Map0001.lmu and Map0001.emu together, gencache generate the following output:

"map0001.emu":"Map0001.emu","map0001.lmu":"Map0001.lmu"

And player-web loads Map0001.lmu instead emu.

The following combination in gencache makes emu maps working, but that's not the ideal scenario:

"map0001.lmu":"Map0001.emu"

@jetrotal and @Ghabry 's told in chat, told that the inverting order of apperance on gencache makes emu map work when both files exist, however, tried that and Player insist to load lmu file instead.

Ghabry commented 1 day ago

Right I think the web player does not fetch the other file extension because this added delay (waiting for the request to fail) but we stopped doing requests for files that are not in the index so could be enabled now.