Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
ApiUtils.h
Go to the documentation of this file.
1#pragma once
2
3#include <IApiUtils.h>
4
5namespace AtlasApi
6{
7 class ApiUtils : public ArkApi::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 ArkApi::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(ArkApi::ServerStatus status);
27 void SetCheatManager(UShooterCheatManager* cheatmanager);
28
29 AShooterPlayerController* FindPlayerFromSteamId_Internal(uint64 steam_id) const override;
30 void SetPlayerController(AShooterPlayerController* player_controller);
31 void RemovePlayerController(AShooterPlayerController* player_controller);
32
33 private:
34 UWorld* u_world_{nullptr};
39 };
40} // namespace AtlasApi
static uint64 GetSteamIdFromController(AController *controller)
Returns Steam ID from player controller.
void SetShooterGameMode(AShooterGameMode *shooter_game_mode)
Definition ApiUtils.cpp:21
ApiUtils(const ApiUtils &)=delete
void SetPlayerController(AShooterPlayerController *player_controller)
Definition ApiUtils.cpp:53
ArkApi::ServerStatus status_
Definition ApiUtils.h:36
AShooterGameMode * shooter_game_mode_
Definition ApiUtils.h:35
void SetWorld(UWorld *uworld)
Definition ApiUtils.cpp:9
ApiUtils & operator=(ApiUtils &&)=delete
void RemovePlayerController(AShooterPlayerController *player_controller)
Definition ApiUtils.cpp:66
void SetStatus(ArkApi::ServerStatus status)
Definition ApiUtils.cpp:33
AShooterGameMode * GetShooterGameMode() const override
Returns a pointer to AShooterGameMode.
Definition ApiUtils.cpp:26
std::unordered_map< uint64, AShooterPlayerController * > steam_id_map_
Definition ApiUtils.h:38
UShooterCheatManager * GetCheatManager() const override
Returns a point to URCON CheatManager.
Definition ApiUtils.cpp:48
~ApiUtils() override=default
ApiUtils & operator=(const ApiUtils &)=delete
ArkApi::ServerStatus GetStatus() const override
Returns the current server status.
Definition ApiUtils.cpp:38
UWorld * u_world_
Definition ApiUtils.h:34
UShooterCheatManager * cheatmanager_
Definition ApiUtils.h:37
AShooterPlayerController * FindPlayerFromSteamId_Internal(uint64 steam_id) const override
Definition ApiUtils.cpp:79
ApiUtils(ApiUtils &&)=delete
UWorld * GetWorld() const override
Returns a pointer to UWorld.
Definition ApiUtils.cpp:14
void SetCheatManager(UShooterCheatManager *cheatmanager)
Definition ApiUtils.cpp:43
ArkApi::IApiUtils & GetApiUtils()
Definition ApiUtils.cpp:98