Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
AtlasApi::ApiUtils Class Reference

#include <ApiUtils.h>

+ Inheritance diagram for AtlasApi::ApiUtils:
+ Collaboration diagram for AtlasApi::ApiUtils:

Public Member Functions

 ApiUtils ()=default
 
 ApiUtils (const ApiUtils &)=delete
 
 ApiUtils (ApiUtils &&)=delete
 
ApiUtilsoperator= (const ApiUtils &)=delete
 
ApiUtilsoperator= (ApiUtils &&)=delete
 
 ~ApiUtils () override=default
 
UWorldGetWorld () const override
 Returns a pointer to UWorld.
 
AShooterGameModeGetShooterGameMode () const override
 Returns a pointer to AShooterGameMode.
 
ArkApi::ServerStatus GetStatus () const override
 Returns the current server status.
 
UShooterCheatManagerGetCheatManager () const override
 Returns a point to URCON CheatManager.
 
void SetWorld (UWorld *uworld)
 
void SetShooterGameMode (AShooterGameMode *shooter_game_mode)
 
void SetStatus (ArkApi::ServerStatus status)
 
void SetCheatManager (UShooterCheatManager *cheatmanager)
 
AShooterPlayerControllerFindPlayerFromSteamId_Internal (uint64 steam_id) const override
 
void SetPlayerController (AShooterPlayerController *player_controller)
 
void RemovePlayerController (AShooterPlayerController *player_controller)
 
- Public Member Functions inherited from ArkApi::IApiUtils
virtual ~IApiUtils ()=default
 
template<typename T , typename... Args>
void SendServerMessage (AShooterPlayerController *player_controller, FLinearColor msg_color, const T *msg, Args &&... args)
 Sends server message to the specific player. Using fmt::format.
 
template<typename T , typename... Args>
void SendNotification (AShooterPlayerController *player_controller, FLinearColor color, float display_scale, float display_time, UTexture2D *icon, const T *msg, Args &&... args)
 Sends notification (on-screen message) to the specific player. Using fmt::format.
 
template<typename T , typename... Args>
void SendChatMessage (AShooterPlayerController *player_controller, const FString &sender_name, const T *msg, Args &&... args)
 Sends chat message to the specific player. Using fmt::format.
 
template<typename T , typename... Args>
void SendServerMessageToAll (FLinearColor msg_color, const T *msg, Args &&... args)
 Sends server message to all players. Using fmt::format.
 
template<typename T , typename... Args>
void SendNotificationToAll (FLinearColor color, float display_scale, float display_time, UTexture2D *icon, const T *msg, Args &&... args)
 Sends notification (on-screen message) to all players. Using fmt::format.
 
template<typename T , typename... Args>
void SendChatMessageToAll (const FString &sender_name, const T *msg, Args &&... args)
 Sends chat message to all players. Using fmt::format.
 
AShooterPlayerControllerFindPlayerFromSteamName (const FString &steam_name) const
 Finds player from the given steam name.
 
AShooterPlayerControllerFindControllerFromCharacter (AShooterCharacter *character) const
 Finds player controller from the given player character.
 
TArray< AShooterPlayerController * > FindPlayerFromCharacterName (const FString &character_name, ESearchCase::Type search, bool full_match) const
 Finds all matching players from the given character name.
 
AShooterPlayerControllerFindPlayerFromSteamId (uint64 steam_id) const
 Finds player from the given steam id.
 
APrimalDinoCharacterSpawnDino (AShooterPlayerController *player, FString blueprint, FVector *location, int lvl, bool force_tame, bool neutered) const
 Spawns a dino near player or at specific coordinates.
 
uint64 GetSteamIDForPlayerID (int player_id) const
 
AShooterGameStateGetGameState ()
 Get Shooter Game State.
 
UPrimalGameDataGetGameData ()
 Returns pointer to Primal Game Data.
 
TArray< AActor * > GetAllActorsInRange (FVector location, float radius, EServerOctreeGroup::Type ActorType)
 Gets all actors in radius at location.
 
TArray< AActor * > GetAllActorsInRange (FVector location, float radius, EServerOctreeGroup::Type ActorType, TArray< AActor * > ignores)
 Gets all actors in radius at location, with ignore actors.
 
virtual ~IApiUtils ()=default
 
template<typename T , typename... Args>
FORCEINLINE void SendServerMessage (AShooterPlayerController *player_controller, FLinearColor msg_color, const T *msg, Args &&... args)
 Sends server message to the specific player. Using fmt::format.
 
template<typename T , typename... Args>
FORCEINLINE void SendNotification (AShooterPlayerController *player_controller, FLinearColor color, float display_scale, float display_time, UTexture2D *icon, const T *msg, Args &&... args)
 Sends notification (on-screen message) to the specific player. Using fmt::format.
 
template<typename T , typename... Args>
FORCEINLINE void SendChatMessage (AShooterPlayerController *player_controller, const FString &sender_name, const T *msg, Args &&... args)
 Sends chat message to the specific player. Using fmt::format.
 
template<typename T , typename... Args>
FORCEINLINE void SendServerMessageToAll (FLinearColor msg_color, const T *msg, Args &&... args)
 Sends server message to all players. Using fmt::format.
 
template<typename T , typename... Args>
FORCEINLINE void SendNotificationToAll (FLinearColor color, float display_scale, float display_time, UTexture2D *icon, const T *msg, Args &&... args)
 Sends notification (on-screen message) to all players. Using fmt::format.
 
template<typename T , typename... Args>
FORCEINLINE void SendChatMessageToAll (const FString &sender_name, const T *msg, Args &&... args)
 Sends chat message to all players. Using fmt::format.
 
FORCEINLINE AShooterPlayerControllerFindPlayerFromSteamName (const FString &steam_name) const
 Finds player from the given steam name.
 
FORCEINLINE AShooterPlayerControllerFindControllerFromCharacter (AShooterCharacter *character) const
 Finds player controller from the given player character.
 
FORCEINLINE TArray< AShooterPlayerController * > FindPlayerFromCharacterName (const FString &character_name, ESearchCase::Type search, bool full_match) const
 Finds all matching players from the given character name.
 
FORCEINLINE AShooterPlayerControllerFindPlayerFromSteamId (uint64 steam_id) const
 Finds player from the given steam id.
 
FORCEINLINE bool SpawnDrop (const wchar_t *blueprint, FVector pos, int amount, float item_quality=0.0f, bool force_blueprint=false, float life_span=0.0f) const
 Spawns an item drop.
 
FORCEINLINE APrimalDinoCharacterSpawnDino (AShooterPlayerController *player, FString blueprint, FVector *location, int lvl, bool force_tame, bool neutered) const
 Spawns a dino near player or at specific coordinates.
 
FORCEINLINE uint64 GetSteamIDForPlayerID (int player_id) const
 
FORCEINLINE AShooterGameStateGetGameState ()
 Get Shooter Game State.
 
FORCEINLINE UPrimalGameDataGetGameData ()
 Returns pointer to Primal Game Data.
 
FORCEINLINE TArray< AActor * > GetAllActorsInRange (FVector location, float radius, EServerOctreeGroup::Type ActorType)
 Gets all actors in radius at location.
 
FORCEINLINE TArray< AActor * > GetAllActorsInRange (FVector location, float radius, EServerOctreeGroup::Type ActorType, TArray< AActor * > ignores)
 Gets all actors in radius at location, with ignore actors.
 
FORCEINLINE MapCoords FVectorToCoords (FVector actor_position)
 Converts FVector into coords that are displayed when you view the ingame map.
 
FORCEINLINE uint64 GetAttackerSteamID (AActor *target, AController *killer, AActor *damage_causer, bool tribe_check=true)
 obtains the steam ID of an attacker, meant to be used in hooks such as TakeDamage
 
void RunHiddenCommand (AShooterPlayerController *_this, FString *Command)
 

Private Attributes

UWorldu_world_ {nullptr}
 
AShooterGameModeshooter_game_mode_ {nullptr}
 
ArkApi::ServerStatus status_ {0}
 
UShooterCheatManagercheatmanager_ { nullptr }
 
std::unordered_map< uint64, AShooterPlayerController * > steam_id_map_
 

Additional Inherited Members

- Static Public Member Functions inherited from ArkApi::IApiUtils
static uint64 GetSteamIdFromController (AController *controller)
 Returns Steam ID from player controller.
 
static FString GetCharacterName (AShooterPlayerController *player_controller, bool include_first_name=true, bool include_last_name=true)
 Returns the character name of player.
 
static FString GetSteamName (AController *player_controller)
 Returns the steam name of player.
 
static bool IsRidingDino (AShooterPlayerController *player_controller)
 Returns true if character is riding a dino, false otherwise.
 
static APrimalDinoCharacterGetRidingDino (AShooterPlayerController *player_controller)
 Returns the dino the character is riding.
 
static FVector GetPosition (APlayerController *player_controller)
 Returns the position of a player.
 
static std::optional< FStringTeleportToPlayer (AShooterPlayerController *me, AShooterPlayerController *him, bool check_for_dino, float max_dist)
 Teleport one player to another.
 
static bool TeleportToPos (AShooterPlayerController *player_controller, const FVector &pos)
 Teleports player to the given position.
 
static int GetInventoryItemCount (AShooterPlayerController *player_controller, const FString &item_name)
 Counts a specific items quantity.
 
static FString GetIPAddress (AShooterPlayerController *player_controller)
 Returns IP address of player.
 
static FORCEINLINE FString GetItemBlueprint (UPrimalItem *item)
 Returns blueprint from UPrimalItem.
 
static bool IsPlayerDead (AShooterPlayerController *player)
 Returns true if player is dead, false otherwise.
 
static uint64 GetPlayerID (APrimalCharacter *character)
 
static uint64 GetPlayerID (AController *controller)
 
static FORCEINLINE FString GetBlueprint (UObjectBase *object)
 Returns blueprint path from any UObject.
 
static FORCEINLINE FString GetClassBlueprint (UClass *the_class)
 Returns blueprint path from any UClass.
 
static UShooterCheatManagerGetCheatManagerByPC (AShooterPlayerController *SPC)
 Get UShooterCheatManager* of player controller.
 
static FORCEINLINE uint64 GetSteamIdFromController (AController *controller)
 Returns Steam ID from player controller.
 
static FORCEINLINE FString GetCharacterName (AShooterPlayerController *player_controller)
 Returns the character name of player.
 
static FORCEINLINE FString GetSteamName (AController *player_controller)
 Returns the steam name of player.
 
static FORCEINLINE bool IsRidingDino (AShooterPlayerController *player_controller)
 Returns true if character is riding a dino, false otherwise.
 
static FORCEINLINE APrimalDinoCharacterGetRidingDino (AShooterPlayerController *player_controller)
 Returns the dino the character is riding.
 
static FORCEINLINE FVector GetPosition (APlayerController *player_controller)
 Returns the position of a player.
 
static FORCEINLINE std::optional< FStringTeleportToPlayer (AShooterPlayerController *me, AShooterPlayerController *him, bool check_for_dino, float max_dist)
 Teleport one player to another.
 
static FORCEINLINE bool TeleportToPos (AShooterPlayerController *player_controller, const FVector &pos)
 Teleports player to the given position.
 
static FORCEINLINE int GetInventoryItemCount (AShooterPlayerController *player_controller, const FString &item_name)
 Counts a specific items quantity.
 
static FORCEINLINE FString GetIPAddress (AShooterPlayerController *player)
 Returns IP address of player.
 
static FORCEINLINE FString GetItemBlueprint (UPrimalItem *item)
 Returns blueprint from UPrimalItem.
 
static FORCEINLINE bool IsPlayerDead (AShooterPlayerController *player)
 Returns true if player is dead, false otherwise.
 
static FORCEINLINE uint64 GetPlayerID (APrimalCharacter *character)
 
static FORCEINLINE uint64 GetPlayerID (AController *controller)
 
static FORCEINLINE FString GetBlueprint (UObjectBase *object)
 Returns blueprint path from any UObject.
 
static FORCEINLINE FString GetClassBlueprint (UClass *the_class)
 Returns blueprint path from any UClass.
 
static FORCEINLINE UShooterCheatManagerGetCheatManagerByPC (AShooterPlayerController *SPC)
 Get UShooterCheatManager* of player controller.
 
static FORCEINLINE int GetTribeID (AShooterPlayerController *player_controller)
 Get Tribe ID of player controller.
 
static FORCEINLINE int GetTribeID (AShooterCharacter *player_character)
 Get Tribe ID of character.
 

Detailed Description

Definition at line 7 of file ApiUtils.h.

Constructor & Destructor Documentation

◆ ApiUtils() [1/3]

AtlasApi::ApiUtils::ApiUtils ( )
default

◆ ApiUtils() [2/3]

AtlasApi::ApiUtils::ApiUtils ( const ApiUtils & )
delete

◆ ApiUtils() [3/3]

AtlasApi::ApiUtils::ApiUtils ( ApiUtils && )
delete

◆ ~ApiUtils()

AtlasApi::ApiUtils::~ApiUtils ( )
overridedefault

Member Function Documentation

◆ FindPlayerFromSteamId_Internal()

AShooterPlayerController * AtlasApi::ApiUtils::FindPlayerFromSteamId_Internal ( uint64 steam_id) const
overridevirtual

Implements ArkApi::IApiUtils.

Definition at line 79 of file ApiUtils.cpp.

◆ GetCheatManager()

UShooterCheatManager * AtlasApi::ApiUtils::GetCheatManager ( ) const
overridevirtual

Returns a point to URCON CheatManager.

Implements ArkApi::IApiUtils.

Definition at line 48 of file ApiUtils.cpp.

◆ GetShooterGameMode()

AShooterGameMode * AtlasApi::ApiUtils::GetShooterGameMode ( ) const
overridevirtual

Returns a pointer to AShooterGameMode.

Implements ArkApi::IApiUtils.

Definition at line 26 of file ApiUtils.cpp.

◆ GetStatus()

ArkApi::ServerStatus AtlasApi::ApiUtils::GetStatus ( ) const
overridevirtual

Returns the current server status.

Implements ArkApi::IApiUtils.

Definition at line 38 of file ApiUtils.cpp.

◆ GetWorld()

UWorld * AtlasApi::ApiUtils::GetWorld ( ) const
overridevirtual

Returns a pointer to UWorld.

Implements ArkApi::IApiUtils.

Definition at line 14 of file ApiUtils.cpp.

◆ operator=() [1/2]

ApiUtils & AtlasApi::ApiUtils::operator= ( ApiUtils && )
delete

◆ operator=() [2/2]

ApiUtils & AtlasApi::ApiUtils::operator= ( const ApiUtils & )
delete

◆ RemovePlayerController()

void AtlasApi::ApiUtils::RemovePlayerController ( AShooterPlayerController * player_controller)

Definition at line 66 of file ApiUtils.cpp.

+ Here is the call graph for this function:

◆ SetCheatManager()

void AtlasApi::ApiUtils::SetCheatManager ( UShooterCheatManager * cheatmanager)

Definition at line 43 of file ApiUtils.cpp.

◆ SetPlayerController()

void AtlasApi::ApiUtils::SetPlayerController ( AShooterPlayerController * player_controller)

Definition at line 53 of file ApiUtils.cpp.

+ Here is the call graph for this function:

◆ SetShooterGameMode()

void AtlasApi::ApiUtils::SetShooterGameMode ( AShooterGameMode * shooter_game_mode)

Definition at line 21 of file ApiUtils.cpp.

◆ SetStatus()

void AtlasApi::ApiUtils::SetStatus ( ArkApi::ServerStatus status)

Definition at line 33 of file ApiUtils.cpp.

◆ SetWorld()

void AtlasApi::ApiUtils::SetWorld ( UWorld * uworld)

Definition at line 9 of file ApiUtils.cpp.

Member Data Documentation

◆ cheatmanager_

UShooterCheatManager* AtlasApi::ApiUtils::cheatmanager_ { nullptr }
private

Definition at line 37 of file ApiUtils.h.

◆ shooter_game_mode_

AShooterGameMode* AtlasApi::ApiUtils::shooter_game_mode_ {nullptr}
private

Definition at line 35 of file ApiUtils.h.

◆ status_

ArkApi::ServerStatus AtlasApi::ApiUtils::status_ {0}
private

Definition at line 36 of file ApiUtils.h.

◆ steam_id_map_

std::unordered_map<uint64, AShooterPlayerController*> AtlasApi::ApiUtils::steam_id_map_
private

Definition at line 38 of file ApiUtils.h.

◆ u_world_

UWorld* AtlasApi::ApiUtils::u_world_ {nullptr}
private

Definition at line 34 of file ApiUtils.h.


The documentation for this class was generated from the following files: