| 103 | } |
| 104 | |
| 105 | bool ScriptInstance::LoadCompatibilityScript(std::string_view api_version, Subdirectory dir) |
| 106 | { |
| 107 | std::string script_name = fmt::format("compat_{}.nut", api_version); |
| 108 | |
| 109 | for (Searchpath sp : _valid_searchpaths) { |
| 110 | std::string buf = FioGetDirectory(sp, dir); |
| 111 | buf += script_name; |
| 112 | if (!FileExists(buf)) continue; |
| 113 | |
| 114 | if (this->engine->LoadScript(buf)) return true; |
| 115 | |
| 116 | ScriptLog::Error(fmt::format("Failed to load API compatibility script for {}", api_version)); |
| 117 | Debug(script, 0, "Error compiling / running API compatibility script: {}", buf); |
| 118 | return false; |
| 119 | } |
| 120 | |
| 121 | ScriptLog::Warning(fmt::format("API compatibility script for {} not found", api_version)); |
| 122 | return true; |
| 123 | } |
| 124 | |
| 125 | bool ScriptInstance::LoadCompatibilityScripts(Subdirectory dir, std::span<const std::string_view> api_versions) |
| 126 | { |
no test coverage detected