2025-09-05 17:58:49 +08:00
|
|
|
#include <dlfcn.h>
|
2025-03-18 15:12:42 +08:00
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
|
#include <thread>
|
|
|
|
|
|
2025-09-03 19:03:19 +08:00
|
|
|
#include "cracker.hpp"
|
2025-03-18 15:12:42 +08:00
|
|
|
#include "logger.hpp"
|
|
|
|
|
#include "server.hpp"
|
2025-09-05 17:58:49 +08:00
|
|
|
#include "ui/hook.hpp"
|
2025-03-18 15:12:42 +08:00
|
|
|
|
|
|
|
|
void init_logger() {
|
2025-04-01 14:04:19 +08:00
|
|
|
auto my_sink = std::make_shared<net_sink_mt>();
|
|
|
|
|
auto custom_logger = std::make_shared<spdlog::logger>("Cracker", my_sink);
|
|
|
|
|
spdlog::set_default_logger(custom_logger);
|
2025-03-18 15:12:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void start() {
|
|
|
|
|
init_logger();
|
|
|
|
|
SPDLOG_INFO("Cracker loaded !");
|
|
|
|
|
CrackerServer::Start();
|
2025-09-06 14:57:33 +08:00
|
|
|
hook_game_lua_for_ingame_ui();
|
2025-03-18 15:12:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__attribute__((constructor))
|
|
|
|
|
void init() {
|
|
|
|
|
std::thread(start).detach();
|
|
|
|
|
}
|