[Cache] Used Utils::Cache

[ci skip]
This commit is contained in:
/dev/root 2016-11-21 11:29:55 +01:00
parent 98d9ad402f
commit d17f287bf2
4 changed files with 14 additions and 13 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, "https://iw4xcachep26muba.onion.to/dlc/IW4.DLC.1.Stimulus.Package.zip", { "mp_complex", "mp_compact", "mp_storm", "mp_overgrown", "mp_crash" } });
Maps::AddDlc({ 2, "https://iw4xcachep26muba.onion.to/dlc/IW4.DLC.2.Resurgence.Pack.zip", { "mp_abandon", "mp_vacant", "mp_trailerpark", "mp_strike", "mp_fuel2" } });
Maps::AddDlc({ 3, "https://iw4xcachep26muba.onion.to/dlc/IW4.DLC.3.Nuketown.zip", { "mp_nuked" } });
Maps::AddDlc({ 4, "https://iw4xcachep26muba.onion.to/dlc/IW4.DLC.4.Classics.1.zip", { "mp_cross_fire", "mp_cargoship", "mp_bloc" } });
Maps::AddDlc({ 5, "https://iw4xcachep26muba.onion.to/dlc/IW4.DLC.5.Classics.2.zip", { "mp_killhouse", "mp_bog_sh" } });
Maps::AddDlc({ 6, "https://iw4xcachep26muba.onion.to/dlc/IW4.DLC.6.Cargoship.Winter.zip", { "mp_cargoship_sh" } });
Maps::AddDlc({ 7, "https://iw4xcachep26muba.onion.to/dlc/IW4.DLC.7.Resurrection.Pack.zip", { "mp_shipment_long", "mp_rust_long", "mp_firingrange" } });
Maps::AddDlc({ 8, "",{ /*"mp_bloc_sh", "mp_crash_tropical", "mp_estate_tropical", "mp_fav_tropical", "mp_storm_spring"*/ } });
Maps::AddDlc({ 1, Utils::Cache("/dlc/IW4.DLC.1.Stimulus.Package.zip").GetUrl(), { "mp_complex", "mp_compact", "mp_storm", "mp_overgrown", "mp_crash" } });
Maps::AddDlc({ 2, Utils::Cache("/dlc/IW4.DLC.2.Resurgence.Pack.zip").GetUrl(), { "mp_abandon", "mp_vacant", "mp_trailerpark", "mp_strike", "mp_fuel2" } });
Maps::AddDlc({ 3, Utils::Cache("/dlc/IW4.DLC.3.Nuketown.zip").GetUrl(), { "mp_nuked" } });
Maps::AddDlc({ 4, Utils::Cache("/dlc/IW4.DLC.4.Classics.1.zip").GetUrl(), { "mp_cross_fire", "mp_cargoship", "mp_bloc" } });
Maps::AddDlc({ 5, Utils::Cache("/dlc/IW4.DLC.5.Classics.2.zip").GetUrl(), { "mp_killhouse", "mp_bog_sh" } });
Maps::AddDlc({ 6, Utils::Cache("/dlc/IW4.DLC.6.Cargoship.Winter.zip").GetUrl(), { "mp_cargoship_sh" } });
Maps::AddDlc({ 7, Utils::Cache("/dlc/IW4.DLC.7.Resurrection.Pack.zip").GetUrl(), { "mp_shipment_long", "mp_rust_long", "mp_firingrange" } });
Maps::AddDlc({ 8, ""/*Utils::Cache("/dlc/").GetUrl()*/,{ /*"mp_bloc_sh", "mp_crash_tropical", "mp_estate_tropical", "mp_fav_tropical", "mp_storm_spring"*/ } });
Maps::UpdateDlcStatus();

View File

@ -73,7 +73,7 @@ namespace Components
void News::CheckForUpdate()
{
std::string caches = Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/caches.xml").setTimeout(5000)->get();
std::string caches = Utils::Cache("/iw4/caches.xml").GetFile();
if (!caches.empty())
{
@ -134,7 +134,7 @@ namespace Components
std::thread([] ()
{
std::string data = Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/updater.exe").setTimeout(5000)->get();
std::string data = Utils::Cache("/iw4/updater.exe").GetFile();
if (data.empty())
{
@ -156,9 +156,9 @@ namespace Components
News::Terminate = false;
News::Thread = std::thread([] ()
{
Localization::Set("MPUI_CHANGELOG_TEXT", Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/changelog.txt").setTimeout(5000)->get());
Localization::Set("MPUI_CHANGELOG_TEXT", Utils::Cache("/iw4/changelog.txt").GetFile());
std::string data = Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/motd.txt").setTimeout(5000)->get();
std::string data = Utils::Cache("/iw4/motd.txt").GetFile();
if (!data.empty())
{

View File

@ -10,7 +10,7 @@ namespace Components
void Node::LoadNodeRemotePreset()
{
std::string nodes = Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/nodes.txt").setTimeout(5000)->get();
std::string nodes = Utils::Cache("/iw4/nodes.txt").GetFile();
if (nodes.empty()) return;
auto nodeList = Utils::String::Explode(nodes, '\n');

View File

@ -49,5 +49,6 @@ namespace Utils
{
return Utils::WebIO(useragent, this->GetUrl(Cache::validUrl, this->Path)).setTimeout(timeout)->get();
}
return "";
}
}