mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
S24
This commit is contained in:
@@ -308,6 +308,12 @@ AActor* AActor::GetClosestActor(UClass* ActorClass, float DistMax, std::function
|
||||
return TargetActor;
|
||||
}
|
||||
|
||||
FName& AActor::GetNetDriverName()
|
||||
{
|
||||
static auto NetDriverNameOffset = GetOffset("NetDriverName");
|
||||
return Get<FName>(NetDriverNameOffset);
|
||||
}
|
||||
|
||||
bool AActor::IsAlwaysRelevant()
|
||||
{
|
||||
static auto bAlwaysRelevantOffset = GetOffset("bAlwaysRelevant");
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
const AActor* GetNetOwner() const;
|
||||
void GetActorEyesViewPoint(FVector* OutLocation, FRotator* OutRotation) const;
|
||||
AActor* GetClosestActor(UClass* ActorClass, float DistMax, std::function<bool(AActor*)> AdditionalCheck = [](AActor*) { return true; });
|
||||
FName& GetNetDriverName();
|
||||
|
||||
bool IsRelevancyOwnerFor(const AActor* ReplicatedActor, const AActor* ActorOwner, const AActor* ConnectionActor) const
|
||||
{
|
||||
|
||||
@@ -181,7 +181,9 @@ void AFortGameModeAthena::HandleSpawnRateForActorClass(UClass* ActorClass, float
|
||||
|
||||
void AFortGameModeAthena::StartAircraftPhase()
|
||||
{
|
||||
if (Addresses::StartAircraftPhase)
|
||||
if (Addresses::StartAircraftPhase
|
||||
&& Fortnite_Version < 24 // ig they load or sometrhing gg
|
||||
)
|
||||
{
|
||||
static void (*StartAircraftPhaseOriginal)(AFortGameModeAthena*, bool bDoNotSpawnAircraft) = decltype(StartAircraftPhaseOriginal)(Addresses::StartAircraftPhase);
|
||||
StartAircraftPhaseOriginal(this, false); // love the double negative Fortnite
|
||||
|
||||
@@ -39,6 +39,8 @@ void AFortPickup::SpawnMovementComponent()
|
||||
|
||||
AFortPickup* AFortPickup::SpawnPickup(PickupCreateData& PickupData)
|
||||
{
|
||||
if (Fortnite_Version >= 24) return nullptr; // location is scrweed
|
||||
|
||||
if (PickupData.Source == -1)
|
||||
PickupData.Source = 0;
|
||||
if (PickupData.SourceType == -1)
|
||||
|
||||
@@ -31,9 +31,11 @@ public:
|
||||
return ReadBitfieldValue(bCanBeDroppedOffset, bCanBeDroppedFieldMask);
|
||||
}
|
||||
|
||||
int& GetDropCount()
|
||||
int/*&*/ GetDropCount()
|
||||
{
|
||||
static auto DropCountOffset = GetOffset("DropCount");
|
||||
static auto DropCountOffset = GetOffset("DropCount", false);
|
||||
if (DropCountOffset == -1)
|
||||
return 1;
|
||||
return Get<int>(DropCountOffset);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,14 @@ struct FName
|
||||
FORCEINLINE bool operator==(const FName& Other) const // HMM??
|
||||
{
|
||||
#if WITH_CASE_PRESERVING_NAME
|
||||
return GetComparisonIndexFast() == Other.GetComparisonIndexFast() && GetNumber() == Other.GetNumber();
|
||||
return GetComparisonIndexFast() == Other.GetComparisonIndexFast(); // && GetNumber() == Other.GetNumber();
|
||||
#else
|
||||
// static_assert(sizeof(CompositeComparisonValue) == sizeof(*this), "ComparisonValue does not cover the entire FName state");
|
||||
// return CompositeComparisonValue == Other.CompositeComparisonValue;
|
||||
#endif
|
||||
}
|
||||
|
||||
int32 Compare(const FName& Other) const;
|
||||
// int32 Compare(const FName& Other) const;
|
||||
|
||||
/* FORCEINLINE bool operator<(const FName& Other) const
|
||||
{
|
||||
|
||||
@@ -305,7 +305,7 @@ void UNetDriver::ServerReplicateActors_BuildConsiderList(std::vector<FNetworkObj
|
||||
if (Actor->IsPendingKillPending())
|
||||
// if (Actor->IsPendingKill())
|
||||
{
|
||||
ActorsToRemove.push_back(Actor);
|
||||
// ActorsToRemove.push_back(Actor);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -313,11 +313,16 @@ void UNetDriver::ServerReplicateActors_BuildConsiderList(std::vector<FNetworkObj
|
||||
|
||||
if (Actor->Get<ENetRole>(RemoteRoleOffset) == ENetRole::ROLE_None)
|
||||
{
|
||||
ActorsToRemove.push_back(Actor);
|
||||
// ActorsToRemove.push_back(Actor);
|
||||
continue;
|
||||
}
|
||||
|
||||
// We should add a NetDriverName check but I don't believe it is needed.
|
||||
if (Actor->GetNetDriverName() != this->GetNetDriverName())
|
||||
{
|
||||
// ActorsToRemove.push_back(Actor);
|
||||
continue;
|
||||
}
|
||||
|
||||
// We should check if the actor is initialized here.
|
||||
|
||||
@@ -627,11 +632,11 @@ int32 UNetDriver::ServerReplicateActors()
|
||||
|
||||
ServerReplicateActors_BuildConsiderList(ConsiderList, ServerTickTime);
|
||||
|
||||
LOG_INFO(LogReplication, "Considering {} actors.", ConsiderList.size());
|
||||
// LOG_INFO(LogReplication, "Considering {} actors.", ConsiderList.size());
|
||||
|
||||
static UChannel* (*CreateChannel)(UNetConnection*, int, bool, int32_t) = decltype(CreateChannel)(Addresses::CreateChannel);
|
||||
static __int64 (*ReplicateActor)(UActorChannel*) = decltype(ReplicateActor)(Addresses::ReplicateActor);
|
||||
static UObject* (*CreateChannelByName)(UNetConnection* Connection, FName* ChName, EChannelCreateFlags CreateFlags, int32_t ChannelIndex) = decltype(CreateChannelByName)(Addresses::CreateChannel);
|
||||
static UObject* (*CreateChannelByName)(UNetConnection* Connection, const FName& ChName, EChannelCreateFlags CreateFlags, int32_t ChannelIndex) = decltype(CreateChannelByName)(Addresses::CreateChannel);
|
||||
static __int64 (*SetChannelActor)(UActorChannel*, AActor*) = decltype(SetChannelActor)(Addresses::SetChannelActor);
|
||||
static __int64 (*SetChannelActor2)(UActorChannel*, AActor*, ESetChannelActorFlags) = decltype(SetChannelActor2)(Addresses::SetChannelActor);
|
||||
static FName ActorName = UKismetStringLibrary::Conv_StringToName(L"Actor");
|
||||
@@ -733,7 +738,7 @@ int32 UNetDriver::ServerReplicateActors()
|
||||
if (Engine_Version >= 422)
|
||||
{
|
||||
int ChannelIndex = -1; // 4294967295
|
||||
Channel = (UActorChannel*)CreateChannelByName(Connection, &ActorName, EChannelCreateFlags::OpenedLocally, ChannelIndex);
|
||||
Channel = (UActorChannel*)CreateChannelByName(Connection, ActorName, EChannelCreateFlags::OpenedLocally, ChannelIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -841,7 +846,7 @@ int32 UNetDriver::ServerReplicateActors()
|
||||
if (Engine_Version >= 422)
|
||||
{
|
||||
int ChannelIndex = -1; // 4294967295
|
||||
Channel = (UActorChannel*)CreateChannelByName(Connection, &ActorName, EChannelCreateFlags::OpenedLocally, ChannelIndex);
|
||||
Channel = (UActorChannel*)CreateChannelByName(Connection, ActorName, EChannelCreateFlags::OpenedLocally, ChannelIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -850,10 +855,10 @@ int32 UNetDriver::ServerReplicateActors()
|
||||
|
||||
if (Channel)
|
||||
{
|
||||
if (Engine_Version >= 500)
|
||||
SetChannelActor(Channel, Actor);
|
||||
else
|
||||
if (Engine_Version >= 424)
|
||||
SetChannelActor2(Channel, Actor, ESetChannelActorFlags::None);
|
||||
else
|
||||
SetChannelActor(Channel, Actor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +136,12 @@ public:
|
||||
return Get<int>(MaxInternetClientRateOffset);
|
||||
}
|
||||
|
||||
FName& GetNetDriverName()
|
||||
{
|
||||
static auto NetDriverNameOffset = GetOffset("NetDriverName");
|
||||
return Get<FName>(NetDriverNameOffset);
|
||||
}
|
||||
|
||||
int& GetMaxClientRate()
|
||||
{
|
||||
static auto MaxClientRateOffset = GetOffset("MaxClientRate");
|
||||
|
||||
@@ -22,6 +22,7 @@ std::string FName::ToString() const
|
||||
return Str;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int32 FName::Compare(const FName& Other) const
|
||||
{
|
||||
if (GetComparisonIndexFast() == Other.GetComparisonIndexFast())
|
||||
@@ -65,6 +66,7 @@ int32 FName::Compare(const FName& Other) const
|
||||
|
||||
return GetComparisonIndexFast() < Other.GetComparisonIndexFast();
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string FName::ToString()
|
||||
{
|
||||
|
||||
@@ -57,8 +57,7 @@ void UWorld::Listen()
|
||||
return;
|
||||
}
|
||||
|
||||
static auto NetDriverNameOffset = NewNetDriver->GetOffset("NetDriverName");
|
||||
NewNetDriver->Get<FName>(NetDriverNameOffset) = GameNetDriverName;
|
||||
NewNetDriver->GetNetDriverName() = GameNetDriverName;
|
||||
|
||||
static auto World_NetDriverOffset = GetWorld()->GetOffset("NetDriver");
|
||||
GetWorld()->Get(World_NetDriverOffset) = NewNetDriver;
|
||||
|
||||
@@ -1047,7 +1047,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::GetNetMode, (PVOID)GetNetModeHook, nullptr);
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::DispatchRequest, (PVOID)DispatchRequestHook, (PVOID*)&DispatchRequestOriginal);
|
||||
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::ReplicateActor, (PVOID)ReplicateActorHook, (PVOID*)&ReplicateActorOriginal);
|
||||
// Hooking::MinHook::Hook((PVOID)Addresses::ReplicateActor, (PVOID)ReplicateActorHook, (PVOID*)&ReplicateActorOriginal);
|
||||
|
||||
GSRandSeed = FGenericPlatformTime::Cycles();
|
||||
ReplicationRandStream = FRandomStream(FGenericPlatformTime::Cycles());
|
||||
|
||||
@@ -1904,15 +1904,22 @@ static inline uint64 FindReplicateActor()
|
||||
return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8D 69 68").Get();
|
||||
if (Fortnite_Version >= 21)
|
||||
{
|
||||
auto strRef = Memcury::Scanner::FindStringRef(L"STAT_NetReplicateActorTime");
|
||||
return strRef.ScanFor({ 0x48, 0x8B, 0xC4 }, false).Get();
|
||||
auto Addrr = Memcury::Scanner::FindStringRef(L"STAT_NetReplicateActorTime").Get();
|
||||
|
||||
auto addr = Memcury::Scanner::FindPattern("48 8B C4 48 89 58 ? 48 89 70 ? 48 89 78 ? 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 45 33 FF 4C 8D ? ? 44 38 3D", false).Get(); // 22.3
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x40 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x55) // 24.40
|
||||
{
|
||||
return Addrr - i;
|
||||
}
|
||||
|
||||
if (!addr)
|
||||
addr = Memcury::Scanner::FindPattern("40 55 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 48 8D 6C 24 ? 48 89 9D ? ? ? ? 48 89 B5 ? ? ? ? 48 89 BD ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C5 48 89 85 ? ? ? ? 45 33 E4 4C 8D 69 68 44 38 25 ? ? ? ? 48 8D 05 ? ? ? ? 48 8B F9 49 8B 4D").Get(); // 23.40
|
||||
if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x8B && *(uint8_t*)(uint8_t*)(Addrr - i + 2) == 0xC4)
|
||||
{
|
||||
return Addrr - i;
|
||||
}
|
||||
}
|
||||
|
||||
return addr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -23,7 +23,7 @@ extern inline int Fortnite_CL = 0;
|
||||
// #define PROD // this doesnt do anything besides remove processeventhook and some assert stuff
|
||||
// DEPRECATED ^^^ (see Globals::bDeveloperMode)
|
||||
|
||||
// #define ABOVE_S20
|
||||
#define ABOVE_S20
|
||||
|
||||
struct PlaceholderBitfield
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user