Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
AtlasBaseApi.h
Go to the documentation of this file.
1#pragma once
2
3#include "../IBaseApi.h"
4
5#include <IApiUtils.h>
6
7namespace API
8{
9 class AtlasBaseApi : public IBaseApi
10 {
11 public:
13 ~AtlasBaseApi() override = default;
14
15 bool Init() override;
16 float GetVersion() override;
17 std::string GetApiName() override;
18 void RegisterCommands() override;
19
20 std::unique_ptr<ArkApi::ICommands>& GetCommands() override;
21 std::unique_ptr<ArkApi::IHooks>& GetHooks() override;
22 std::unique_ptr<ArkApi::IApiUtils>& GetApiUtils() override;
23
24 private:
25 // Callbacks
26 static FString LoadPlugin(FString* cmd);
27 static FString UnloadPlugin(FString* cmd);
28
29 static void LoadPluginCmd(APlayerController* /*player_controller*/, FString* /*cmd*/, bool /*unused*/);
30 static void UnloadPluginCmd(APlayerController* /*player_controller*/, FString* /*cmd*/, bool /*unused*/);
31
32 static void LoadPluginRcon(RCONClientConnection* /*rcon_connection*/, RCONPacket* /*rcon_packet*/,
33 UWorld* /*unused*/);
34 static void UnloadPluginRcon(RCONClientConnection* /*rcon_connection*/, RCONPacket* /*rcon_packet*/,
35 UWorld* /*unused*/);
36
38 std::unique_ptr<ArkApi::IHooks> hooks_;
40 };
41} // namespace API
static void UnloadPluginCmd(APlayerController *, FString *, bool)
std::unique_ptr< ArkApi::ICommands > commands_
static FString LoadPlugin(FString *cmd)
std::unique_ptr< ArkApi::IApiUtils > api_utils_
std::unique_ptr< ArkApi::ICommands > & GetCommands() override
std::unique_ptr< ArkApi::IHooks > & GetHooks() override
static void LoadPluginRcon(RCONClientConnection *, RCONPacket *, UWorld *)
void RegisterCommands() override
std::unique_ptr< ArkApi::IApiUtils > & GetApiUtils() override
bool Init() override
std::unique_ptr< ArkApi::IHooks > hooks_
static void LoadPluginCmd(APlayerController *, FString *, bool)
static FString UnloadPlugin(FString *cmd)
float GetVersion() override
static void UnloadPluginRcon(RCONClientConnection *, RCONPacket *, UWorld *)
std::string GetApiName() override
~AtlasBaseApi() override=default
static PluginManager & Get()
std::shared_ptr< Plugin > & LoadPlugin(const std::string &plugin_name) noexcept(false)
Load plugin by it's name.
void UnloadPlugin(const std::string &plugin_name) noexcept(false)
Unload plugin by it's name. Plugin must free all used resources.
virtual void AddRconCommand(const FString &command, const std::function< void(RCONClientConnection *, RCONPacket *, UWorld *)> &callback)=0
Adds a rcon command.
virtual void AddConsoleCommand(const FString &command, const std::function< void(APlayerController *, FString *, bool)> &callback)=0
Adds a console command.
static const FColor Green
Definition ColorList.h:13
FORCEINLINE const TCHAR * operator*() const
Definition FString.h:282
Definition IBaseApi.h:9
ARK_API std::string GetCurrentDir()
Definition Tools.cpp:7
ARK_API std::wstring Utf8Decode(const std::string &str)
Converts an UTF8 string to a wide Unicode String.
Definition Tools.cpp:56
IApiUtils & GetApiUtils()
Definition ApiUtils.cpp:99
void InitHooks()
Definition HooksImpl.cpp:28
Definition json.hpp:4518
void SendMessageW(int Id, int Type, FString *OutGoingMessage)
Definition Other.h:122
int Id
Definition Other.h:129
FString Body
Definition Other.h:131