From 0f6a2794200e5159e1f43d71ccfb145992375892 Mon Sep 17 00:00:00 2001 From: Gray <84999745+Milxnor@users.noreply.github.com> Date: Fri, 15 Mar 2024 18:51:10 -0400 Subject: [PATCH 1/2] w --- Project Reboot 3.0/FortGameModeAthena.cpp | 13 +++++++++++++ Project Reboot 3.0/FortPlayerController.cpp | 2 +- .../Project Reboot 3.0.vcxproj.filters | 3 ++- Project Reboot 3.0/dllmain.cpp | 16 ++++++++-------- Project Reboot 3.0/gui.h | 1 + 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index 4996dab..4eb735c 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -986,6 +986,19 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game LOG_INFO(LogDev, "bShouldUseReplicationGraph: {}", Globals::bShouldUseReplicationGraph); + if (Fortnite_Version >= 2.42 && Fortnite_Version < 3.4) + { + static auto FortHLODSMActorClass = FindObject("/Script/FortniteGame.FortHLODSMActor"); + auto FortHLODSMActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortHLODSMActorClass); + + for (int i = 0; i < FortHLODSMActors.Num(); ++i) + { + FortHLODSMActors.at(i)->K2_DestroyActor(); + } + + LOG_INFO(LogDev, "Destroyed HLODs!"); + } + Globals::bStartedListening = true; } diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index df2df49..6151ac4 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -1793,7 +1793,7 @@ void AFortPlayerController::ServerEndEditingBuildingActorHook(AFortPlayerControl FGuid EditToolGuid = EditToolInstance->GetItemEntry()->GetItemGuid(); // Should we ref? -#if 1 +#if 0 EditTool = Cast(Pawn->EquipWeaponDefinition(EditToolDef, EditToolGuid)); // ERM #else Cast(Pawn->EquipWeaponDefinition(EditToolDef, EditToolGuid)); // ERM diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters index 2b45796..841b174 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters @@ -961,7 +961,8 @@ Engine\Source\Runtime\Engine\Classes\Engine - + + Reboot\Public diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index d094f71..6636a55 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -212,7 +212,7 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index) static auto OnRep_ReplicatedActivePhaseIndexFn = FindObject("/Script/SpecialEventGameplayRuntime.SpecialEventScript.OnRep_ReplicatedActivePhaseIndex"); SpecialEventScript->ProcessEvent(OnRep_ReplicatedActivePhaseIndexFn); - auto ClientConnections = GetWorld()->GetNetDriver()->GetClientConnections(); + auto& ClientConnections = GetWorld()->GetNetDriver()->GetClientConnections(); // Rift Tour if (Fortnite_Version == 17.30) @@ -248,11 +248,11 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index) } if (Index == 2) // Slide { - auto Script = FindObject("/Buffet/Levels/Buffet_Part_4.Buffet_Part_4.PersistentLevel.BP_Buffet_PhaseScripting_Paint_4"); + auto Script = FindObject(L"/Buffet/Levels/Buffet_Part_4.Buffet_Part_4.PersistentLevel.BP_Buffet_PhaseScripting_Paint_4"); auto SplineActor = Script->Get(Script->GetOffset("SplineActor")); auto PawnLocation = Script->Get(Script->GetOffset("PawnLocation")) = SplineActor; - auto AllWrapsSpawners = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject("/Script/SpecialEventGameplayRuntime.FortSpecialRelevancyActorSpawner")); + auto AllWrapsSpawners = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject(L"/Script/SpecialEventGameplayRuntime.FortSpecialRelevancyActorSpawner")); for (int i = 0; i < AllWrapsSpawners.Num(); i++) { @@ -266,11 +266,11 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index) if (CurrentWrapSpawner->GetName().contains("WrapChangePickup")) { - ClassToSpawn = FindObject("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_WrapChangePickup.BP_Buffet_Paint_WrapChangePickup_C"); + ClassToSpawn = FindObject(L"/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_WrapChangePickup.BP_Buffet_Paint_WrapChangePickup_C"); } else if (CurrentWrapSpawner->GetName().contains("Paint_Pickup")) { - ClassToSpawn = FindObject("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_Pickup.BP_Buffet_Paint_Pickup_C"); + ClassToSpawn = FindObject(L"/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_Pickup.BP_Buffet_Paint_Pickup_C"); } auto SpawnedWrap = GetWorld()->SpawnActor(ClassToSpawn, WrapSpawnerLocation, WrapSpawnerRotation.Quaternion(), FVector(1, 1, 1), CreateSpawnParameters(ESpawnActorCollisionHandlingMethod::AlwaysSpawn, true, nullptr)); @@ -292,8 +292,8 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index) for (int i = 0; i < ClientConnections.Num(); i++) { - auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); auto CurrentController = ClientConnections.At(i)->GetPlayerController(); + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); if (!CurrentPawn) continue; @@ -368,7 +368,7 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index) SendMessageToConsole(CurrentController, L"Gave WID_Buffet_BeatMatchingBoomBox!"); } - auto AllWeps = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject("/Buffet/Gameplay/Blueprints/WolfMother/BeatmatchingWeapon/B_Buffet_BeatMatchingWeaponPrototype.B_Buffet_BeatMatchingWeaponPrototype_C")); + auto AllWeps = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject(L"/Buffet/Gameplay/Blueprints/WolfMother/BeatmatchingWeapon/B_Buffet_BeatMatchingWeaponPrototype.B_Buffet_BeatMatchingWeaponPrototype_C")); for (int i = 0; i < AllWeps.Num(); i++) { @@ -382,7 +382,7 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index) } if (Index == 6) // Ariana { - auto ReflectScript = FindObject("/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Stars_2"); + auto ReflectScript = FindObject(L"/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Stars_2"); for (int i = 0; i < ClientConnections.Num(); i++) { diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index f69703a..5ecad51 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -1460,6 +1460,7 @@ static inline DWORD WINAPI GuiThread(LPVOID) // Initialize Direct3D if (!CreateDeviceD3D(hwnd)) { + LOG_ERROR(LogDev, "Failed to create D3D Device!"); CleanupDeviceD3D(); ::UnregisterClass(wc.lpszClassName, wc.hInstance); return 1; From 496e452160fd52a2321911921c1f8e9e4e091741 Mon Sep 17 00:00:00 2001 From: Gray <84999745+Milxnor@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:35:51 -0400 Subject: [PATCH 2/2] fix 3.2 --- Project Reboot 3.0/BuildingActor.h | 2 +- Project Reboot 3.0/FortGameModeAthena.cpp | 17 ++----------- Project Reboot 3.0/FortPlayerController.cpp | 28 +++------------------ Project Reboot 3.0/addresses.cpp | 2 +- Project Reboot 3.0/reboot.h | 4 +-- 5 files changed, 9 insertions(+), 44 deletions(-) diff --git a/Project Reboot 3.0/BuildingActor.h b/Project Reboot 3.0/BuildingActor.h index 5d72862..220d78f 100644 --- a/Project Reboot 3.0/BuildingActor.h +++ b/Project Reboot 3.0/BuildingActor.h @@ -18,7 +18,7 @@ public: UObject* ReplacedBuilding; // this also not on like below 18.00 } IBAParams{ BuildingOwner, Controller, bUsePlayerBuildAnimations, ReplacedBuilding }; - static auto fn = FindObject("/Script/FortniteGame.BuildingActor.InitializeKismetSpawnedBuildingActor"); + static auto fn = FindObject(L"/Script/FortniteGame.BuildingActor.InitializeKismetSpawnedBuildingActor"); this->ProcessEvent(fn, &IBAParams); } diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index 4eb735c..fb65e84 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -986,19 +986,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game LOG_INFO(LogDev, "bShouldUseReplicationGraph: {}", Globals::bShouldUseReplicationGraph); - if (Fortnite_Version >= 2.42 && Fortnite_Version < 3.4) - { - static auto FortHLODSMActorClass = FindObject("/Script/FortniteGame.FortHLODSMActor"); - auto FortHLODSMActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortHLODSMActorClass); - - for (int i = 0; i < FortHLODSMActors.Num(); ++i) - { - FortHLODSMActors.at(i)->K2_DestroyActor(); - } - - LOG_INFO(LogDev, "Destroyed HLODs!"); - } - Globals::bStartedListening = true; } @@ -1169,7 +1156,7 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint } } - LOG_INFO(LogTeams, "Spreading Teams {} Player is going on team {}/{} with {} members.", bShouldSpreadTeams, NextTeamIndex, TeamsNum, CurrentTeamMembers); + LOG_INFO(LogTeams, "Spreading Teams {} Player is going on team {}/{} with {} members.", bShouldSpreadTeams, NextTeamIndex - 2, TeamsNum, CurrentTeamMembers); CurrentTeamMembers++; @@ -1239,7 +1226,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena static auto BGAClass = FindObject(L"/Script/Engine.BlueprintGeneratedClass"); UObject* OverrideBattleBusSkin = nullptr; - UClass* OverrideSupplyDropClass = LoadObject(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop.AthenaSupplyDrop_C", BGAClass); + UClass* OverrideSupplyDropClass = LoadObject(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop.AthenaSupplyDrop_C", BGAClass); // wrong for some builds but its ok if (Fortnite_Version == 1.11 || Fortnite_Version == 7.30 || Fortnite_Version == 11.31 || Fortnite_Version == 15.10 || Fortnite_Version == 19.10) { diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index 6151ac4..acb42a5 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -842,7 +842,7 @@ void AFortPlayerController::ServerCreateBuildingActorHook(UObject* Context, FFra if (!WorldInventory) return ServerCreateBuildingActorOriginal(Context, Stack, Ret); - auto PlayerStateAthena = Cast(PlayerController->GetPlayerState()); + auto PlayerStateAthena = Cast(PlayerController->GetPlayerState()); if (!PlayerStateAthena) return ServerCreateBuildingActorOriginal(Context, Stack, Ret); @@ -885,7 +885,7 @@ void AFortPlayerController::ServerCreateBuildingActorHook(UObject* Context, FFra if (!BuildingClass) return ServerCreateBuildingActorOriginal(Context, Stack, Ret); - auto GameState = Cast(Cast(GetWorld()->GetGameMode(), false)->GetGameState(), false); + auto GameState = Cast(Cast(GetWorld()->GetGameMode())->GetGameState()); auto StructuralSupportSystem = GameState->GetStructuralSupportSystem(); @@ -1707,11 +1707,7 @@ void AFortPlayerController::ServerBeginEditingBuildingActorHook(AFortPlayerContr AFortWeap_EditingTool* EditTool = nullptr; -#if 1 EditTool = Cast(Pawn->EquipWeaponDefinition(EditToolDef, EditToolInstance->GetItemEntry()->GetItemGuid())); -#else - EditTool = Cast(Pawn->GetCurrentWeapon()); -#endif if (!EditTool) return; @@ -1783,25 +1779,7 @@ void AFortPlayerController::ServerEndEditingBuildingActorHook(AFortPlayerControl if (!WorldInventory) return; - AFortWeap_EditingTool* EditTool = nullptr; - -#if 1 - auto EditToolInstance = WorldInventory->FindItemInstance(EditToolDef); - - if (!EditToolInstance) - return; - - FGuid EditToolGuid = EditToolInstance->GetItemEntry()->GetItemGuid(); // Should we ref? - -#if 0 - EditTool = Cast(Pawn->EquipWeaponDefinition(EditToolDef, EditToolGuid)); // ERM -#else - Cast(Pawn->EquipWeaponDefinition(EditToolDef, EditToolGuid)); // ERM - EditTool = Cast(Pawn->GetCurrentWeapon()); -#endif -#else - EditTool = Cast(Pawn->GetCurrentWeapon()); -#endif + AFortWeap_EditingTool* EditTool = Cast(Pawn->GetCurrentWeapon()); if (EditTool) { diff --git a/Project Reboot 3.0/addresses.cpp b/Project Reboot 3.0/addresses.cpp index 46ec684..20ef44d 100644 --- a/Project Reboot 3.0/addresses.cpp +++ b/Project Reboot 3.0/addresses.cpp @@ -478,7 +478,7 @@ void Offsets::FindAll() } if (Fortnite_Version == 3.2) { - Offsets::NetworkObjectList = 0x4F8; + Offsets::NetworkObjectList = 0x500; Offsets::ClientWorldPackageName = 0x1820; } if (Fortnite_Version == 3.2 || Fortnite_Version == 3.3) diff --git a/Project Reboot 3.0/reboot.h b/Project Reboot 3.0/reboot.h index 4409242..d7cbaf1 100644 --- a/Project Reboot 3.0/reboot.h +++ b/Project Reboot 3.0/reboot.h @@ -122,8 +122,8 @@ static inline UObject* GetLocalPlayerController() return LocalPlayer->Get(PlayerControllerOffset); } -template -static __forceinline T* Cast(UObject* Object, bool bCheckType = true) +template +static __forceinline T* Cast(UObject* Object) { if (bCheckType) {