disable rebooting again

fixed looting bug, fixed parachute not auto deploying on some builds
This commit is contained in:
Milxnor
2023-06-21 10:51:24 -04:00
parent 1d12b8929f
commit 5e2a74764a
24 changed files with 479 additions and 99 deletions

View File

@@ -6,12 +6,25 @@
#include "OnlineReplStructs.h"
#include "gui.h"
uint8 AFortGameSessionDedicatedAthena::GetSquadIdForCurrentPlayerHook(AFortGameSessionDedicatedAthena* GameSessionDedicated, __int64 UniqueId)
uint8 AFortGameSessionDedicatedAthena::GetSquadIdForCurrentPlayerHook(AFortGameSessionDedicatedAthena* GameSessionDedicated, void* UniqueId)
{
LOG_INFO(LogDev, "GetSquadIdForCurrentPlayerHook!");
TArray<AActor*> CONTRTOLLERS = UGameplayStatics::GetAllActorsOfClass(GetWorld(), AFortPlayerControllerAthena::StaticClass());
auto OwnerUniqueId = (FUniqueNetIdRepl*)UniqueId;
LOG_INFO(LogDev, "OwnerUniqueId->GetReplicationBytes().Num(): {}", OwnerUniqueId->GetReplicationBytes().Num());
/*
for (int i = 0; i < OwnerUniqueId->GetReplicationBytes().Num(); i++)
{
LOG_INFO(LogDev, "[{}] Byte: 0x{:x}", i, OwnerUniqueId->GetReplicationBytes().at(i));
}
*/
for (int i = 0; i < CONTRTOLLERS.Num(); i++)
{
auto Controller = (AFortPlayerControllerAthena*)CONTRTOLLERS.at(i);
@@ -24,12 +37,14 @@ uint8 AFortGameSessionDedicatedAthena::GetSquadIdForCurrentPlayerHook(AFortGameS
static auto UniqueIdOffset = PlayerState->GetOffset("UniqueId");
if (IsBadReadPtr(PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)))
continue;
// if (IsBadReadPtr(PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)))
// continue;
if (PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)->IsIdentical((FUniqueNetIdRepl*)&UniqueId))
LOG_INFO(LogDev, "PS PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)->GetReplicationBytes().Num(): {}", PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)->GetReplicationBytes().Num());
if (PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)->IsIdentical(OwnerUniqueId))
{
LOG_INFO(LogDev, "Found!");
LOG_INFO(LogDev, "Found {}!", PlayerState->GetPlayerName().ToString());
return PlayerState->GetTeamIndex() - NumToSubtractFromSquadId;
}
}