MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / load_plugin_version_cache_file

Method load_plugin_version_cache_file

plugin_manager/plugin_manager.cpp:583–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581}
582
583void PluginManager::load_plugin_version_cache_file(const String &cache_file, bool p_static_cached) {
584 // this works with both the static and dynamic cache files
585 auto file = FileAccess::open(cache_file, FileAccess::READ);
586 if (file.is_null()) {
587 ERR_PRINT("Failed to open plugin version cache file!");
588 return;
589 }
590
591 String json = file->get_as_text();
592 Dictionary data = JSON::parse_string(json);
593
594 MutexLock lock(plugin_version_cache_mutex);
595 for (auto &E : data.keys()) {
596 Dictionary version_data = data[E];
597 PluginVersion version = PluginVersion::from_json(version_data);
598 if (version.is_valid()) {
599 version.is_static_cached = p_static_cached;
600 String cache_key = version.release_info.get_cache_key();
601 plugin_version_cache[cache_key] = version;
602 }
603 }
604}
605
606void PluginManager::save_plugin_version_cache() {
607 String cache_dir = get_plugin_cache_path().path_join("plugin_versions");

Callers

nothing calls this directly

Calls 4

from_jsonFunction · 0.85
get_as_textMethod · 0.80
get_cache_keyMethod · 0.80
is_validMethod · 0.45

Tested by

no test coverage detected