diff --git a/Source/Engine/Networking/NetworkMessage.h b/Source/Engine/Networking/NetworkMessage.h index ed1285ccd..aa610f058 100644 --- a/Source/Engine/Networking/NetworkMessage.h +++ b/Source/Engine/Networking/NetworkMessage.h @@ -90,6 +90,18 @@ public: Position += numBytes; } + template + FORCE_INLINE void WriteStructure(const T& data) + { + WriteBytes((uint8*)&data, sizeof(data)); + } + + template + FORCE_INLINE void ReadStructure(const T& data) + { + ReadBytes((uint8*)&data, sizeof(data)); + } + #define DECL_READWRITE(type, name) \ FORCE_INLINE void Write##name(type value) { WriteBytes(reinterpret_cast(&value), sizeof(type)); } \ FORCE_INLINE type Read##name() { type value = 0; ReadBytes(reinterpret_cast(&value), sizeof(type)); return value; }