5#define RESTRICT __restrict
6#define FORCENOINLINE __declspec(noinline)
7#define CONSTEXPR constexpr
9#define PLATFORM_HAS_64BIT_ATOMICS 1
10#define PLATFORM_64BITS 1
11#define PLATFORM_COMPILER_HAS_DEFAULTED_FUNCTIONS 1
12#define PLATFORM_LITTLE_ENDIAN 1
15#define checkSlow(expr) {}
17#define CA_ASSUME( Expr ) {}
18#define ASSUME( Expr ) {}
19#define ensureMsgf( Expr, Expr2 ) {}
21#define MS_ALIGN(n) __declspec(align(n))
28template<
typename T32BITS,
typename T64BITS,
int PointerSize>
34template<
typename T32BITS,
typename T64BITS>
40template<
typename T32BITS,
typename T64BITS>
47
48
81
82
86 typedef unsigned __int64 SIZE_T;
87 typedef __int64 SSIZE_T;
static unsigned int GetBuildUniqueId()
ARK_API LPVOID GetDataAddress(const std::string &name)
ARK_API BitField GetBitField(LPVOID base, const std::string &name)
ARK_API BitField GetBitField(const void *base, const std::string &name)
ARK_API DWORD64 GetAddress(const void *base, const std::string &name)
ARK_API LPVOID GetAddress(const std::string &name)
FPlatformTypes::CHAR16 UCS2CHAR
A 16-bit character containing a UCS2 (Unicode, 16-bit, fixed-width) code unit, used for compatibility...
FWindowsPlatformTypes FPlatformTypes
#define PLATFORM_LITTLE_ENDIAN
FPlatformTypes::CHAR8 UTF8CHAR
An 8-bit character containing a UTF8 (Unicode, 8-bit, variable-width) code unit.
FPlatformTypes::CHAR16 UTF16CHAR
A 16-bit character containing a UTF16 (Unicode, 16-bit, variable-width) code unit.
FPlatformTypes::CHAR32 UTF32CHAR
A 32-bit character containing a UTF32 (Unicode, 32-bit, fixed-width) code unit.
#define THRESH_VECTOR_NORMALIZED
#define THRESH_NORMALS_ARE_PARALLEL
#define THRESH_POINTS_ARE_SAME
#define THRESH_POINT_ON_PLANE
#define THRESH_NORMALS_ARE_ORTHOGONAL
#define KINDA_SMALL_NUMBER
FORCEINLINE float ComputeSquaredDistanceFromBoxToPoint(const FVector &Mins, const FVector &Maxs, const FVector &Point)
FORCEINLINE FVector ClampVector(const FVector &V, const FVector &Min, const FVector &Max)
FORCEINLINE FVector operator*(float Scale, const FVector &V)
ApiUtils & operator=(ApiUtils &&)=delete
void SetCheatManager(UShooterCheatManager *cheatmanager)
void SetWorld(UWorld *uworld)
ApiUtils & operator=(const ApiUtils &)=delete
void SetShooterGameMode(AShooterGameMode *shooter_game_mode)
std::unordered_map< uint64, AShooterPlayerController * > steam_id_map_
UShooterCheatManager * GetCheatManager() const override
Returns a point to URCON CheatManager.
ApiUtils(ApiUtils &&)=delete
AShooterGameMode * shooter_game_mode_
AShooterGameMode * GetShooterGameMode() const override
Returns a pointer to AShooterGameMode.
void RemovePlayerController(AShooterPlayerController *player_controller)
UShooterCheatManager * cheatmanager_
void SetPlayerController(AShooterPlayerController *player_controller)
ServerStatus GetStatus() const override
Returns the current server status.
AShooterPlayerController * FindPlayerFromSteamId_Internal(uint64 steam_id) const override
~ApiUtils() override=default
void SetStatus(ServerStatus status)
UWorld * GetWorld() const override
Returns a pointer to UWorld.
ApiUtils(const ApiUtils &)=delete
static FString GetSteamName(AController *player_controller)
Returns the steam name of player.
static FORCEINLINE FString GetItemBlueprint(UPrimalItem *item)
Returns blueprint from UPrimalItem.
static FVector GetPosition(APlayerController *player_controller)
Returns the position of a player.
uint64 GetSteamIDForPlayerID(int player_id) const
static FORCEINLINE FString GetClassBlueprint(UClass *the_class)
Returns blueprint path from any UClass.
void SendServerMessageToAll(FLinearColor msg_color, const T *msg, Args &&... args)
Sends server message to all players. Using fmt::format.
virtual UShooterCheatManager * GetCheatManager() const =0
Returns a point to URCON CheatManager.
UPrimalGameData * GetGameData()
Returns pointer to Primal Game Data.
static bool IsRidingDino(AShooterPlayerController *player_controller)
Returns true if character is riding a dino, false otherwise.
AShooterGameState * GetGameState()
Get Shooter Game State.
virtual ~IApiUtils()=default
AShooterPlayerController * FindPlayerFromSteamName(const FString &steam_name) const
Finds player from the given steam name.
static UShooterCheatManager * GetCheatManagerByPC(AShooterPlayerController *SPC)
Get UShooterCheatManager* of player controller.
static uint64 GetPlayerID(AController *controller)
static bool IsPlayerDead(AShooterPlayerController *player)
Returns true if player is dead, false otherwise.
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.
APrimalDinoCharacter * SpawnDino(AShooterPlayerController *player, FString blueprint, FVector *location, int lvl, bool force_tame, bool neutered) const
Spawns a dino near player or at specific coordinates.
TArray< AShooterPlayerController * > FindPlayerFromCharacterName(const FString &character_name, ESearchCase::Type search, bool full_match) const
Finds all matching players from the given character name.
static FORCEINLINE FString GetBlueprint(UObjectBase *object)
Returns blueprint path from any UObject.
static FString GetCharacterName(AShooterPlayerController *player_controller, bool include_first_name=true, bool include_last_name=true)
Returns the character name of player.
TArray< AActor * > GetAllActorsInRange(FVector location, float radius, EServerOctreeGroup::Type ActorType)
Gets all actors in radius at location.
void SendChatMessageToAll(const FString &sender_name, const T *msg, Args &&... args)
Sends chat message to all players. Using fmt::format.
TArray< AActor * > GetAllActorsInRange(FVector location, float radius, EServerOctreeGroup::Type ActorType, TArray< AActor * > ignores)
Gets all actors in radius at location, with ignore actors.
virtual AShooterGameMode * GetShooterGameMode() const =0
Returns a pointer to AShooterGameMode.
static uint64 GetSteamIdFromController(AController *controller)
Returns Steam ID from player controller.
virtual UWorld * GetWorld() const =0
Returns a pointer to UWorld.
static bool TeleportToPos(AShooterPlayerController *player_controller, const FVector &pos)
Teleports player to the given position.
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.
static uint64 GetPlayerID(APrimalCharacter *character)
virtual AShooterPlayerController * FindPlayerFromSteamId_Internal(uint64 steam_id) const =0
AShooterPlayerController * FindControllerFromCharacter(AShooterCharacter *character) const
Finds player controller from the given player character.
static APrimalDinoCharacter * GetRidingDino(AShooterPlayerController *player_controller)
Returns the dino the character is riding.
static FString GetIPAddress(AShooterPlayerController *player_controller)
Returns IP address of player.
AShooterPlayerController * FindPlayerFromSteamId(uint64 steam_id) const
Finds player from the given steam id.
virtual ServerStatus GetStatus() const =0
Returns the current server status.
void SendServerMessage(AShooterPlayerController *player_controller, FLinearColor msg_color, const T *msg, Args &&... args)
Sends server message to the specific player. Using fmt::format.
static std::optional< FString > TeleportToPlayer(AShooterPlayerController *me, AShooterPlayerController *him, bool check_for_dino, float max_dist)
Teleport one player to another.
static int GetInventoryItemCount(AShooterPlayerController *player_controller, const FString &item_name)
Counts a specific items quantity.
void SendChatMessage(AShooterPlayerController *player_controller, const FString &sender_name, const T *msg, Args &&... args)
Sends chat message to the specific player. Using fmt::format.
FString Replace(const TCHAR *From, const TCHAR *To, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
FORCEINLINE bool FindChar(TCHAR InChar, int32 &Index) const
FORCEINLINE FString Mid(int32 Start, int32 Count=INT_MAX) const
FORCEINLINE friend bool operator==(const FString &Lhs, const FString &Rhs)
FORCEINLINE bool FindLastChar(TCHAR InChar, int32 &Index) const
FORCEINLINE FString(const CharType *Src, typename TEnableIf< TIsCharType< CharType >::Value >::Type *Dummy=nullptr)
FORCEINLINE friend FString operator+(const TCHAR *Lhs, FString &&Rhs)
bool StartsWith(const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
FORCEINLINE bool Equals(const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
bool EndsWith(const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
FORCEINLINE bool IsEmpty() const
FORCEINLINE int32 Len() const
FORCEINLINE friend FString operator+(FString &&Lhs, const TCHAR *Rhs)
FORCEINLINE int32 Add(const ElementType &Item)
int32 Remove(const ElementType &Item)
FORCEINLINE ObjectType * Get() const
IApiUtils & GetApiUtils()
FVector & DefaultActorLocationField()
int & TargetingTeamField()
USceneComponent * RootComponentField()
APlayerState * PlayerStateField()
UCheatManager * CheatManagerField()
FString * GetPlayerNetworkAddress(FString *result)
FUniqueNetIdRepl & UniqueIdField()
FString & PlayerNameField()
bool TeleportTo(FVector *DestLocation, FRotator *DestRotation, bool bIsATest, bool bNoCheck)
UPrimalInventoryComponent * MyInventoryComponentField()
void DoNeuter_Implementation()
static UClass * GetPrivateStaticClass()
void TameDino(AShooterPlayerController *ForPC, bool bIgnoreMaxTameLimit, int OverrideTamingTeamID)
int & TamingTeamIDField()
FString & TamerStringField()
int & AbsoluteBaseLevelField()
UPrimalPlayerData * GetPlayerData()
APrimalDinoCharacter * GetRidingDino()
unsigned __int64 GetSteamIDForPlayerID(int playerDataID)
void AddPlayerID(int playerDataID, unsigned __int64 netUniqueID)
__int64 & LinkedPlayerIDField()
void SetPlayerPos(float X, float Y, float Z)
AActor * SpawnActor(FString *blueprintPath, float spawnDistance, float spawnYOffset, float ZOffset, bool bDoDeferBeginPlay)
AShooterCharacter * GetPlayerCharacter()
FString * GetPlayerName(FString *result)
void SetTribeTamingDinoSettings(APrimalDinoCharacter *aDinoChar)
FIntVector(FVector InVector)
static FORCEINLINE T Clamp(const T X, const T Min, const T Max)
static FORCEINLINE T Square(const T A)
static FORCEINLINE void SinCos(float *ScalarSin, float *ScalarCos, float Value)
static FORCEINLINE auto DegreesToRadians(T const &DegVal) -> decltype(DegVal *(PI/180.f))
unsigned __int64 & PlayerDataIDField()
FORCEINLINE FRotator(float InPitch, float InYaw, float InRoll)
TSharedPtr< FUniqueNetId > UniqueNetId
FORCEINLINE FVector operator+(float Bias) const
FORCEINLINE FVector operator*=(float Scale)
bool operator!=(const FVector &V) const
static float Triple(const FVector &X, const FVector &Y, const FVector &Z)
static bool Orthogonal(const FVector &Normal1, const FVector &Normal2, float OrthogonalCosineThreshold=THRESH_NORMALS_ARE_ORTHOGONAL)
static bool Parallel(const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
FORCEINLINE FVector operator-(const FVector &V) const
FORCEINLINE FVector operator-=(const FVector &V)
FVector GetSafeNormal(float Tolerance=SMALL_NUMBER) const
static FVector VectorPlaneProject(const FVector &V, const FVector &PlaneNormal)
FVector operator/=(const FVector &V)
static bool PointsAreSame(const FVector &P, const FVector &Q)
FORCEINLINE FVector(float InF)
FORCEINLINE FVector operator+=(const FVector &V)
FORCEINLINE FVector operator-() const
FORCEINLINE FVector operator^(const FVector &V) const
bool IsUniform(float Tolerance=KINDA_SMALL_NUMBER) const
FORCEINLINE FVector operator-(float Bias) const
FRotator ToOrientationRotator() const
FVector(const FLinearColor &InColor)
FVector MirrorByVector(const FVector &MirrorNormal) const
FVector Reciprocal() const
static FORCEINLINE float DistSquaredXY(const FVector &V1, const FVector &V2)
static bool PointsAreNear(const FVector &Point1, const FVector &Point2, float Dist)
bool InitFromString(const FString &InSourceString)
static FORCEINLINE float DotProduct(const FVector &A, const FVector &B)
FVector ComponentMax(const FVector &Other) const
void ToDirectionAndLength(FVector &OutDir, float &OutLength) const
FORCEINLINE float operator|(const FVector &V) const
FRotator Rotation() const
FORCEINLINE FVector GetUnsafeNormal() const
FVector GetClampedToMaxSize(float MaxSize) const
FORCEINLINE FVector operator*(const FVector &V) const
void FindBestAxisVectors(FVector &Axis1, FVector &Axis2) const
FVector(FIntVector InVector)
static const FVector ZeroVector
float SizeSquared2D() const
FVector GetSafeNormal2D(float Tolerance=SMALL_NUMBER) const
float & Component(int32 Index)
static FORCEINLINE float BoxPushOut(const FVector &Normal, const FVector &Size)
FVector operator/(float Scale) const
static FVector RadiansToDegrees(const FVector &RadVector)
FVector2D UnitCartesianToSpherical() const
static float PointPlaneDist(const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal)
FVector BoundToCube(float Radius) const
static FORCEINLINE float DistSquared(const FVector &V1, const FVector &V2)
FORCEINLINE FVector GetSignVector() const
FORCEINLINE FVector operator/(const FVector &V) const
static FORCEINLINE float Dist2D(const FVector &V1, const FVector &V2)
FVector ComponentMin(const FVector &Other) const
float & operator[](int32 Index)
static FORCEINLINE float Dist(const FVector &V1, const FVector &V2)
FVector GridSnap(const float &GridSz) const
static bool Coincident(const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
FVector Projection() const
static bool Coplanar(const FVector &Base1, const FVector &Normal1, const FVector &Base2, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
FORCEINLINE FVector ProjectOnTo(const FVector &A) const
static FVector PointPlaneProject(const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal)
bool IsNormalized() const
FORCEINLINE FVector ProjectOnToNormal(const FVector &Normal) const
static FVector PointPlaneProject(const FVector &Point, const FVector &A, const FVector &B, const FVector &C)
bool Equals(const FVector &V, float Tolerance=KINDA_SMALL_NUMBER) const
FQuat ToOrientationQuat() const
bool operator==(const FVector &V) const
FVector GetClampedToSize2D(float Min, float Max) const
float SizeSquared() const
float operator[](int32 Index) const
FVector GetClampedToSize(float Min, float Max) const
static FORCEINLINE float DistSquared2D(const FVector &V1, const FVector &V2)
FVector operator/=(float V)
static FORCEINLINE FVector CrossProduct(const FVector &A, const FVector &B)
FVector operator*=(const FVector &V)
void Set(float InX, float InY, float InZ)
FORCEINLINE FVector operator+(const FVector &V) const
FORCEINLINE FVector operator*(float Scale) const
static FVector DegreesToRadians(const FVector &DegVector)
FORCEINLINE CONSTEXPR FVector(float InX, float InY, float InZ)
FORCEINLINE float CosineAngle2D(FVector B) const
bool AllComponentsEqual(float Tolerance=KINDA_SMALL_NUMBER) const
FVector GetClampedToMaxSize2D(float MaxSize) const
static FORCEINLINE float DistXY(const FVector &V1, const FVector &V2)
static void CreateOrthonormalBasis(FVector &XAxis, FVector &YAxis, FVector &ZAxis)
FORCEINLINE bool IsUnit(float LengthSquaredTolerance=KINDA_SMALL_NUMBER) const
FVector RotateAngleAxis(const float AngleDeg, const FVector &Axis) const
float HeadingAngle() const
static float EvaluateBezier(const FVector *ControlPoints, int32 NumPoints, TArray< FVector > &OutPoints)
float Component(int32 Index) const
FORCEINLINE FVector(const FVector2D V, float InZ)
bool IsNearlyZero(float Tolerance=KINDA_SMALL_NUMBER) const
FORCEINLINE FVector(EForceInit)
static FORCEINLINE float Distance(const FVector &V1, const FVector &V2)
bool Normalize(float Tolerance=SMALL_NUMBER)
T * Get(bool bEvenIfPendingKill=false)
FORCEINLINE T * operator->()
UObject * GetDefaultObject(bool bCreateIfNeeded)
FString * GetFullName(FString *result, UObject *StopOuter)
bool IsA(UClass *SomeBase)
UPrimalGameData * PrimalGameDataOverrideField()
UPrimalGameData * PrimalGameDataField()
FPrimalPlayerDataStruct * MyDataField()
FVector * GetWorldLocation(FVector *result)
static TArray< AActor * > * ServerOctreeOverlapActors(TArray< AActor * > *result, UWorld *theWorld, FVector AtLoc, float Radius, EServerOctreeGroup::Type OctreeType, bool bForceActorLocationDistanceCheck)
TArray< TAutoWeakObjectPtr< APlayerController > > & PlayerControllerListField()
APlayerController * GetFirstPlayerController()
AGameState * GameStateField()