Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
ApiUtils.h
Go to the documentation of this file.
1#pragma once
2
3#include <IApiUtils.h>
4
5namespace AsaApi
6{
7 class ApiUtils : public IApiUtils
8 {
9 public:
10 ApiUtils() = default;
11
12 ApiUtils(const ApiUtils&) = delete;
13 ApiUtils(ApiUtils&&) = delete;
14 ApiUtils& operator=(const ApiUtils&) = delete;
15 ApiUtils& operator=(ApiUtils&&) = delete;
16
17 ~ApiUtils() override = default;
18
19 UWorld* GetWorld() const override;
20 AShooterGameMode* GetShooterGameMode() const override;
21 ServerStatus GetStatus() const override;
22 UShooterCheatManager* GetCheatManager() const override;
23
24 void SetWorld(UWorld* uworld);
25 void SetShooterGameMode(AShooterGameMode* shooter_game_mode);
26 void SetStatus(ServerStatus status);
27 void SetCheatManager(UShooterCheatManager* cheatmanager);
28
30 void SetPlayerController(AShooterPlayerController* player_controller);
31 void RemovePlayerController(AShooterPlayerController* player_controller);
32
34 void SetMessagingManagerInternal(const FString& forPlugin, std::shared_ptr<MessagingManager> manager) override;
35 void RemoveMessagingManagerInternal(const FString& forPlugin);
37
38 private:
40
41 private:
42 UWorld* u_world_{ nullptr };
48 };
49} // namespace AsaApi
std::unordered_map< const FString, AShooterPlayerController *, FStringHash, FStringEqual > eos_id_map_
Definition ApiUtils.h:46
void SetStatus(ServerStatus status)
Definition ApiUtils.cpp:41
std::shared_ptr< MessagingManager > GetMessagingManagerInternal(const FString &forPlugin) const override
Definition ApiUtils.cpp:124
void SetCheatManager(UShooterCheatManager *cheatmanager)
Definition ApiUtils.cpp:52
ApiUtils(const ApiUtils &)=delete
std::shared_ptr< MessagingManager > ReadApiMessagingManager()
Definition ApiUtils.cpp:185
UShooterCheatManager * GetCheatManager() const override
Returns a point to URCON CheatManager.
Definition ApiUtils.cpp:119
ApiUtils(ApiUtils &&)=delete
ApiUtils()=default
void CheckMessagingManagersRequirements()
Definition ApiUtils.cpp:155
AShooterPlayerController * FindPlayerFromEOSID_Internal(const FString &eos_id) const override
Definition ApiUtils.cpp:83
AShooterGameMode * GetShooterGameMode() const override
Returns a pointer to AShooterGameMode.
Definition ApiUtils.cpp:34
ApiUtils & operator=(const ApiUtils &)=delete
void SetShooterGameMode(AShooterGameMode *shooter_game_mode)
Definition ApiUtils.cpp:29
void RemoveMessagingManagerInternal(const FString &forPlugin)
Definition ApiUtils.cpp:147
ApiUtils & operator=(ApiUtils &&)=delete
AShooterGameMode * shooter_game_mode_
Definition ApiUtils.h:43
UWorld * GetWorld() const override
Returns a pointer to UWorld.
Definition ApiUtils.cpp:22
void SetMessagingManagerInternal(const FString &forPlugin, std::shared_ptr< MessagingManager > manager) override
Definition ApiUtils.cpp:135
ServerStatus GetStatus() const override
Returns the current server status.
Definition ApiUtils.cpp:46
ServerStatus status_
Definition ApiUtils.h:44
void SetPlayerController(AShooterPlayerController *player_controller)
Definition ApiUtils.cpp:57
UWorld * u_world_
Definition ApiUtils.h:42
void RemovePlayerController(AShooterPlayerController *player_controller)
Definition ApiUtils.cpp:70
~ApiUtils() override=default
void SetWorld(UWorld *uworld)
Definition ApiUtils.cpp:13
UShooterCheatManager * cheatmanager_
Definition ApiUtils.h:45
static FORCEINLINE FString GetEOSIDFromController(AController *controller)
Returns EOS ID from player controller.
UE_NODISCARD FORCEINLINE bool IsEmpty() const
Messaging manager. Allows to send server messages, notifications and chat messages.
IApiUtils & GetApiUtils()
Definition ApiUtils.cpp:206
Definition json.hpp:4518
TArray< TWeakObjectPtr< APlayerController >, TSizedDefaultAllocator< 32 > > & PlayerControllerListField()
Definition GameMode.h:516