iw4x-client/src/Components/Modules/News.cpp

29 lines
658 B
C++
Raw Normal View History

#include "STDInclude.hpp"
2015-12-30 18:55:08 -05:00
namespace Components
{
std::string News::Motd;
const char* News::GetMotd()
{
return News::Motd.data();
}
News::News()
{
2016-01-11 18:48:27 -05:00
Localization::Set("MPUI_CHANGELOG_TEXT", "");
2016-01-26 17:56:49 -05:00
News::Motd = Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/motd.txt").SetTimeout(1000)->Get();
2016-01-11 18:48:27 -05:00
2015-12-30 18:55:08 -05:00
if (!News::Motd.size())
{
News::Motd = "Welcome to ReactIW4x Multiplayer!";
}
2016-01-26 17:56:49 -05:00
Localization::Set("MPUI_CHANGELOG_TEXT", Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/changelog.txt").SetTimeout(1000)->Get().data());
2016-01-07 18:59:59 -05:00
2015-12-30 18:55:08 -05:00
// Patch motd setting
Utils::Hook(0x60BF19, News::GetMotd, HOOK_CALL).Install()->Quick();
}
}