6#include "API/ARK/Ark.h"
21
22
23
24
25
26
27
28 template <
typename Func,
typename... Args>
35
36
37
38
39
40
41
42
43 template <
typename Func,
typename... Args>
50
51
52
53
54
55
56
57
58
59 template <
typename Func,
typename... Args>
61 int execution_counter,
bool async, Args&&... args)
69
70
71
72
73
74
75
76
77
78
79 template <
typename Func,
typename... Args>
81 int execution_counter,
bool async, Args&&... args)
88
89
90
97
98
109 TimerFunc(
const std::chrono::time_point<std::chrono::system_clock>& next_time,
110 std::function<
void()> callback,
111 bool exec_once,
int execution_counter,
int execution_interval,
137 int execution_counter,
bool async,
const FString& identifier,
const FString& moduleName);
FORCEINLINE FString GetDllName()
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_
void DetectPluginChanges()
time_t next_reload_check_
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.
static nlohmann::json ReadSettingsConfig()
void RecurringExecute(const Func &callback, int execution_interval, int execution_counter, bool async, Args &&... args)
Executes function every X seconds.
Timer(const Timer &)=delete
ARK_API void DelayExecuteInternal(const std::function< void()> &callback, int delay_seconds, const FString &identifier="", const FString &moduleName="")
Timer & operator=(Timer &&)=delete
static ARK_API Timer & Get()
ARK_API void UnloadTimerInternal(const FString &identifier)
ARK_API void UnloadTimersFromModule(const FString &moduleName)
void UnloadAllTimers()
Unloads all timers from the caller plugin.
void DelayExecute(const Func &callback, int delay, Args &&... args)
Executes function after X seconds.
void DelayExecute(const FString &identifier, const Func &callback, int delay, Args &&... args)
Executes function after X seconds.
ARK_API void RecurringExecuteInternal(const std::function< void()> &callback, int execution_interval, int execution_counter, bool async, const FString &identifier, const FString &moduleName)
void UnloadTimer(const FString &identifier)
Unloads timer by identifier.
Timer & operator=(const Timer &)=delete
void RecurringExecute(const FString &identifier, const Func &callback, int execution_interval, int execution_counter, bool async, Args &&... args)
Executes function every X seconds.
std::vector< std::shared_ptr< TimerFunc > > timer_funcs_
namespace for Niels Lohmann
TimerFunc(const std::chrono::time_point< std::chrono::system_clock > &next_time, std::function< void()> callback, bool exec_once, int execution_counter, int execution_interval, FString identifier, FString moduleName)
std::function< void()> callback
std::chrono::time_point< std::chrono::system_clock > next_time