beyond-all-reason / bar-lobby

BAR Lobby Client
https://beyond-all-reason.github.io/bar-lobby/
MIT License
33 stars 30 forks source link

Engine, game and AI caching #196

Closed Jazcash closed 1 year ago

Jazcash commented 1 year ago

Currently, we cache maps in MapContentAPI, and we cache game versions in GameContentAPI. We should also add caching for engine content and at the same time add parsed AI info to the cache for both game and engine AIs. Currently, we have the AiContentAPI which has methods for caching and fetching AIs based on engine/game versions, but this info isn't actually saved to disk anywhere and has a small runtime cost any time a new battle is opened. It's also not the cleanest code due the async nature of these methods and they're not being awaited in certain places which can sometimes cause errors like: https://github.com/beyond-all-reason/bar-lobby/issues/134

All content (engine, game and maps) should have content we need from them cached when they are downloaded.