diff --git a/src/client/component/motd.cpp b/src/client/component/motd.cpp new file mode 100644 index 00000000..632a0a3c --- /dev/null +++ b/src/client/component/motd.cpp @@ -0,0 +1,37 @@ +#include +#include "loader/component_loader.hpp" + +#include "materials.hpp" + +#include "game/game.hpp" + +#include + +namespace motd +{ + class component final : public component_interface + { + public: + void post_load() override + { + std::thread([] + { + auto data = utils::http::get_data("https://h1.gg/data/motd.png"); + if (data.has_value()) + { + materials::add("motd_image", data.value().buffer); + } + }).detach(); + } + + void post_unpack() override + { + if (game::environment::is_sp()) + { + return; + } + } + }; +} + +REGISTER_COMPONENT(motd::component) \ No newline at end of file