Later game and fix mcp

This commit is contained in:
Milxnor
2023-06-22 18:34:42 -04:00
parent e049e870dc
commit e3b1e8f4ec
17 changed files with 373 additions and 353 deletions

View File

@@ -15,8 +15,7 @@ bool ABuildingContainer::SpawnLoot(AFortPawn* Pawn)
FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorForwardVector() * this->GetLootSpawnLocation_Athena().X + this->GetActorRightVector() * this->GetLootSpawnLocation_Athena().Y + this->GetActorUpVector() * this->GetLootSpawnLocation_Athena().Z; FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorForwardVector() * this->GetLootSpawnLocation_Athena().X + this->GetActorRightVector() * this->GetLootSpawnLocation_Athena().Y + this->GetActorUpVector() * this->GetLootSpawnLocation_Athena().Z;
static auto SearchLootTierGroupOffset = this->GetOffset("SearchLootTierGroup"); auto RedirectedLootTier = GameMode->RedirectLootTier(GetSearchLootTierGroup());
auto RedirectedLootTier = GameMode->RedirectLootTier(this->Get<FName>(SearchLootTierGroupOffset));
// LOG_INFO(LogInteraction, "RedirectedLootTier: {}", RedirectedLootTier.ToString()); // LOG_INFO(LogInteraction, "RedirectedLootTier: {}", RedirectedLootTier.ToString());

View File

@@ -13,6 +13,12 @@ public:
return this->ReadBitfieldValue(bDestroyContainerOnSearchOffset, bDestroyContainerOnSearchFieldMask); return this->ReadBitfieldValue(bDestroyContainerOnSearchOffset, bDestroyContainerOnSearchFieldMask);
} }
FName& GetSearchLootTierGroup()
{
static auto SearchLootTierGroupOffset = this->GetOffset("SearchLootTierGroup");
return Get<FName>(SearchLootTierGroupOffset);
}
bool IsAlreadySearched() bool IsAlreadySearched()
{ {
static auto bAlreadySearchedOffset = this->GetOffset("bAlreadySearched"); static auto bAlreadySearchedOffset = this->GetOffset("bAlreadySearched");

View File

@@ -56,7 +56,7 @@ public:
{ {
auto CurveTableMode = GetCurveTableMode(); auto CurveTableMode = GetCurveTableMode();
LOG_INFO(LogDev, "RowName {} CurveTableMode {} Size {}", RowName.ComparisonIndex.Value ? RowName.ToString() : "InvalidComparision", (int)CurveTableMode, GetCurveTableSize()); // LOG_INFO(LogDev, "RowName {} CurveTableMode {} Size {}", RowName.ComparisonIndex.Value ? RowName.ToString() : "InvalidComparision", (int)CurveTableMode, GetCurveTableSize());
if (CurveTableMode == ECurveTableMode::SimpleCurves) if (CurveTableMode == ECurveTableMode::SimpleCurves)
{ {
@@ -67,7 +67,7 @@ public:
} }
else if (CurveTableMode == ECurveTableMode::RichCurves) else if (CurveTableMode == ECurveTableMode::RichCurves)
{ {
LOG_INFO(LogDev, "RICHCURVE UNIMPLEMENTED!");
} }
return nullptr; return nullptr;

View File

@@ -62,7 +62,7 @@ static UFortPlaylist* GetPlaylistToUse()
// SET OVERRIDE PLAYLIST DOWN HERE // SET OVERRIDE PLAYLIST DOWN HERE
if (Globals::bCreative) if (Globals::bCreative)
Playlist = FindObject<UFortPlaylist>("/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2"); Playlist = FindObject<UFortPlaylist>(L"/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2");
return Playlist; return Playlist;
} }
@@ -141,7 +141,7 @@ void AFortGameModeAthena::SkipAircraft()
if (bGameModeWillSkipAircraftOffset != -1) // hmm? if (bGameModeWillSkipAircraftOffset != -1) // hmm?
GameState->Get<bool>(bGameModeWillSkipAircraftOffset) = true; GameState->Get<bool>(bGameModeWillSkipAircraftOffset) = true;
static auto OnAircraftExitedDropZoneFn = FindObject<UFunction>("/Script/FortniteGame.FortGameModeAthena.OnAircraftExitedDropZone"); static auto OnAircraftExitedDropZoneFn = FindObject<UFunction>(L"/Script/FortniteGame.FortGameModeAthena.OnAircraftExitedDropZone");
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false); static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
@@ -194,6 +194,19 @@ void AFortGameModeAthena::PauseSafeZone(bool bPaused)
SafeZoneIndicator->GetSafeZoneFinishShrinkTime() = GameState->GetServerWorldTimeSeconds() + this->Get<float>(TimeRemainingWhenPhasePausedOffset); SafeZoneIndicator->GetSafeZoneFinishShrinkTime() = GameState->GetServerWorldTimeSeconds() + this->Get<float>(TimeRemainingWhenPhasePausedOffset);
} }
void AFortGameModeAthena::OnAircraftEnteredDropZoneHook(AFortGameModeAthena* GameModeAthena, AActor* Aircraft)
{
LOG_INFO(LogDev, "OnAircraftEnteredDropZoneHook!");
OnAircraftEnteredDropZoneOriginal(GameModeAthena, Aircraft);
if (Globals::bLateGame.load())
{
auto GameState = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState());
GameState->SkipAircraft();
}
}
bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode) bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode)
{ {
Globals::bHitReadyToStartMatch = true; Globals::bHitReadyToStartMatch = true;
@@ -600,11 +613,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
auto MapInfo = GameState->GetMapInfo(); auto MapInfo = GameState->GetMapInfo();
if (!bUseCustomMap)
{
if (!MapInfo && Engine_Version >= 421) if (!MapInfo && Engine_Version >= 421)
return false; return false;
}
static int LastNum = 1; static int LastNum = 1;
@@ -1229,6 +1239,8 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
ABuildingContainer* CurrentActor = (ABuildingContainer*)BRIsland_FloorLoot_Actors.at(i); ABuildingContainer* CurrentActor = (ABuildingContainer*)BRIsland_FloorLoot_Actors.at(i);
spawned++; spawned++;
// LOG_INFO(LogDev, "Test: {}", CurrentActor->GetSearchLootTierGroup().ToString());
auto Location = CurrentActor->GetActorLocation() + CurrentActor->GetActorForwardVector() * CurrentActor->GetLootSpawnLocation_Athena().X + CurrentActor->GetActorRightVector() * CurrentActor->GetLootSpawnLocation_Athena().Y + CurrentActor->GetActorUpVector() * CurrentActor->GetLootSpawnLocation_Athena().Z; auto Location = CurrentActor->GetActorLocation() + CurrentActor->GetActorForwardVector() * CurrentActor->GetLootSpawnLocation_Athena().X + CurrentActor->GetActorRightVector() * CurrentActor->GetLootSpawnLocation_Athena().Y + CurrentActor->GetActorUpVector() * CurrentActor->GetLootSpawnLocation_Athena().Z;
std::vector<LootDrop> LootDrops = PickLootDrops(BRIslandTierGroup, GameState->GetWorldLevel(), -1, bPrintIsland); std::vector<LootDrop> LootDrops = PickLootDrops(BRIslandTierGroup, GameState->GetWorldLevel(), -1, bPrintIsland);

View File

@@ -234,6 +234,7 @@ public:
static inline bool (*Athena_ReadyToStartMatchOriginal)(AFortGameModeAthena* GameMode); static inline bool (*Athena_ReadyToStartMatchOriginal)(AFortGameModeAthena* GameMode);
static inline void (*Athena_HandleStartingNewPlayerOriginal)(AFortGameModeAthena* GameMode, AActor* NewPlayer); static inline void (*Athena_HandleStartingNewPlayerOriginal)(AFortGameModeAthena* GameMode, AActor* NewPlayer);
static inline void (*SetZoneToIndexOriginal)(AFortGameModeAthena* GameModeAthena, int OverridePhaseMaybeIDFK); static inline void (*SetZoneToIndexOriginal)(AFortGameModeAthena* GameModeAthena, int OverridePhaseMaybeIDFK);
static inline void (*OnAircraftEnteredDropZoneOriginal)(AFortGameModeAthena* GameModeAthena, AActor* Aircraft);
AFortSafeZoneIndicator*& GetSafeZoneIndicator() AFortSafeZoneIndicator*& GetSafeZoneIndicator()
{ {
@@ -265,6 +266,7 @@ public:
static void HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage); // idk where to put static void HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage); // idk where to put
static void OnAircraftEnteredDropZoneHook(AFortGameModeAthena* GameModeAthena, AActor* Aircraft);
static bool Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode); static bool Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode);
static int Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller); static int Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller);
static void Athena_HandleStartingNewPlayerHook(AFortGameModeAthena* GameMode, AActor* NewPlayerActor); static void Athena_HandleStartingNewPlayerHook(AFortGameModeAthena* GameMode, AActor* NewPlayerActor);

View File

@@ -74,6 +74,57 @@ void AFortGameStateAthena::AddPlayerStateToGameMemberInfo(AFortPlayerStateAthena
GameMemberInfoArray->MarkArrayDirty(); GameMemberInfoArray->MarkArrayDirty();
} }
void AFortGameStateAthena::SkipAircraft()
{
// return UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipaircraft", nullptr);
if (GetGamePhase() != EAthenaGamePhase::Aircraft)
return;
// this->bGameModeWillSkipAircraft = true;
auto GetAircrafts = [&]() -> std::vector<AActor*>
{
static auto AircraftsOffset = this->GetOffset("Aircrafts", false);
std::vector<AActor*> Aircrafts;
if (AircraftsOffset == -1)
{
// GameState->Aircraft
static auto FortAthenaAircraftClass = FindObject<UClass>(L"/Script/FortniteGame.FortAthenaAircraft");
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
for (int i = 0; i < AllAircrafts.Num(); i++)
{
Aircrafts.push_back(AllAircrafts.at(i));
}
AllAircrafts.Free();
}
else
{
const auto& GameStateAircrafts = this->Get<TArray<AActor*>>(AircraftsOffset);
for (int i = 0; i < GameStateAircrafts.Num(); i++)
{
Aircrafts.push_back(GameStateAircrafts.at(i));
}
}
return Aircrafts;
};
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
for (auto Aircraft : GetAircrafts())
{
// haha skunked we should do GetAircraft!!
static auto OnAircraftExitedDropZoneFn = FindObject<UFunction>(L"/Script/FortniteGame.FortGameModeAthena.OnAircraftExitedDropZone");
GameMode->ProcessEvent(OnAircraftExitedDropZoneFn, &Aircraft);
}
}
TScriptInterface<UFortSafeZoneInterface> AFortGameStateAthena::GetSafeZoneInterface() TScriptInterface<UFortSafeZoneInterface> AFortGameStateAthena::GetSafeZoneInterface()
{ {
int Offset = -1; int Offset = -1;

View File

@@ -153,6 +153,7 @@ public:
TScriptInterface<UFortSafeZoneInterface> GetSafeZoneInterface(); TScriptInterface<UFortSafeZoneInterface> GetSafeZoneInterface();
void AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState); void AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState);
void SkipAircraft();
int GetAircraftIndex(AFortPlayerState* PlayerState); int GetAircraftIndex(AFortPlayerState* PlayerState);
bool IsRespawningAllowed(AFortPlayerState* PlayerState); // actually in zone bool IsRespawningAllowed(AFortPlayerState* PlayerState); // actually in zone

View File

@@ -471,17 +471,21 @@ void AFortInventory::ModifyCount(UFortItem* ItemInstance, int New, bool bRemove,
UFortItem* AFortInventory::GetPickaxeInstance() UFortItem* AFortInventory::GetPickaxeInstance()
{ {
static auto FortWeaponMeleeItemDefinitionClass = FindObject<UClass>("/Script/FortniteGame.FortWeaponMeleeItemDefinition"); static auto FortWeaponMeleeItemDefinitionClass = FindObject<UClass>(L"/Script/FortniteGame.FortWeaponMeleeItemDefinition");
auto& ItemInstances = GetItemList().GetItemInstances(); auto& ItemInstances = GetItemList().GetItemInstances();
for (int i = 0; i < ItemInstances.Num(); i++) for (int i = 0; i < ItemInstances.Num(); ++i)
{ {
auto ItemInstance = ItemInstances.At(i); auto ItemInstance = ItemInstances.At(i);
if (ItemInstance->GetItemEntry()->GetItemDefinition()->IsA(FortWeaponMeleeItemDefinitionClass)) if (ItemInstance->GetItemEntry() && ItemInstance->GetItemEntry()->GetItemDefinition() &&
ItemInstance->GetItemEntry()->GetItemDefinition()->IsA(FortWeaponMeleeItemDefinitionClass)
)
{
return ItemInstance; return ItemInstance;
} }
}
return nullptr; return nullptr;
} }

View File

@@ -15,7 +15,7 @@ char UFortInventoryInterface::RemoveInventoryItemHook(__int64 a1, FGuid a2, int
// LOG_INFO(LogDev, "FortPlayerControllerSuperSize: {}", FortPlayerControllerSuperSize); // LOG_INFO(LogDev, "FortPlayerControllerSuperSize: {}", FortPlayerControllerSuperSize);
// LOG_INFO(LogDev, "ControllerObject: {}", ControllerObject->GetFullName()); // LOG_INFO(LogDev, "ControllerObject: {}", ControllerObject->GetFullName());
LOG_INFO(LogDev, __FUNCTION__); // LOG_INFO(LogDev, __FUNCTION__);
if (!ControllerObject) if (!ControllerObject)
return false; return false;

View File

@@ -226,7 +226,7 @@ void AFortPlayerController::ServerLoadingScreenDroppedHook(UObject* Context, FFr
auto PlayerController = (AFortPlayerController*)Context; auto PlayerController = (AFortPlayerController*)Context;
// PlayerController->ApplyCosmeticLoadout(); PlayerController->ApplyCosmeticLoadout();
return ServerLoadingScreenDroppedOriginal(Context, Stack, Ret); return ServerLoadingScreenDroppedOriginal(Context, Stack, Ret);
} }

View File

@@ -2,6 +2,7 @@
#include "FortGameModeAthena.h" #include "FortGameModeAthena.h"
#include "reboot.h" #include "reboot.h"
#include "KismetSystemLibrary.h"
void AFortSafeZoneIndicator::SkipShrinkSafeZone() void AFortSafeZoneIndicator::SkipShrinkSafeZone()
{ {

View File

@@ -127,25 +127,7 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
if (!NewPawn) if (!NewPawn)
return nullptr; return nullptr;
bool bIsRespawning = false; bool bIsRespawning = false; // reel
/*
static auto RespawnDataOffset = PlayerStateAthena->GetOffset("RespawnData", false);
if (RespawnDataOffset != -1)
{
auto RespawnDataPtr = PlayerStateAthena->GetRespawnData();
if (RespawnDataPtr->IsServerReady() && RespawnDataPtr->IsClientReady()) // && GameState->IsRespawningAllowed(PlayerState);
{
bIsRespawning = true;
}
} */
/* auto DeathInfo = (void*)(__int64(PlayerStateAthena) + MemberOffsets::FortPlayerStateAthena::DeathInfo);
FVector DeathLocation = MemberOffsets::DeathInfo::DeathLocation != -1 ? *(FVector*)(__int64(DeathInfo) + MemberOffsets::DeathInfo::DeathLocation) : FVector(0, 0, 0);
bIsRespawning = !(DeathLocation.CompareVectors(FVector(0, 0, 0))); // bro kms */
auto ASC = PlayerStateAthena->GetAbilitySystemComponent(); auto ASC = PlayerStateAthena->GetAbilitySystemComponent();
auto GameState = ((AFortGameModeAthena*)GameMode)->GetGameStateAthena(); auto GameState = ((AFortGameModeAthena*)GameMode)->GetGameStateAthena();
@@ -168,9 +150,8 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
{ {
auto WorldInventory = NewPlayerAsAthena->GetWorldInventory(); auto WorldInventory = NewPlayerAsAthena->GetWorldInventory();
if (!WorldInventory) if (WorldInventory->IsValidLowLevel())
return NewPawn; {
if (!WorldInventory->GetPickaxeInstance()) if (!WorldInventory->GetPickaxeInstance())
{ {
// TODO Check Playlist->bRequirePickaxeInStartingInventory // TODO Check Playlist->bRequirePickaxeInStartingInventory
@@ -226,6 +207,7 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
WorldInventory->Update(); WorldInventory->Update();
} }
} }
}
else else
{ {
// TODO I DONT KNOW WHEN TO DO THIS // TODO I DONT KNOW WHEN TO DO THIS
@@ -249,5 +231,7 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
// NewPlayerAsAthena->RespawnPlayerAfterDeath(true); // NewPlayerAsAthena->RespawnPlayerAfterDeath(true);
} }
// LOG_INFO(LogDev, "Finish SpawnDefaultPawnFor!");
return NewPawn; return NewPawn;
} }

View File

@@ -17,45 +17,41 @@ static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int O
: 0x1F8; // S13-S14 : 0x1F8; // S13-S14
static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase"); static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase");
LOG_INFO(LogDev, "Old SafeZonePhase: {}", GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset));
auto GameState = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState()); auto GameState = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState());
if (!GameState) if (!GameState)
return SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK); return SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
LOG_INFO(LogDev, "GamePhaseStep: {}", (int)GameState->GetGamePhaseStep()); auto SafeZoneIndicator = GameModeAthena->GetSafeZoneIndicator();
if (false)
{
if (Globals::bLateGame)
{
static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase");
static auto GameState_SafeZonePhaseOffset = GameState->GetOffset("SafeZonePhase"); static auto GameState_SafeZonePhaseOffset = GameState->GetOffset("SafeZonePhase");
static int ahaaSafeZonePhase = 4; static int NewLateGameSafeZonePhase = 2;
int NewSafeZonePhase = ahaaSafeZonePhase; // GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset);
const int OriginalOldSafeZonePhase = GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset); LOG_INFO(LogDev, "NewLateGameSafeZonePhase: {}", NewLateGameSafeZonePhase);
if (NewSafeZonePhase < 4)
{
NewSafeZonePhase = 4;
}
LOG_INFO(LogDev, "Setting zone to: {} ({})", NewSafeZonePhase, OriginalOldSafeZonePhase);
GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset) = NewSafeZonePhase;
GameState->Get<int>(GameState_SafeZonePhaseOffset) = NewSafeZonePhase;
ahaaSafeZonePhase++;
}
}
if (Fortnite_Version < 13) if (Fortnite_Version < 13)
return SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK); {
if (Globals::bLateGame.load())
{
GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset) = NewLateGameSafeZonePhase;
GameState->Get<int>(GameState_SafeZonePhaseOffset) = NewLateGameSafeZonePhase;
SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
static auto SafeZoneIndicatorOffset = GameModeAthena->GetOffset("SafeZoneIndicator"); if (NewLateGameSafeZonePhase == 2 || NewLateGameSafeZonePhase == 3)
auto SafeZoneIndicator = GameModeAthena->Get<AActor*>(SafeZoneIndicatorOffset); {
if (SafeZoneIndicator)
SafeZoneIndicator->SkipShrinkSafeZone();
else
LOG_WARN(LogZone, "Invalid SafeZoneIndicator!");
}
NewLateGameSafeZonePhase++;
return;
}
return SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
}
if (!SafeZoneIndicator) if (!SafeZoneIndicator)
{ {
@@ -103,23 +99,8 @@ static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int O
if (!FortGameData) if (!FortGameData)
FortGameData = FindObject<UCurveTable>(L"/Game/Balance/AthenaGameData.AthenaGameData"); FortGameData = FindObject<UCurveTable>(L"/Game/Balance/AthenaGameData.AthenaGameData");
// LOG_INFO(LogDev, "FortGameData: {}", FortGameData ? FortGameData->GetFullName() : "InvalidObject");
auto ShrinkTimeFName = UKismetStringLibrary::Conv_StringToName(L"Default.SafeZone.ShrinkTime"); auto ShrinkTimeFName = UKismetStringLibrary::Conv_StringToName(L"Default.SafeZone.ShrinkTime");
auto HoldTimeFName = UKismetStringLibrary::Conv_StringToName(L"Default.SafeZone.WaitTime"); auto HoldTimeFName = UKismetStringLibrary::Conv_StringToName(L"Default.SafeZone.WaitTime");
FString ContextString;
/* for (int i = 0; i < 10; i++)
{
LOG_INFO(LogDev, "[{}] Value {}", i, FortGameData->GetValueOfKey(FortGameData->GetKey(ShrinkTimeFName, i)));
} */
/* for (float i = 0; i < 1.1; i += 0.1)
{
float res;
UDataTableFunctionLibrary::EvaluateCurveTableRow(FortGameData, ShrinkTimeFName, i, ContextString, nullptr, &res);
LOG_INFO(LogZone, "[{}] {}", i, res);
} */
for (int i = 0; i < ZoneDurations.Num(); i++) for (int i = 0; i < ZoneDurations.Num(); i++)
{ {
@@ -129,26 +110,23 @@ static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int O
{ {
ZoneHoldDurations.at(i) = FortGameData->GetValueOfKey(FortGameData->GetKey(HoldTimeFName, i)); ZoneHoldDurations.at(i) = FortGameData->GetValueOfKey(FortGameData->GetKey(HoldTimeFName, i));
} }
/*
for (int i = 0; i < ZoneDurations.Num(); i++)
{
LOG_INFO(LogZone, "Move [{}] {}", i, ZoneDurations.at(i));
}
for (int i = 0; i < ZoneHoldDurations.Num(); i++)
{
LOG_INFO(LogZone, "Hold [{}] {}", i, ZoneHoldDurations.at(i));
}
*/
} }
LOG_INFO(LogZone, "SafeZonePhase: {}", GameModeAthena->Get<int>(SafeZonePhaseOffset)); LOG_INFO(LogZone, "SafeZonePhase: {}", GameModeAthena->Get<int>(SafeZonePhaseOffset));
LOG_INFO(LogZone, "OverridePhaseMaybeIDFK: {}", OverridePhaseMaybeIDFK); LOG_INFO(LogZone, "OverridePhaseMaybeIDFK: {}", OverridePhaseMaybeIDFK);
LOG_INFO(LogZone, "TimeSeconds: {}", UGameplayStatics::GetTimeSeconds(GetWorld())); LOG_INFO(LogZone, "TimeSeconds: {}", UGameplayStatics::GetTimeSeconds(GetWorld()));
if (Globals::bLateGame.load())
{
GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset) = NewLateGameSafeZonePhase;
GameState->Get<int>(GameState_SafeZonePhaseOffset) = NewLateGameSafeZonePhase;
SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK); SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
NewLateGameSafeZonePhase++;
}
else
{
SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
}
LOG_INFO(LogZone, "SafeZonePhase After: {}", GameModeAthena->Get<int>(SafeZonePhaseOffset)); LOG_INFO(LogZone, "SafeZonePhase After: {}", GameModeAthena->Get<int>(SafeZonePhaseOffset));
@@ -168,6 +146,14 @@ static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int O
LOG_INFO(LogZone, "Duration: {}", SafeZoneIndicator->Get<float>(RadiusOffset)); LOG_INFO(LogZone, "Duration: {}", SafeZoneIndicator->Get<float>(RadiusOffset));
SafeZoneIndicator->Get<float>(SafeZoneFinishShrinkTimeOffset) = SafeZoneIndicator->Get<float>(SafeZoneStartShrinkTimeOffset) + ZoneDuration; SafeZoneIndicator->Get<float>(SafeZoneFinishShrinkTimeOffset) = SafeZoneIndicator->Get<float>(SafeZoneStartShrinkTimeOffset) + ZoneDuration;
if (NewLateGameSafeZonePhase == 3 || NewLateGameSafeZonePhase == 4)
{
if (SafeZoneIndicator)
SafeZoneIndicator->SkipShrinkSafeZone();
else
LOG_WARN(LogZone, "Invalid SafeZoneIndicator!");
}
} }
static inline void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters) static inline void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters)

View File

@@ -645,7 +645,8 @@ DWORD WINAPI Main(LPVOID)
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameMode.ReadyToStartMatch"), AFortGameModeAthena::Athena_ReadyToStartMatchHook, Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameMode.ReadyToStartMatch"), AFortGameModeAthena::Athena_ReadyToStartMatchHook,
(PVOID*)&AFortGameModeAthena::Athena_ReadyToStartMatchOriginal, false, false, true); (PVOID*)&AFortGameModeAthena::Athena_ReadyToStartMatchOriginal, false, false, true);
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortGameModeAthena.OnAircraftEnteredDropZone"), AFortGameModeAthena::OnAircraftEnteredDropZoneHook,
(PVOID*)&AFortGameModeAthena::OnAircraftEnteredDropZoneOriginal, false, false, true, true);
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameModeBase.SpawnDefaultPawnFor"), Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameModeBase.SpawnDefaultPawnFor"),
AGameModeBase::SpawnDefaultPawnForHook, nullptr, false); AGameModeBase::SpawnDefaultPawnForHook, nullptr, false);
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameModeBase.HandleStartingNewPlayer"), AFortGameModeAthena::Athena_HandleStartingNewPlayerHook, Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameModeBase.HandleStartingNewPlayer"), AFortGameModeAthena::Athena_HandleStartingNewPlayerHook,

View File

@@ -479,6 +479,190 @@ static inline void PlayerTabs()
} }
} }
static inline DWORD WINAPI LateGameThread(LPVOID)
{
float MaxTickRate = 30;
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
auto GameState = Cast<AFortGameStateAthena>(GameMode->GetGameState());
auto GetAircrafts = [&]() -> std::vector<AActor*>
{
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
std::vector<AActor*> Aircrafts;
if (AircraftsOffset == -1)
{
// GameState->Aircraft
static auto FortAthenaAircraftClass = FindObject<UClass>(L"/Script/FortniteGame.FortAthenaAircraft");
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
for (int i = 0; i < AllAircrafts.Num(); i++)
{
Aircrafts.push_back(AllAircrafts.at(i));
}
AllAircrafts.Free();
}
else
{
const auto& GameStateAircrafts = GameState->Get<TArray<AActor*>>(AircraftsOffset);
for (int i = 0; i < GameStateAircrafts.Num(); i++)
{
Aircrafts.push_back(GameStateAircrafts.at(i));
}
}
return Aircrafts;
};
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
while (GetAircrafts().size() <= 0)
{
Sleep(1000 / MaxTickRate);
}
static auto SafeZoneLocationsOffset = GameMode->GetOffset("SafeZoneLocations");
const TArray<FVector>& SafeZoneLocations = GameMode->Get<TArray<FVector>>(SafeZoneLocationsOffset);
if (SafeZoneLocations.Num() < 4)
{
LOG_WARN(LogLateGame, "Unable to find SafeZoneLocation! Disabling lategame..");
Globals::bLateGame.store(false);
return 0;
}
const FVector ZoneCenterLocation = SafeZoneLocations.at(3);
FVector LocationToStartAircraft = ZoneCenterLocation;
LocationToStartAircraft.Z += 10000;
auto Aircrafts = GetAircrafts();
float DropStartTime = GameState->GetServerWorldTimeSeconds() + 5.f;
float FlightSpeed = 0.0f;
for (int i = 0; i < Aircrafts.size(); ++i)
{
auto CurrentAircraft = Aircrafts.at(i);
CurrentAircraft->TeleportTo(LocationToStartAircraft, FRotator());
static auto FlightInfoOffset = CurrentAircraft->GetOffset("FlightInfo", false);
if (FlightInfoOffset == -1)
{
static auto FlightStartLocationOffset = CurrentAircraft->GetOffset("FlightStartLocation");
static auto FlightSpeedOffset = CurrentAircraft->GetOffset("FlightSpeed");
static auto DropStartTimeOffset = CurrentAircraft->GetOffset("DropStartTime");
CurrentAircraft->Get<FVector>(FlightStartLocationOffset) = LocationToStartAircraft;
CurrentAircraft->Get<float>(FlightSpeedOffset) = FlightSpeed;
CurrentAircraft->Get<float>(DropStartTimeOffset) = DropStartTime;
}
else
{
auto FlightInfo = CurrentAircraft->GetPtr<FAircraftFlightInfo>(FlightInfoOffset);
FlightInfo->GetFlightSpeed() = FlightSpeed;
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
FlightInfo->GetTimeTillDropStart() = DropStartTime;
}
}
while (GameState->GetGamePhase() != EAthenaGamePhase::Aircraft)
{
Sleep(1000 / MaxTickRate);
}
/*
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
auto MapInfo = GameState->Get(MapInfoOffset);
if (MapInfo)
{
static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos", false);
if (FlightInfosOffset != -1)
{
auto& FlightInfos = MapInfo->Get<TArray<FAircraftFlightInfo>>(FlightInfosOffset);
for (int i = 0; i < FlightInfos.Num(); i++)
{
auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize());
FlightInfo->GetFlightSpeed() = FlightSpeed;
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
FlightInfo->GetTimeTillDropStart() = DropStartTime;
}
}
}
*/
while (GameState->GetGamePhase() == EAthenaGamePhase::Aircraft)
{
Sleep(1000 / MaxTickRate);
}
static auto World_NetDriverOffset = GetWorld()->GetOffset("NetDriver");
auto WorldNetDriver = GetWorld()->Get<UNetDriver*>(World_NetDriverOffset);
auto& ClientConnections = WorldNetDriver->GetClientConnections();
for (int z = 0; z < ClientConnections.Num(); z++)
{
auto ClientConnection = ClientConnections.at(z);
auto FortPC = Cast<AFortPlayerController>(ClientConnection->GetPlayerController());
if (!FortPC)
continue;
auto WorldInventory = FortPC->GetWorldInventory();
if (!WorldInventory)
continue;
static auto WoodItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/WoodItemData.WoodItemData");
static auto StoneItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/StoneItemData.StoneItemData");
static auto MetalItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/MetalItemData.MetalItemData");
static auto Rifle = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Assault_AutoHigh_Athena_SR_Ore_T03.WID_Assault_AutoHigh_Athena_SR_Ore_T03");
static auto Shotgun = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03")
? FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03")
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_C_Ore_T03.WID_Shotgun_Standard_Athena_C_Ore_T03");
static auto SMG = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03")
? FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03")
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavySuppressed_Athena_R_Ore_T03.WID_Pistol_AutoHeavySuppressed_Athena_R_Ore_T03");
static auto MiniShields = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Consumables/ShieldSmall/Athena_ShieldSmall.Athena_ShieldSmall");
static auto Shells = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataShells.AthenaAmmoDataShells");
static auto Medium = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsMedium.AthenaAmmoDataBulletsMedium");
static auto Light = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsLight.AthenaAmmoDataBulletsLight");
static auto Heavy = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsHeavy.AthenaAmmoDataBulletsHeavy");
WorldInventory->AddItem(WoodItemData, nullptr, 500);
WorldInventory->AddItem(StoneItemData, nullptr, 500);
WorldInventory->AddItem(MetalItemData, nullptr, 500);
WorldInventory->AddItem(Rifle, nullptr, 1);
WorldInventory->AddItem(Shotgun, nullptr, 1);
WorldInventory->AddItem(SMG, nullptr, 1);
WorldInventory->AddItem(MiniShields, nullptr, 6);
WorldInventory->AddItem(Shells, nullptr, 999);
WorldInventory->AddItem(Medium, nullptr, 999);
WorldInventory->AddItem(Light, nullptr, 999);
WorldInventory->AddItem(Heavy, nullptr, 999);
WorldInventory->Update();
}
static auto SafeZonesStartTimeOffset = GameState->GetOffset("SafeZonesStartTime");
GameState->Get<float>(SafeZonesStartTimeOffset) = 0.001f;
return 0;
}
static inline void MainUI() static inline void MainUI()
{ {
bool bLoaded = true; bool bLoaded = true;
@@ -520,7 +704,7 @@ static inline void MainUI()
if (GameState) if (GameState)
{ {
static auto DefaultGliderRedeployCanRedeployOffset = FindOffsetStruct("/Script/FortniteGame.FortGameStateAthena", "DefaultGliderRedeployCanRedeploy"); static auto DefaultGliderRedeployCanRedeployOffset = FindOffsetStruct("/Script/FortniteGame.FortGameStateAthena", "DefaultGliderRedeployCanRedeploy", false);
if (DefaultGliderRedeployCanRedeployOffset != -1) if (DefaultGliderRedeployCanRedeployOffset != -1)
{ {
@@ -612,226 +796,14 @@ static inline void MainUI()
AmountOfPlayersWhenBusStart = GameState->GetPlayersLeft(); AmountOfPlayersWhenBusStart = GameState->GetPlayersLeft();
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
if (Globals::bLateGame.load()) if (Globals::bLateGame.load())
{ {
auto GetAircrafts = [&]() -> TArray<AActor*> CreateThread(0, 0, LateGameThread, 0, 0, 0);
{
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
if (AircraftsOffset == -1)
{
// GameState->Aircraft
static auto FortAthenaAircraftClass = FindObject<UClass>(L"/Script/FortniteGame.FortAthenaAircraft");
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
return AllAircrafts;
}
return GameState->Get<TArray<AActor*>>(AircraftsOffset);
};
while (GetAircrafts().Num() <= 0) // hmm
{
Sleep(500);
}
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startsafezone", nullptr);
static auto SafeZoneIndicatorOffset = GameState->GetOffset("SafeZoneIndicator");
static auto SafeZonesStartTimeOffset = GameState->GetOffset("SafeZonesStartTime");
GameState->Get<float>(SafeZonesStartTimeOffset) = 0;
LOG_INFO(LogDev, "Waiting for SafeZoneIndicator..");
while (!GameState->Get(SafeZoneIndicatorOffset))
{
Sleep(500);
}
LOG_INFO(LogDev, "SafeZoneIndicator is valid!");
while (GetAircrafts().Num() <= 0) // hmm
{
Sleep(500);
}
static auto NextNextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextNextCenter", false);
static auto NextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextCenter");
FVector LocationToStartAircraft = GameState->Get(SafeZoneIndicatorOffset)->Get<FVector>(NextNextCenterOffset == -1 ? NextCenterOffset : NextNextCenterOffset); // SafeZoneLocations.at(4);
LocationToStartAircraft.Z += 10000;
for (int i = 0; i < GetAircrafts().Num(); i++)
{
auto CurrentAircraft = GetAircrafts().at(i);
CurrentAircraft->TeleportTo(LocationToStartAircraft, FRotator());
static auto FlightInfoOffset = CurrentAircraft->GetOffset("FlightInfo", false);
float FlightSpeed = 0.0f;
if (FlightInfoOffset == -1)
{
static auto FlightStartLocationOffset = CurrentAircraft->GetOffset("FlightStartLocation");
static auto FlightSpeedOffset = CurrentAircraft->GetOffset("FlightSpeed");
static auto DropStartTimeOffset = CurrentAircraft->GetOffset("DropStartTime");
CurrentAircraft->Get<FVector>(FlightStartLocationOffset) = LocationToStartAircraft;
CurrentAircraft->Get<float>(FlightSpeedOffset) = FlightSpeed;
CurrentAircraft->Get<float>(DropStartTimeOffset) = GameState->GetServerWorldTimeSeconds();
} }
else else
{ {
auto FlightInfo = CurrentAircraft->GetPtr<FAircraftFlightInfo>(FlightInfoOffset);
FlightInfo->GetFlightSpeed() = FlightSpeed;
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
FlightInfo->GetTimeTillDropStart() = 0.0f;
}
}
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
auto MapInfo = GameState->Get(MapInfoOffset);
if (MapInfo)
{
static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos", false);
if (FlightInfosOffset != -1)
{
auto& FlightInfos = MapInfo->Get<TArray<FAircraftFlightInfo>>(FlightInfosOffset);
LOG_INFO(LogDev, "FlightInfos.Num(): {}", FlightInfos.Num());
for (int i = 0; i < FlightInfos.Num(); i++)
{
auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize());
FlightInfo->GetFlightSpeed() = 0;
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
FlightInfo->GetTimeTillDropStart() = 0.0f;
}
}
}
static auto bAircraftIsLockedOffset = GameState->GetOffset("bAircraftIsLocked");
static auto bAircraftIsLockedFieldMask = GetFieldMask(GameState->GetProperty("bAircraftIsLocked"));
GameState->SetBitfieldValue(bAircraftIsLockedOffset, bAircraftIsLockedFieldMask, false);
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipaircraft", nullptr);
static auto World_NetDriverOffset = GetWorld()->GetOffset("NetDriver");
auto WorldNetDriver = GetWorld()->Get<UNetDriver*>(World_NetDriverOffset);
auto& ClientConnections = WorldNetDriver->GetClientConnections();
for (int z = 0; z < ClientConnections.Num(); z++)
{
auto ClientConnection = ClientConnections.at(z);
auto FortPC = Cast<AFortPlayerController>(ClientConnection->GetPlayerController());
if (!FortPC)
continue;
auto WorldInventory = FortPC->GetWorldInventory();
if (!WorldInventory)
continue;
static auto WoodItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/WoodItemData.WoodItemData");
static auto StoneItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/StoneItemData.StoneItemData");
static auto MetalItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/MetalItemData.MetalItemData");
static auto Rifle = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Assault_AutoHigh_Athena_SR_Ore_T03.WID_Assault_AutoHigh_Athena_SR_Ore_T03");
static auto Shotgun = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03")
? FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03")
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_C_Ore_T03.WID_Shotgun_Standard_Athena_C_Ore_T03");
static auto SMG = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03")
? FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03")
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavySuppressed_Athena_R_Ore_T03.WID_Pistol_AutoHeavySuppressed_Athena_R_Ore_T03");
static auto MiniShields = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Consumables/ShieldSmall/Athena_ShieldSmall.Athena_ShieldSmall");
static auto Shells = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataShells.AthenaAmmoDataShells");
static auto Medium = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsMedium.AthenaAmmoDataBulletsMedium");
static auto Light = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsLight.AthenaAmmoDataBulletsLight");
static auto Heavy = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsHeavy.AthenaAmmoDataBulletsHeavy");
WorldInventory->AddItem(WoodItemData, nullptr, 500);
WorldInventory->AddItem(StoneItemData, nullptr, 500);
WorldInventory->AddItem(MetalItemData, nullptr, 500);
WorldInventory->AddItem(Rifle, nullptr, 1);
WorldInventory->AddItem(Shotgun, nullptr, 1);
WorldInventory->AddItem(SMG, nullptr, 1);
WorldInventory->AddItem(MiniShields, nullptr, 6);
WorldInventory->AddItem(Shells, nullptr, 999);
WorldInventory->AddItem(Medium, nullptr, 999);
WorldInventory->AddItem(Light, nullptr, 999);
WorldInventory->AddItem(Heavy, nullptr, 999);
WorldInventory->Update();
} }
auto SafeZoneIndicator = GameMode->GetSafeZoneIndicator();
if (SafeZoneIndicator)
{
SetZoneToIndexHook(GameMode, -1);
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr);
SafeZoneIndicator->SkipShrinkSafeZone();
/*
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr);
SafeZoneIndicator->SkipShrinkSafeZone();
bool bBreak = false;
int a = 0;
while (!bBreak)
{
for (int z = 0; z < ClientConnections.Num(); z++)
{
auto ClientConnection = ClientConnections.at(z);
auto FortPC = Cast<AFortPlayerController>(ClientConnection->GetPlayerController());
if (!FortPC)
continue;
if (FortPC->GetMyFortPawn())
{
bBreak = true;
break;
}
}
if (++a >= 5)
bBreak = true;
Sleep(1000);
}
SafeZoneIndicator->SkipShrinkSafeZone();
if (Engine_Version >= 424)
{
Sleep(1000);
SafeZoneIndicator->SkipShrinkSafeZone();
}
*/
}
else
{
LOG_WARN(LogDev, "Invalid Indicator!");
}
}
LOG_INFO(LogDev, "Finished!");
} }
} }
else else
@@ -1343,7 +1315,7 @@ static inline void PregameUI()
if (!bSwitchedInitialLevel) if (!bSwitchedInitialLevel)
{ {
ImGui::Checkbox("Use Custom Map", &bUseCustomMap); // ImGui::Checkbox("Use Custom Map", &bUseCustomMap);
if (bUseCustomMap) if (bUseCustomMap)
{ {

View File

@@ -193,7 +193,7 @@ inline __int64 GetFunctionIdxOrPtr(UFunction* Function, bool bBreakWhenHitRet =
} }
} }
if ((*(uint8_t*)(NativeAddr + i) == 0x48 && *(uint8_t*)(NativeAddr + i + 1) == 0xFF) && *(uint8_t*)(NativeAddr + i + 2) == 0xA0) // jmp qword ptr if (*(uint8_t*)(NativeAddr + i) == 0x48 && *(uint8_t*)(NativeAddr + i + 1) == 0xFF && *(uint8_t*)(NativeAddr + i + 2) == 0xA0) // jmp qword ptr
{ {
if (bFoundValidate) if (bFoundValidate)
{ {
@@ -295,7 +295,7 @@ namespace Hooking
// *(int32_t*)(instrAddr + 1) = static_cast<int32_t>(delta); // *(int32_t*)(instrAddr + 1) = static_cast<int32_t>(delta);
} }
static bool Hook(UObject* DefaultClass, UFunction* Function, void* Detour, void** Original = nullptr, bool bUseSecondMethod = true, bool bHookExec = false, bool bOverride = true) // Native hook static bool Hook(UObject* DefaultClass, UFunction* Function, void* Detour, void** Original = nullptr, bool bUseSecondMethod = true, bool bHookExec = false, bool bOverride = true, bool bBreakWhenRet = false) // Native hook
{ {
if (!bOverride) if (!bOverride)
return false; return false;
@@ -324,7 +324,7 @@ namespace Hooking
return true; return true;
} }
auto AddrOrIdx = bUseSecondMethod ? GetFunctionIdxOrPtr2(Function) : GetFunctionIdxOrPtr(Function); auto AddrOrIdx = bUseSecondMethod ? GetFunctionIdxOrPtr2(Function) : GetFunctionIdxOrPtr(Function, bBreakWhenRet);
if (AddrOrIdx == -1) if (AddrOrIdx == -1)
{ {

View File

@@ -87,6 +87,7 @@ inline void InitLogger()
MakeLogger("LogMatchmaker"); MakeLogger("LogMatchmaker");
MakeLogger("LogRebooting"); MakeLogger("LogRebooting");
MakeLogger("LogObjectViewer"); MakeLogger("LogObjectViewer");
MakeLogger("LogLateGame");
} }
#define LOG_DEBUG(loggerName, ...) \ #define LOG_DEBUG(loggerName, ...) \