mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
fixed mcp on s1-s7
This commit is contained in:
@@ -568,7 +568,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
|||||||
|
|
||||||
int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller)
|
int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller)
|
||||||
{
|
{
|
||||||
LOG_INFO(LogTeam, "PickTeam called!");
|
LOG_INFO(LogTeams, "PickTeam called!");
|
||||||
|
|
||||||
auto GameState = Cast<AFortGameStateAthena>(GameMode->GetGameState());
|
auto GameState = Cast<AFortGameStateAthena>(GameMode->GetGameState());
|
||||||
|
|
||||||
@@ -583,6 +583,7 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
|
|||||||
CurrentTeamMembers = 0;
|
CurrentTeamMembers = 0;
|
||||||
static int Current = 3;
|
static int Current = 3;
|
||||||
CurrentTeamMembers++;
|
CurrentTeamMembers++;
|
||||||
|
LOG_INFO(LogTeams, "Player is going on team {} with {} members (No Playlist).", Current, CurrentTeamMembers);
|
||||||
return Current++;
|
return Current++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,6 +603,8 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
|
|||||||
|
|
||||||
CurrentTeamMembers++;
|
CurrentTeamMembers++;
|
||||||
|
|
||||||
|
LOG_INFO(LogTeams, "Player is going on team {} with {} members.", NextTeamIndex, CurrentTeamMembers);
|
||||||
|
|
||||||
return NextTeamIndex;
|
return NextTeamIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -667,8 +667,14 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
|
|||||||
if (MemberOffsets::FortPlayerState::PawnDeathLocation != 0)
|
if (MemberOffsets::FortPlayerState::PawnDeathLocation != 0)
|
||||||
DeadPlayerState->Get<FVector>(MemberOffsets::FortPlayerState::PawnDeathLocation) = DeathLocation;
|
DeadPlayerState->Get<FVector>(MemberOffsets::FortPlayerState::PawnDeathLocation) = DeathLocation;
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "Calling OnRep_DeathInfo.");
|
||||||
|
|
||||||
static auto OnRep_DeathInfoFn = FindObject<UFunction>("/Script/FortniteGame.FortPlayerStateAthena.OnRep_DeathInfo");
|
static auto OnRep_DeathInfoFn = FindObject<UFunction>("/Script/FortniteGame.FortPlayerStateAthena.OnRep_DeathInfo");
|
||||||
DeadPlayerState->ProcessEvent(OnRep_DeathInfoFn);
|
|
||||||
|
if (OnRep_DeathInfoFn)
|
||||||
|
DeadPlayerState->ProcessEvent(OnRep_DeathInfoFn);
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "Called OnRep_DeathInfo.");
|
||||||
|
|
||||||
if (KillerPlayerState && KillerPlayerState != DeadPlayerState)
|
if (KillerPlayerState && KillerPlayerState != DeadPlayerState)
|
||||||
{
|
{
|
||||||
@@ -681,6 +687,8 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
|
|||||||
// KillerPlayerState->OnRep_Kills();
|
// KillerPlayerState->OnRep_Kills();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "Reported kill.");
|
||||||
|
|
||||||
if (KillerPawn && KillerPawn != DeadPawn)
|
if (KillerPawn && KillerPawn != DeadPawn)
|
||||||
{
|
{
|
||||||
KillerPawn->SetHealth(100);
|
KillerPawn->SetHealth(100);
|
||||||
|
|||||||
@@ -46,17 +46,17 @@ static void NoMCPHook() { return; }
|
|||||||
static void CollectGarbageHook() { return; }
|
static void CollectGarbageHook() { return; }
|
||||||
|
|
||||||
static __int64 (*DispatchRequestOriginal)(__int64 a1, __int64* a2, int a3);
|
static __int64 (*DispatchRequestOriginal)(__int64 a1, __int64* a2, int a3);
|
||||||
static __int64 DispatchRequestHook(__int64 a1, __int64* a2, int a3) { return DispatchRequestOriginal(a1, a2, 3); }
|
|
||||||
double GetServerDeltaTimeFromObjectHook(UObject* Object)
|
static __int64 DispatchRequestHook(__int64 a1, __int64* a2, int a3)
|
||||||
{
|
{
|
||||||
auto World = GetWorld();
|
if (Engine_Version >= 423)
|
||||||
|
return DispatchRequestOriginal(a1, a2, 3);
|
||||||
|
|
||||||
auto GameState = Cast<AFortGameStateAthena>(((AFortGameMode*)World->GetGameMode())->GetGameState());
|
static auto Offset = FindMcpIsDedicatedServerOffset();
|
||||||
|
|
||||||
if (!GameState)
|
*(int*)(__int64(a2) + Offset) = 3;
|
||||||
return 0;
|
|
||||||
|
|
||||||
return GameState->GetServerWorldTimeSeconds();
|
return DispatchRequestOriginal(a1, a2, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI Main(LPVOID)
|
DWORD WINAPI Main(LPVOID)
|
||||||
|
|||||||
@@ -823,6 +823,16 @@ static inline uint64 FindDispatchRequest()
|
|||||||
return FindBytes(Addr, std::floor(Fortnite_Version) == 18 ? std::vector<uint8_t>{0x48, 0x8B, 0xC4 } : std::vector<uint8_t>{ 0x48, 0x89, 0x5C }, 300, 0, true);
|
return FindBytes(Addr, std::floor(Fortnite_Version) == 18 ? std::vector<uint8_t>{0x48, 0x8B, 0xC4 } : std::vector<uint8_t>{ 0x48, 0x89, 0x5C }, 300, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline uint64 FindMcpIsDedicatedServerOffset()
|
||||||
|
{
|
||||||
|
if (Engine_Version == 421 || Engine_Version == 422) // checked on 5.41 & 6.21 & 7.30
|
||||||
|
return 0x28;
|
||||||
|
|
||||||
|
return 0x60; // 1.7.2 & 4.1
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline uint64 FindGIsClient()
|
static inline uint64 FindGIsClient()
|
||||||
{
|
{
|
||||||
// if (Fortnite_Version == 2.5)
|
// if (Fortnite_Version == 2.5)
|
||||||
|
|||||||
Reference in New Issue
Block a user