Hook_APrimalStructure_BPPlacedStructure(APrimalStructure* _this, APlayerController* ForPC)
void Commands::CheckOnTickCallbacks(float delta_seconds)
{
__try
{
for (const auto& data : on_tick_callbacks_)
{
if (data)
{
data->callback(delta_seconds);
}
}
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
Log::GetLog()->error("CheckOnTickCallbacks Failed");
}
}
void Commands::CheckOnTimerCallbacks()
{
__try
{
for (const auto& data : on_timer_callbacks_)
{
if (data)
{
data->callback();
}
}
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
Log::GetLog()->error("CheckOnTimerCallbacks Failed");
}
}
__try/__except
is only SEH error handling. (edited)__try/__except
is only SEH error handling. (edited)/EHa
which which may allow for additional logging using both C and C++ try/catch blocks.GetExceptionCode()
/EHa
along with some function changes in commands.GetPlayerCharacter()
function is used at different places in the Ark Server API code base : (edited)ArkApi::GetApiUtils().GetInventoryItemCount()
on a player that is just connecting and takes damage it can crash the server? (edited)LastControlledPlayerCharacterField()
?Get()
on itbEvenIfPendingKill
(edited)AShooterCharacter *__fastcall AShooterPlayerController::GetPlayerCharacter(AShooterPlayerController *this)
{
AShooterCharacter *result; // rax
FUObjectItem *v2; // [rsp+20h] [rbp-68h]
TWeakObjectPtr<AShooterCharacter,FWeakObjectPtr,FIndexToObject> *v3; // [rsp+48h] [rbp-40h]
UObjectBase *v4; // [rsp+50h] [rbp-38h]
UObjectBase *v5; // [rsp+60h] [rbp-28h]
v3 = &this->LastControlledPlayerCharacter;
v4 = 0i64;
if ( FWeakObjectPtr::IsValid(&this->LastControlledPlayerCharacter, 1, 0) )
{
if ( v3->ObjectIndex >= GUObjectArray.ObjObjects.NumElements )
v2 = 0i64;
else
v2 = &GUObjectArray.ObjObjects.Objects[v3->ObjectIndex / 0x10000][v3->ObjectIndex % 0x10000];
if ( v2 && v2->Object && (v2->Object->ObjectFlags & 0x4000) != 0 )
v2 = 0i64;
if ( v2 )
v5 = v2->Object;
else
v5 = 0i64;
v4 = v5;
}
if ( !v4 || ((__int64)v4[55].vfptr & 0x20) != 0 )
result = 0i64;
else
result = (AShooterCharacter *)v4;
return result;
}
LastControlledPlayerCharacterField().Get(false)
inside this function (edited)AShooterCharacter* Hook_AShooterPlayerController_GetPlayerCharacter(AShooterPlayerController* _this) {
if (_this != nullptr) {
return _this->LastControlledPlayerCharacterField().Get(false);
}
return nullptr;
}
AGameState::TeleportTo(AController *this, FVector *DestLocation, FRotator *DestRotation, bool bIsATest, bool bNoCheck);
AShooterGameState::PrepareActorForMassTeleport(AShooterGameState *this, AActor *PrepareActor, FMassTeleportData *WithMassTeleportData);
AMissionType::GetTeleportedCharactersIndex(AMissionType *this, APrimalCharacter *Character);
Is a boss fight considered to be a mission? (edited)std::string DinoName = "";
if (UObject* Obj = GetDefaultObjectOfClass(DinoBp.c_str()); Obj)
{
APrimalDinoCharacter* Dino = static_cast<APrimalDinoCharacter*>(Obj);
if (Dino)
DinoName = Dino->DescriptiveNameField().ToString();
}
UObject* GetDefaultObjectOfClass(FString BP)
{
UObject* Obj = nullptr;
UClass* aClass = UVictoryCore::BPLoadClass(&BP);
if (aClass && aClass->GetDefaultObject(true))
Obj = aClass->GetDefaultObject(true);
return Obj;
}
std::string ItemName = "";
if (UObject* Obj = GetDefaultObjectOfClass(ItemBp.c_str()); Obj)
{
UPrimalItem* Item = static_cast<UPrimalItem*>(Obj);
if (Item)
ItemName = Item->DescriptiveNameBaseField().ToString();
}
player_controller->GetPlayerCharacter()->ServerDinoOrder(dino, EDinoTamedOrder::StopFollowing, nullptr);
(edited) template<typename ...Ts>
static auto FindProperties(UObject* object, Ts... properties)
{
auto apply = [&object](const char* property)
{
return object->FindProperty(FName(property, EFindName::FNAME_Find));
};
return std::make_tuple(apply(properties)...);
}
static auto [NumAscensions, NumAscensionsAb, NumAscensionsExt, NumAscensionsGenesis, NumAscensionsGen2] = FindProperties(CDO, "NumAscensions", "NumAscensionsAb", "NumAscensionsExt", "NumAscensionsGenesis", "NumAscensionsGen2");
UUI_ListSessions
for the owning client then trigger UUI_ListSessions::RefreshSlotButtons(this);
to refresh the UI buttons.UUI_ListSessions
is not exposed to blueprint I believe so there ends the chances.UFUNCTION(BlueprintCallable)
UE4 header tool macroGetViewportClient
-> GetUISceneFromClass
-> Cast to ListSessions
-> callGetUISceneFromClass
there's 2, one with a single reference, and another one with an array. Both should work in this caseGetPrimalUISceneFromClass
... around those lines