mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
too much stuff
fix s3, fix health + backpack bug on 1.11, change replciation, fix 7.20 & 12.61, fix backpack on >S9, probably some other stuff i forgot
This commit is contained in:
@@ -7,6 +7,71 @@
|
||||
#include "NetConnection.h"
|
||||
#include "Array.h"
|
||||
|
||||
#include "WeakObjectPtrTemplates.h"
|
||||
#include "Map.h"
|
||||
#include "SharedPointer.h"
|
||||
#include "Level.h"
|
||||
|
||||
struct FActorDestructionInfo
|
||||
{
|
||||
TWeakObjectPtr<ULevel> Level;
|
||||
TWeakObjectPtr<UObject> ObjOuter;
|
||||
FVector DestroyedPosition;
|
||||
int32 NetGUID;
|
||||
FString PathName;
|
||||
FName StreamingLevelName;
|
||||
};
|
||||
struct FNetworkObjectInfo
|
||||
{
|
||||
/** Pointer to the replicated actor. */
|
||||
AActor* Actor;
|
||||
|
||||
/** WeakPtr to actor. This is cached here to prevent constantly constructing one when needed for (things like) keys in TMaps/TSets */
|
||||
TWeakObjectPtr<AActor> WeakActor;
|
||||
|
||||
/** Next time to consider replicating the actor. Based on FPlatformTime::Seconds(). */
|
||||
double NextUpdateTime;
|
||||
|
||||
/** Last absolute time in seconds since actor actually sent something during replication */
|
||||
double LastNetReplicateTime;
|
||||
|
||||
/** Optimal delta between replication updates based on how frequently actor properties are actually changing */
|
||||
float OptimalNetUpdateDelta;
|
||||
|
||||
/** Last time this actor was updated for replication via NextUpdateTime
|
||||
* @warning: internal net driver time, not related to WorldSettings.TimeSeconds */
|
||||
float LastNetUpdateTime;
|
||||
|
||||
/** Is this object still pending a full net update due to clients that weren't able to replicate the actor at the time of LastNetUpdateTime */
|
||||
uint32 bPendingNetUpdate : 1;
|
||||
|
||||
/** Force this object to be considered relevant for at least one update */
|
||||
uint32 bForceRelevantNextUpdate : 1;
|
||||
|
||||
/** List of connections that this actor is dormant on */
|
||||
TSet<TWeakObjectPtr<UNetConnection>> DormantConnections;
|
||||
|
||||
/** A list of connections that this actor has recently been dormant on, but the actor doesn't have a channel open yet.
|
||||
* These need to be differentiated from actors that the client doesn't know about, but there's no explicit list for just those actors.
|
||||
* (this list will be very transient, with connections being moved off the DormantConnections list, onto this list, and then off once the actor has a channel again)
|
||||
*/
|
||||
TSet<TWeakObjectPtr<UNetConnection>> RecentlyDormantConnections;
|
||||
};
|
||||
|
||||
class FNetworkObjectList
|
||||
{
|
||||
public:
|
||||
typedef TSet<TSharedPtr<FNetworkObjectInfo>> FNetworkObjectSet;
|
||||
|
||||
FNetworkObjectSet AllNetworkObjects;
|
||||
FNetworkObjectSet ActiveNetworkObjects;
|
||||
FNetworkObjectSet ObjectsDormantOnAllConnections;
|
||||
|
||||
TMap<TWeakObjectPtr<UNetConnection>, int32> NumDormantObjectsPerConnection;
|
||||
|
||||
void Remove(AActor* const Actor);
|
||||
};
|
||||
|
||||
class UWorld;
|
||||
|
||||
struct FURL // idk where this actually goes
|
||||
@@ -37,7 +102,10 @@ public:
|
||||
return Get<TArray<UNetConnection*>>(ClientConnectionsOffset);
|
||||
}
|
||||
|
||||
void RemoveNetworkActor(AActor* Actor);
|
||||
bool InitListen(FNetworkNotify* InNotify, FURL& ListenURL, bool bReuseAddressAndPort, FString& Error) { return InitListenOriginal(this, InNotify, ListenURL, bReuseAddressAndPort, Error); }
|
||||
void SetWorld(UWorld* World) { return SetWorldOriginal(this, World); }
|
||||
int32 ServerReplicateActors();
|
||||
void ServerReplicateActors_BuildConsiderList(std::vector<FNetworkObjectInfo*>& OutConsiderList);
|
||||
FNetworkObjectList& GetNetworkObjectList();
|
||||
};
|
||||
Reference in New Issue
Block a user