theflyingape/dankdomain

Won't parse a door.sys file appropriately if EOLs aren't \r\n

realkinetix opened this issue · 1 comments

On my system, linux-based, I was struggling to figure out why I couldn't get values from user[] in main.js. I guess the array wasn't being built properly because lib.js was looking for \r\n in the split.

I modified line 141 to:

$.door = sys_1.fs.readFileSync(user).toString().split('\n');

And that helped, at least parsing the initial arguments it was looking for (comparing userID, GR for graphics mode, etc.). So I suspect there's something missing that helps DD figure out what sort of envionment it's in and how to split up the door.sys file.

Correct, this was added specifically for a BBS sysop with DOS grass roots and he provided me with the game/door-example.sys file -- which is as you note, DOS delimited using '\r\n'.
I am applying a generic fix to allow for either '\r\n' or '\n' using .replace(/\r/g,'') and it works for me before/after applying dos2unix on the example file.