New API for assigning unique network ids to objects

This commit is contained in:
Boondorl 2024-02-19 13:35:01 -05:00 committed by Rachael Alexanderson
commit e37c19b5b4
11 changed files with 233 additions and 1 deletions

View file

@ -351,6 +351,17 @@ protected:
friend T* Create(Args&&... args);
friend class JitCompiler;
private:
// This is intentionally left unserialized.
uint32_t _networkID;
public:
inline bool IsNetworked() const { return (ObjectFlags & OF_Networked); }
inline uint32_t GetNetworkID() const { return _networkID; }
void SetNetworkID(const uint32_t id);
void ClearNetworkID();
virtual void EnableNetworking(const bool enable);
};
// This is the only method aside from calling CreateNew that should be used for creating DObjects