Newsticker.
This commit is contained in:
@ -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());
|
||||
|
@ -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"
|
||||
|
24
src/Components/Modules/News.cpp
Normal file
24
src/Components/Modules/News.cpp
Normal 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();
|
||||
}
|
||||
}
|
13
src/Components/Modules/News.hpp
Normal file
13
src/Components/Modules/News.hpp
Normal 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();
|
||||
};
|
||||
}
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user