make it possible to clear file caches

This commit is contained in:
Martin Michelsen
2024-10-05 12:43:38 -07:00
parent 40d8227504
commit 5294a53e1b
6 changed files with 40 additions and 28 deletions
+2 -2
View File
@@ -3027,8 +3027,8 @@ static void on_D7_GC(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
send_command(c, 0xD7, 0x00);
} else {
try {
static FileContentsCache gba_file_cache(300 * 1000 * 1000);
auto f = gba_file_cache.get_or_load("system/gba/" + filename).file;
auto s = c->require_server_state();
auto f = s->gba_files_cache->get_or_load("system/gba/" + filename).file;
send_open_quest_file(c, "", filename, "", 0, QuestFileType::GBA_DEMO, f->data);
} catch (const out_of_range&) {
send_command(c, 0xD7, 0x00);