mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 13:53:37 +00:00
[core] Allow overriding map metaserver URL and reset downloader cache
- Add custom meta server API. - Implement override. - Add reset hook and implement reset. - Expose reset from Storage. - Let JNI set URL and reset cache. Signed-off-by: NoelClick <dev@noel.click>
This commit is contained in:
committed by
Konstantin Pastbin
parent
b39631fe51
commit
6e7ba078c8
@@ -49,6 +49,11 @@ bool GetFileTypeChecked(std::string const & path, Platform::EFileType & type)
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace
|
||||
{
|
||||
std::string g_customMetaServerUrl;
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
Platform::EError Platform::ErrnoToError()
|
||||
{
|
||||
@@ -150,8 +155,16 @@ std::string Platform::ReadPathForFile(std::string const & file, std::string sear
|
||||
"\nr: ", m_resourcesDir, "\ns: ", m_settingsDir));
|
||||
}
|
||||
|
||||
void Platform::SetCustomMetaServerUrl(std::string const & url)
|
||||
{
|
||||
g_customMetaServerUrl = url;
|
||||
}
|
||||
|
||||
std::string Platform::MetaServerUrl() const
|
||||
{
|
||||
if (!g_customMetaServerUrl.empty())
|
||||
return g_customMetaServerUrl;
|
||||
|
||||
return METASERVER_URL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user