6#include <unordered_map>
22 bool SetHookInternal(
const std::string& func_name, LPVOID detour, LPVOID* original)
override;
24 bool DisableHook(
const std::string& func_name, LPVOID detour)
override;
29 Hook(LPVOID target, LPVOID detour, LPVOID* original)
static void SetServerID(RCONClientConnection *, RCONPacket *, UWorld *)
std::string GetApiName() override
bool DownloadCacheFiles(const std::filesystem::path downloadFile, const std::filesystem::path localFile)
std::unique_ptr< AsaApi::IApiUtils > & GetApiUtils() override
static void LoadPluginCmd(APlayerController *, FString *, bool)
std::unique_ptr< AsaApi::ICommands > commands_
void RegisterCommands() override
float GetVersion() override
~ArkBaseApi() override=default
static FString LoadPlugin(FString *cmd)
static void UnloadPluginRcon(RCONClientConnection *, RCONPacket *, UWorld *)
nlohmann::json GetConfig()
std::unique_ptr< AsaApi::IApiUtils > api_utils_
static void UnloadPluginCmd(APlayerController *, FString *, bool)
static void LoadPluginRcon(RCONClientConnection *, RCONPacket *, UWorld *)
static FString UnloadPlugin(FString *cmd)
std::unique_ptr< AsaApi::ICommands > & GetCommands() override
std::unique_ptr< AsaApi::IHooks > & GetHooks() override
std::unique_ptr< AsaApi::IHooks > hooks_
Hooks(const Hooks &)=delete
Hooks & operator=(const Hooks &)=delete
std::unordered_map< std::string, std::vector< std::shared_ptr< Hook > > > all_hooks_
~Hooks() override=default
Hooks & operator=(Hooks &&)=delete
bool DisableHook(const std::string &func_name, LPVOID detour) override
Removes a hook from a function.
bool SetHookInternal(const std::string &func_name, LPVOID detour, LPVOID *original) override
std::vector< std::shared_ptr< Plugin > > loaded_plugins_
void CheckPluginsDependencies()
std::vector< std::shared_ptr< Plugin > >::const_iterator FindPlugin(const std::string &plugin_name)
Find plugin by it's name.
bool save_world_before_reload_
PluginManager & operator=(const PluginManager &)=delete
void DetectPluginChanges()
time_t next_reload_check_
PluginManager(const PluginManager &)=delete
PluginManager(PluginManager &&)=delete
void LoadAllPlugins()
Find and load all plugins.
static PluginManager & Get()
static nlohmann::json ReadPluginInfo(const std::string &plugin_name)
bool enable_plugin_reload_
bool IsPluginLoaded(const std::string &plugin_name)
Returns true if plugin was loaded, false otherwise.
std::shared_ptr< Plugin > & LoadPlugin(const std::string &plugin_name) noexcept(false)
Load plugin by it's name.
static void DetectPluginChangesTimerCallback()
Checks for auto plugin reloads.
int reload_sleep_seconds_
void UnloadPlugin(const std::string &plugin_name) noexcept(false)
Unload plugin by it's name. Plugin must free all used resources.
PluginManager & operator=(PluginManager &&)=delete
static nlohmann::json ReadSettingsConfig()
static const FColor Green
UE_NODISCARD FORCEINLINE const TCHAR * operator*() const UE_LIFETIMEBOUND
constexpr float api_version
IApiUtils & GetApiUtils()
Hook(LPVOID target, LPVOID detour, LPVOID *original)
std::vector< std::string > dependencies
Plugin(HINSTANCE h_module, std::string name, std::string full_name, std::string description, float version, float min_api_version, std::vector< std::string > dependencies)
void SendMessageW(int Id, int Type, FString *OutGoingMessage)