[Download] send base url as part of inforesponse. also set client dvar correctly for downloader.
This commit is contained in:
parent
195f6bb297
commit
579fa0a87c
@ -777,6 +777,8 @@ namespace Components
|
|||||||
Dvar::Register<const char*>("ui_dl_timeLeft", "", Game::dvar_flag::DVAR_FLAG_NONE, "");
|
Dvar::Register<const char*>("ui_dl_timeLeft", "", Game::dvar_flag::DVAR_FLAG_NONE, "");
|
||||||
Dvar::Register<const char*>("ui_dl_progress", "", Game::dvar_flag::DVAR_FLAG_NONE, "");
|
Dvar::Register<const char*>("ui_dl_progress", "", Game::dvar_flag::DVAR_FLAG_NONE, "");
|
||||||
Dvar::Register<const char*>("ui_dl_transRate", "", Game::dvar_flag::DVAR_FLAG_NONE, "");
|
Dvar::Register<const char*>("ui_dl_transRate", "", Game::dvar_flag::DVAR_FLAG_NONE, "");
|
||||||
|
Dvar::Register<bool>("sv_wwwDownload", false, Game::dvar_flag::DVAR_FLAG_DEDISAVED, "Set to true to enable downloading maps/mods from an external server.");
|
||||||
|
Dvar::Register<const char*>("sv_wwwBaseUrl", "", Game::dvar_flag::DVAR_FLAG_DEDISAVED, "Set to the base url for the external map download.");
|
||||||
});
|
});
|
||||||
|
|
||||||
UIScript::Add("mod_download_cancel", [] (UIScript::Token)
|
UIScript::Add("mod_download_cancel", [] (UIScript::Token)
|
||||||
|
@ -370,6 +370,9 @@ namespace Components
|
|||||||
info.set("matchtype", "0");
|
info.set("matchtype", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info.set("wwwDownload", (Dvar::Var("sv_wwwDownload").get<bool>() ? "1" : "0"));
|
||||||
|
info.set("wwwUrl", Dvar::Var("sv_wwwBaseUrl").get<std::string>());
|
||||||
|
|
||||||
Network::SendCommand(address, "infoResponse", "\\" + info.build());
|
Network::SendCommand(address, "infoResponse", "\\" + info.build());
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -393,6 +396,18 @@ namespace Components
|
|||||||
|
|
||||||
std::string mod = Dvar::Var("fs_game").get<std::string>();
|
std::string mod = Dvar::Var("fs_game").get<std::string>();
|
||||||
|
|
||||||
|
// set fast server stuff here so its updated when we go to download stuff
|
||||||
|
if (info.get("wwwDownload") == "1"s)
|
||||||
|
{
|
||||||
|
Dvar::Var("sv_wwwDownload").set(true);
|
||||||
|
Dvar::Var("sv_wwwBaseUrl").set(info.get("wwwUrl"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Dvar::Var("sv_wwwDownload").set(false);
|
||||||
|
Dvar::Var("sv_wwwBaseUrl").set("");
|
||||||
|
}
|
||||||
|
|
||||||
if (info.get("challenge") != Party::Container.challenge)
|
if (info.get("challenge") != Party::Container.challenge)
|
||||||
{
|
{
|
||||||
Party::ConnectError("Invalid join response: Challenge mismatch.");
|
Party::ConnectError("Invalid join response: Challenge mismatch.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user