Dezinater / osrscachereader

A Javascript library that allows you to read Old-School Runescape game files
https://dezinater.github.io/osrscachereader/
BSD 2-Clause "Simplified" License
6 stars 2 forks source link

Issue when downloading from OpenRS #3

Closed arvcork closed 7 months ago

arvcork commented 11 months ago

Hi,

I'm trying to use this package to parse the cache to get all items and NPC from the cache, rather than crawling multiple sites.

I have downloaded a cache from OpenRS: https://archive.openrs2.org/caches/runescape/1576 however, when running through the library I get an error:

no such file or directory, open './cache/xteas.json'

I have looked inside of this folder and it doesn't seem to be located in there, am I downloading the wrong kind of cache? 🤔

arvcork commented 11 months ago

Please note: I edited the package and commented this line out and it worked fine. Maybe this doesn't need to throw an error, rather make the user aware?

Dezinater commented 11 months ago

I'm going to add a fix for this in the next release. Xteas are only needed to read map objects so maybe I will have it throw the error there if no xteas were loaded. I think I should also rename it from xtea to keys to keep it consistent with OpenRS. The library should work fine with that error it's just failing to fetch a file.

Also another problem related to this is index 16 is missing from the cache since Jagex decided to not use it anymore it seems. This causes a similar error as the xteas one. Maybe this should be addressed in the same way where it should only give an error when attempting to access it.

Dezinater commented 7 months ago

I added something to give debug logs in console whenever a file is missing and #6 solves the crash with no xteas