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 ArkApi
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
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 ArkApi
ApiUtils & operator=(ApiUtils &&)=delete
ApiUtils()=default
void SetCheatManager(UShooterCheatManager *cheatmanager)
Definition ApiUtils.cpp:44
void SetWorld(UWorld *uworld)
Definition ApiUtils.cpp:9
ApiUtils & operator=(const ApiUtils &)=delete
void SetShooterGameMode(AShooterGameMode *shooter_game_mode)
Definition ApiUtils.cpp:21
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:93
UWorld * u_world_
Definition ApiUtils.h:34
ApiUtils(ApiUtils &&)=delete
AShooterGameMode * shooter_game_mode_
Definition ApiUtils.h:35
AShooterGameMode * GetShooterGameMode() const override
Returns a pointer to AShooterGameMode.
Definition ApiUtils.cpp:26
void RemovePlayerController(AShooterPlayerController *player_controller)
Definition ApiUtils.cpp:62
UShooterCheatManager * cheatmanager_
Definition ApiUtils.h:37
void SetPlayerController(AShooterPlayerController *player_controller)
Definition ApiUtils.cpp:49
ServerStatus GetStatus() const override
Returns the current server status.
Definition ApiUtils.cpp:38
ServerStatus status_
Definition ApiUtils.h:36
AShooterPlayerController * FindPlayerFromSteamId_Internal(uint64 steam_id) const override
Definition ApiUtils.cpp:75
~ApiUtils() override=default
void SetStatus(ServerStatus status)
Definition ApiUtils.cpp:33
UWorld * GetWorld() const override
Returns a pointer to UWorld.
Definition ApiUtils.cpp:14
ApiUtils(const ApiUtils &)=delete
static uint64 GetSteamIdFromController(AController *controller)
Returns Steam ID from player controller.
IApiUtils & GetApiUtils()
Definition ApiUtils.cpp:99