Newsticker.

This commit is contained in:
momo5502
2015-12-31 00:55:08 +01:00
parent 0d5183b31d
commit b3e904115d
8 changed files with 596 additions and 4 deletions

View File

@ -10,6 +10,7 @@ namespace Components
Loader::Register(new Dvar());
Loader::Register(new Maps());
Loader::Register(new News());
Loader::Register(new Menus());
Loader::Register(new Party());
Loader::Register(new Colors());

View File

@ -22,6 +22,7 @@ namespace Components
#include "Modules\Dvar.hpp"
#include "Modules\Maps.hpp"
#include "Modules\News.hpp"
#include "Modules\Menus.hpp"
#include "Modules\Colors.hpp"
#include "Modules\Logger.hpp"

View File

@ -0,0 +1,24 @@
#include "..\..\STDInclude.hpp"
namespace Components
{
std::string News::Motd;
const char* News::GetMotd()
{
return News::Motd.data();
}
News::News()
{
News::Motd = Utils::WebIO("IW4x", "http://localhost/iw4/motd.txt").Get();
if (!News::Motd.size())
{
News::Motd = "Welcome to ReactIW4x Multiplayer!";
}
// Patch motd setting
Utils::Hook(0x60BF19, News::GetMotd, HOOK_CALL).Install()->Quick();
}
}

View File

@ -0,0 +1,13 @@
namespace Components
{
class News : public Component
{
public:
News();
const char* GetName() { return "News"; };
private:
static std::string Motd;
static const char* GetMotd();
};
}

View File

@ -108,10 +108,6 @@ namespace Components
// Enable commandline arguments
Utils::Hook::Set<BYTE>(0x464AE4, 0xEB);
// MOTD
Utils::Hook::Nop(0x60BF24, 5);
Utils::Hook::Set<char*>(0x4053CB, "Welcome to ReactIW4x Multiplayer!");
// remove limit on IWD file loading
Utils::Hook::Set<BYTE>(0x642BF3, 0xEB);