forked from organicmaps/organicmaps
Different metaservers for versions with and without search
This commit is contained in:
parent
899a84a17e
commit
d580053405
3 changed files with 23 additions and 12 deletions
|
@ -31,12 +31,4 @@
|
|||
/// How many langs we're supporting on indexing stage
|
||||
#define MAX_SUPPORTED_LANGUAGES 64
|
||||
|
||||
#ifdef OMIM_PRODUCTION
|
||||
#define URL_SERVERS_LIST "http://active.servers.url"
|
||||
#define DEFAULT_SERVERS_JSON "[\"http://1st.default.server/\",\"http://2nd.default.server/\",\"http://3rd.default.server/\"]"
|
||||
#else
|
||||
#define URL_SERVERS_LIST "http://metaserver-dev.mapswithme.com/server_data/active_servers"
|
||||
#define DEFAULT_SERVERS_JSON "[\"http://svobodu404popugajam.mapswithme.com:34568/maps/\",\"http://svobodu404popugajam.mapswithme.com:34568/maps/\"]"
|
||||
#endif
|
||||
|
||||
#define REDBUTTON_SERVER_URL "http://redbutton.mapswithme.com/enable_search_banner"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "../std/utility.hpp"
|
||||
#include "../std/function.hpp"
|
||||
|
||||
#include "../defines.hpp"
|
||||
|
||||
DECLARE_EXCEPTION(FileAbsentException, RootException);
|
||||
DECLARE_EXCEPTION(NotImplementedException, RootException);
|
||||
|
@ -128,9 +129,27 @@ public:
|
|||
|
||||
string UniqueClientId() const;
|
||||
|
||||
/// @return true for "search" feature on full ios and desktop versions,
|
||||
/// and false for ios lite version
|
||||
/// @return true for "search" feature if app needs search functionality
|
||||
bool IsFeatureSupported(string const & feature) const;
|
||||
|
||||
/// @return url for clients to download maps
|
||||
/// Different urls are returned for versions with and without search support
|
||||
inline string MetaServerUrl() const
|
||||
{
|
||||
if (IsFeatureSupported("search"))
|
||||
return "http://active.servers.url";
|
||||
else
|
||||
return "http://active.servers.url";
|
||||
}
|
||||
|
||||
/// @return JSON-encoded list of urls if metaserver is unreachable
|
||||
inline string DefaultUrlsJSON() const
|
||||
{
|
||||
if (IsFeatureSupported("search"))
|
||||
return "[\"http://1st.default.server/\",\"http://2nd.default.server/\",\"http://3rd.default.server/\"]";
|
||||
else
|
||||
return "[\"http://1st.default.server/\",\"http://2nd.default.server/\",\"http://3rd.default.server/\"]";
|
||||
}
|
||||
};
|
||||
|
||||
extern "C" Platform & GetPlatform();
|
||||
|
|
|
@ -202,7 +202,7 @@ namespace storage
|
|||
{
|
||||
// send Country name for statistics
|
||||
string const postBody = it->m_fileName;
|
||||
m_request.reset(HttpRequest::PostJson(URL_SERVERS_LIST,
|
||||
m_request.reset(HttpRequest::PostJson(GetPlatform().MetaServerUrl(),
|
||||
postBody,
|
||||
bind(&Storage::OnServerListDownloaded, this, _1)));
|
||||
|
||||
|
@ -465,7 +465,7 @@ namespace storage
|
|||
{
|
||||
string serverList;
|
||||
if (!Settings::Get(SETTINGS_SERVERS_KEY, serverList))
|
||||
serverList = DEFAULT_SERVERS_JSON;
|
||||
serverList = GetPlatform().DefaultUrlsJSON();
|
||||
VERIFY(ParseServerList(serverList, urls), ());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue