diff --git a/defines.hpp b/defines.hpp index 2f33a35c3f..681e991249 100644 --- a/defines.hpp +++ b/defines.hpp @@ -10,7 +10,7 @@ #define COUNTRIES_FILE "countries_poly.txt" #define DATA_UPDATE_FILE "maps.update" #define BINARY_UPDATE_FILE "binary.update" -#define UPDATE_BASE_URL "http://melnichek.ath.cx:34568/maps/" +#define UPDATE_BASE_URL "http://data.mapswithme.com/" #define WORLD_FILE_NAME "World" diff --git a/storage/country.cpp b/storage/country.cpp index 5a0dfefdc7..7ab0572da4 100644 --- a/storage/country.cpp +++ b/storage/country.cpp @@ -16,7 +16,7 @@ #include "../indexer/data_header.hpp" #include "../std/fstream.hpp" - +#include "../std/ctime.hpp" namespace storage { @@ -163,7 +163,12 @@ namespace storage { FileWriter writer(file); stream::SinkWriterStream wStream(writer); - wStream << static_cast(Version::BUILD); + + // save version - it's equal to current date in GMT + time_t rawTime = time(NULL); + tm * pTm = gmtime(&rawTime); + uint32_t const version = (pTm->tm_year - 100) * 10000 + (pTm->tm_mon + 1) * 100 + pTm->tm_mday; + wStream << static_cast(version); wStream << level; wStream << cellFiles; wStream << commonFiles; diff --git a/storage/storage.cpp b/storage/storage.cpp index 03864ddb93..2cff14c088 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -14,6 +14,7 @@ #include "../std/set.hpp" #include "../std/algorithm.hpp" +#include "../std/target_os.hpp" #include @@ -74,7 +75,7 @@ namespace storage string Storage::UpdateBaseUrl() const { - return UPDATE_BASE_URL + utils::to_string(m_currentVersion) + "/"; + return UPDATE_BASE_URL OMIM_OS_NAME "/" + utils::to_string(m_currentVersion) + "/"; } TCountriesContainer const & NodeFromIndex(TCountriesContainer const & root, TIndex const & index)