Skip to content

Commit d9ff146

Browse files
committed
- v3.53
- Fixed Tick/Timer crashes on startup - Added some additions to headers - Added hook name when failed to find
1 parent 0ec3af6 commit d9ff146

8 files changed

Lines changed: 37 additions & 81 deletions

File tree

version/Core/Private/Ark/ArkBaseApi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace API
1818
{
19-
constexpr float api_version = 3.52f;
19+
constexpr float api_version = 3.53f;
2020

2121
ArkBaseApi::ArkBaseApi()
2222
: commands_(std::make_unique<ArkApi::Commands>()),

version/Core/Private/Commands.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ namespace ArkApi
9090

9191
void Commands::CheckOnTickCallbacks(float delta_seconds)
9292
{
93-
for (const auto& data : on_tick_callbacks_)
93+
const auto tmp_tick_callbacks = on_tick_callbacks_;
94+
for (const auto& data : tmp_tick_callbacks)
9495
{
9596
if (data)
9697
{
@@ -101,7 +102,8 @@ namespace ArkApi
101102

102103
void Commands::CheckOnTimerCallbacks()
103104
{
104-
for (const auto& data : on_timer_callbacks_)
105+
const auto tmp_timer_callbacks = on_timer_callbacks_;
106+
for (const auto& data : tmp_timer_callbacks)
105107
{
106108
if (data)
107109
{
@@ -117,8 +119,10 @@ namespace ArkApi
117119
bool spam_check,
118120
bool command_executed)
119121
{
122+
const auto tmp_chat_callbacks = on_chat_message_callbacks_;
123+
120124
bool prevent_default = false;
121-
for (const auto& data : on_chat_message_callbacks_)
125+
for (const auto& data : tmp_chat_callbacks)
122126
{
123127
prevent_default |= data->callback(player_controller, message, mode, spam_check, command_executed);
124128
}

version/Core/Private/Hooks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace API
7070

7171
if (iter == hook_vector.end())
7272
{
73-
Log::GetLog()->warn("Failed to find hook");
73+
Log::GetLog()->warn("Failed to find hook ({})", func_name);
7474
return false;
7575
}
7676

version/Core/Public/API/ARK/GameMode.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,3 +1582,8 @@ struct UGameInstance : UObject //, FExec
15821582
TArray<ULocalPlayer *, FDefaultAllocator> LocalPlayers;
15831583
FString PIEMapName;*/
15841584
};
1585+
1586+
struct ACustomActorList : AInfo
1587+
{
1588+
TArray<AActor*> ActorList;
1589+
};

version/Core/Public/API/ARK/Inventory.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ struct UActorComponent : UObject
196196
void AddedAsPrimalItemAttachment() { NativeCall<void>(this, "UActorComponent.AddedAsPrimalItemAttachment"); }
197197
};
198198

199+
struct FServerCustomFolder
200+
{
201+
int InventoryCompType;
202+
FString FolderName;
203+
TArray<FItemNetID, FDefaultAllocator> CustomFolderItemIds;
204+
};
205+
199206
struct UPrimalInventoryComponent : UActorComponent
200207
{
201208
TArray<TWeakObjectPtr<AShooterPlayerController>> & RemoteViewingInventoryPlayerControllersField() { return *GetNativePointerField<TArray<TWeakObjectPtr<AShooterPlayerController>>*>(this, "UPrimalInventoryComponent.RemoteViewingInventoryPlayerControllers"); }
@@ -288,6 +295,7 @@ struct UPrimalInventoryComponent : UActorComponent
288295
long double& LastAddToCraftQueueSoundTimeField() { return *GetNativePointerField<long double*>(this, "UPrimalInventoryComponent.LastAddToCraftQueueSoundTime"); }
289296
FString & ForceAddToFolderField() { return *GetNativePointerField<FString*>(this, "UPrimalInventoryComponent.ForceAddToFolder"); }
290297
FVector & GroundDropTraceLocationOffsetField() { return *GetNativePointerField<FVector*>(this, "UPrimalInventoryComponent.GroundDropTraceLocationOffset"); }
298+
TArray<FServerCustomFolder>& CustomFolderItemsField() { return *GetNativePointerField<TArray<FServerCustomFolder>*>(this, "UPrimalInventoryComponent.CustomFolderItems"); }
291299

292300
// Bit fields
293301

version/Core/Public/API/ARK/Other.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,8 @@ struct UVictoryCore
485485
static FString* BPGetPrimaryMapName(FString* result, UWorld* WorldContext) { return NativeCall<FString*, FString*, UWorld*>(nullptr, "UVictoryCore.BPGetPrimaryMapName", result, WorldContext); }
486486
static bool OverlappingStationaryObjectsTrace(UWorld* theWorld, APrimalCharacter* SourceCharacter, TArray<FOverlapResult>* Overlaps, FVector Origin, float Radius, ECollisionChannel TraceChannel, AActor* InIgnoreActor, FName TraceName, bool bComplexOverlapTest) { return NativeCall<bool, UWorld*, APrimalCharacter*, TArray<FOverlapResult>*, FVector, float, ECollisionChannel, AActor*, FName, bool>(nullptr, "UVictoryCore.OverlappingStationaryObjectsTrace", theWorld, SourceCharacter, Overlaps, Origin, Radius, TraceChannel, InIgnoreActor, TraceName, bComplexOverlapTest); }
487487
static void StaticRegisterNativesUVictoryCore() { NativeCall<void>(nullptr, "UVictoryCore.StaticRegisterNativesUVictoryCore"); }
488+
static FString* ClassToStringReference(FString* result, TSubclassOf<UObject> obj) { return NativeCall<FString*, FString*, TSubclassOf<UObject>>(nullptr, "UVictoryCore.ClassToStringReference", result, obj); }
489+
static TSubclassOf<UObject>* StringReferenceToClass(TSubclassOf<UObject>* result, FString* StringReference) { return NativeCall<TSubclassOf<UObject>*, TSubclassOf<UObject>*, FString*>(nullptr, "UVictoryCore.StringReferenceToClass", result, StringReference); }
488490
};
489491

490492
struct UDamageType

version/Core/Public/Ark/ArkApiUtils.h

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -562,26 +562,9 @@ namespace ArkApi
562562
/**
563563
* \brief Returns blueprint from UPrimalItem
564564
*/
565-
static FString GetItemBlueprint(UPrimalItem* item)
565+
static FORCEINLINE FString GetItemBlueprint(UPrimalItem* item)
566566
{
567-
if (item != nullptr)
568-
{
569-
FString path_name;
570-
item->ClassField()->GetDefaultObject(true)->GetFullName(&path_name, nullptr);
571-
572-
if (int find_index = 0; path_name.FindChar(' ', find_index))
573-
{
574-
path_name = "Blueprint'" + path_name.Mid(find_index + 1,
575-
path_name.Len() - (find_index + (path_name.EndsWith(
576-
"_C", ESearchCase::
577-
CaseSensitive)
578-
? 3
579-
: 1))) + "'";
580-
return path_name.Replace(L"Default__", L"", ESearchCase::CaseSensitive);
581-
}
582-
}
583-
584-
return FString("");
567+
return GetBlueprint(item);
585568
}
586569

587570
/**
@@ -636,23 +619,11 @@ namespace ArkApi
636619
/**
637620
* \brief Returns blueprint path from any UObject
638621
*/
639-
static FString GetBlueprint(UObjectBase* object)
622+
static FORCEINLINE FString GetBlueprint(UObjectBase* object)
640623
{
641624
if (object != nullptr && object->ClassField() != nullptr)
642625
{
643-
FString path_name;
644-
object->ClassField()->GetDefaultObject(true)->GetFullName(&path_name, nullptr);
645-
646-
if (int find_index = 0; path_name.FindChar(' ', find_index))
647-
{
648-
path_name = "Blueprint'" + path_name.Mid(find_index + 1,
649-
path_name.Len() - (find_index + (path_name.EndsWith(
650-
"_C", ESearchCase::
651-
CaseSensitive)
652-
? 3
653-
: 1))) + "'";
654-
return path_name.Replace(L"Default__", L"", ESearchCase::CaseSensitive);
655-
}
626+
return GetClassBlueprint(object->ClassField());
656627
}
657628

658629
return FString("");
@@ -661,23 +632,13 @@ namespace ArkApi
661632
/**
662633
* \brief Returns blueprint path from any UClass
663634
*/
664-
static FString GetClassBlueprint(UClass* the_class)
635+
static FORCEINLINE FString GetClassBlueprint(UClass* the_class)
665636
{
666637
if (the_class != nullptr)
667638
{
668-
FString path_name;
669-
the_class->GetDefaultObject(true)->GetFullName(&path_name, nullptr);
670-
671-
if (int find_index = 0; path_name.FindChar(' ', find_index))
672-
{
673-
path_name = "Blueprint'" + path_name.Mid(find_index + 1,
674-
path_name.Len() - (find_index + (path_name.EndsWith(
675-
"_C", ESearchCase::
676-
CaseSensitive)
677-
? 3
678-
: 1))) + "'";
679-
return path_name.Replace(L"Default__", L"", ESearchCase::CaseSensitive);
680-
}
639+
FString path;
640+
UVictoryCore::ClassToStringReference(&path, the_class);
641+
return "Blueprint'" + path.LeftChop(2) + "'";
681642
}
682643

683644
return FString("");

version/Core/Public/Atlas/AtlasApiUtils.h

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -566,23 +566,11 @@ namespace ArkApi
566566
/**
567567
* \brief Returns blueprint from UPrimalItem
568568
*/
569-
static FString GetItemBlueprint(UPrimalItem* item)
569+
static FORCEINLINE FString GetItemBlueprint(UPrimalItem* item)
570570
{
571571
if (item != nullptr)
572572
{
573-
FString path_name;
574-
item->ClassField()->GetDefaultObject(true)->GetFullName(&path_name, nullptr);
575-
576-
if (int find_index = 0; path_name.FindChar(' ', find_index))
577-
{
578-
path_name = "Blueprint'" + path_name.Mid(find_index + 1,
579-
path_name.Len() - (find_index + (path_name.EndsWith(
580-
"_C", ESearchCase::
581-
CaseSensitive)
582-
? 3
583-
: 1))) + "'";
584-
return path_name.Replace(L"Default__", L"", ESearchCase::CaseSensitive);
585-
}
573+
return GetBlueprint(item);
586574
}
587575

588576
return FString("");
@@ -641,23 +629,11 @@ namespace ArkApi
641629
/**
642630
* \brief Returns blueprint path from any UObject
643631
*/
644-
static FString GetBlueprint(UObjectBase* object)
632+
static FORCEINLINE FString GetBlueprint(UObjectBase* object)
645633
{
646634
if (object != nullptr && object->ClassField() != nullptr)
647635
{
648-
FString path_name;
649-
object->ClassField()->GetDefaultObject(true)->GetFullName(&path_name, nullptr);
650-
651-
if (int find_index = 0; path_name.FindChar(' ', find_index))
652-
{
653-
path_name = "Blueprint'" + path_name.Mid(find_index + 1,
654-
path_name.Len() - (find_index + (path_name.EndsWith(
655-
"_C", ESearchCase::
656-
CaseSensitive)
657-
? 3
658-
: 1))) + "'";
659-
return path_name.Replace(L"Default__", L"", ESearchCase::CaseSensitive);
660-
}
636+
return GetClassBlueprint(object->ClassField());
661637
}
662638

663639
return FString("");
@@ -666,7 +642,7 @@ namespace ArkApi
666642
/**
667643
* \brief Returns blueprint path from any UClass
668644
*/
669-
static FString GetClassBlueprint(UClass* the_class)
645+
static FORCEINLINE FString GetClassBlueprint(UClass* the_class)
670646
{
671647
if (the_class != nullptr)
672648
{

0 commit comments

Comments
 (0)