thomas-crane / nrelay

A console based modular client for Realm of the Mad God built with Node.js and TypeScript.
https://nrelay.net/
MIT License
40 stars 21 forks source link

Make char-info.cache usage optional #50

Open RedKage opened 4 years ago

RedKage commented 4 years ago

Hello,

The file char-info.cache.json is used everytime account-service.getCharacterInfo() is executed. This make the actual API call to /char/list to not occur when the cache exists.

This can be an issue: to load properly the daily reward calendar (at /dailyLogin/fetchCalendar, we need to first hit /char/list or else the calendar XML is not refreshed.

Feature request: Adding a command line switch to disable the use and creation of char-info.cache.json. Something like --disable-char-info-cache

In my use case, for each account, this would really hit the /char/list endpoint and then I would get an updated daily reward XML on the /dailyLogin/fetchCalendar endpoint.

Right now, what I'll do is rm the file before launching nrelay. And that's not super cool :D

thomas-crane commented 4 years ago

I think this is a cool idea. This should also provide a good way for people to circumvent occasional problems with the char list cache without having to delete the cache. Since the server list is also fetched from the same endpoint, it probably makes more sense to just have a general --no-cache flag.