[Cache] Refactored Cache::GetUrl

- renamed GetUrl() to GetStaticUrl()
This commit is contained in:
/dev/root 2016-11-25 14:16:07 +01:00
parent 124e86387b
commit 4254179520
3 changed files with 11 additions and 11 deletions

View File

@ -492,14 +492,14 @@ namespace Components
{
Dvar::Register<bool>("isDlcInstalled_All", false, Game::DVAR_FLAG_USERCREATED | Game::DVAR_FLAG_WRITEPROTECTED, "");
Maps::AddDlc({ 1, Utils::Cache::GetUrl("/dlc/IW4.DLC.1.Stimulus.Package.zip"), { "mp_complex", "mp_compact", "mp_storm", "mp_overgrown", "mp_crash" } });
Maps::AddDlc({ 2, Utils::Cache::GetUrl("/dlc/IW4.DLC.2.Resurgence.Pack.zip"), { "mp_abandon", "mp_vacant", "mp_trailerpark", "mp_strike", "mp_fuel2" } });
Maps::AddDlc({ 3, Utils::Cache::GetUrl("/dlc/IW4.DLC.3.Nuketown.zip"), { "mp_nuked" } });
Maps::AddDlc({ 4, Utils::Cache::GetUrl("/dlc/IW4.DLC.4.Classics.1.zip"), { "mp_cross_fire", "mp_cargoship", "mp_bloc" } });
Maps::AddDlc({ 5, Utils::Cache::GetUrl("/dlc/IW4.DLC.5.Classics.2.zip"), { "mp_killhouse", "mp_bog_sh" } });
Maps::AddDlc({ 6, Utils::Cache::GetUrl("/dlc/IW4.DLC.6.Cargoship.Winter.zip"), { "mp_cargoship_sh" } });
Maps::AddDlc({ 7, Utils::Cache::GetUrl("/dlc/IW4.DLC.7.Resurrection.Pack.zip"), { "mp_shipment_long", "mp_rust_long", "mp_firingrange" } });
Maps::AddDlc({ 8, ""/*Utils::Cache::GetUrl("/dlc/")*/,{ /*"mp_bloc_sh", "mp_crash_tropical", "mp_estate_tropical", "mp_fav_tropical", "mp_storm_spring"*/ } });
Maps::AddDlc({ 1, Utils::Cache::GetStaticUrl("/dlc/IW4.DLC.1.Stimulus.Package.zip"), { "mp_complex", "mp_compact", "mp_storm", "mp_overgrown", "mp_crash" } });
Maps::AddDlc({ 2, Utils::Cache::GetStaticUrl("/dlc/IW4.DLC.2.Resurgence.Pack.zip"), { "mp_abandon", "mp_vacant", "mp_trailerpark", "mp_strike", "mp_fuel2" } });
Maps::AddDlc({ 3, Utils::Cache::GetStaticUrl("/dlc/IW4.DLC.3.Nuketown.zip"), { "mp_nuked" } });
Maps::AddDlc({ 4, Utils::Cache::GetStaticUrl("/dlc/IW4.DLC.4.Classics.1.zip"), { "mp_cross_fire", "mp_cargoship", "mp_bloc" } });
Maps::AddDlc({ 5, Utils::Cache::GetStaticUrl("/dlc/IW4.DLC.5.Classics.2.zip"), { "mp_killhouse", "mp_bog_sh" } });
Maps::AddDlc({ 6, Utils::Cache::GetStaticUrl("/dlc/IW4.DLC.6.Cargoship.Winter.zip"), { "mp_cargoship_sh" } });
Maps::AddDlc({ 7, Utils::Cache::GetStaticUrl("/dlc/IW4.DLC.7.Resurrection.Pack.zip"), { "mp_shipment_long", "mp_rust_long", "mp_firingrange" } });
Maps::AddDlc({ 8, ""/*Utils::Cache::GetStaticUrl("/dlc/")*/,{ /*"mp_bloc_sh", "mp_crash_tropical", "mp_estate_tropical", "mp_fav_tropical", "mp_storm_spring"*/ } });
Maps::UpdateDlcStatus();

View File

@ -12,9 +12,9 @@ namespace Utils
std::string Cache::ValidUrl;
std::mutex Cache::CacheMutex;
std::string Cache::GetUrl(std::string path)
std::string Cache::GetStaticUrl(std::string path)
{
return Cache::Urls[ARRAY_SIZE(Cache::Urls) - 1] + path;
return Cache::Urls[0] + path;
}
std::string Cache::GetUrl(std::string url, std::string path)

View File

@ -3,7 +3,7 @@ namespace Utils
class Cache
{
public:
static std::string GetUrl(std::string path);
static std::string GetStaticUrl(std::string path);
static std::string GetFile(std::string path, int timeout = 5000, std::string useragent = "IW4x");
private: