Network/NetPacket: Add Get(Const)Data method
Former-commit-id: 53f4f230b3e7baa65c79d97b21e192108b771312
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Network/Enums.hpp>
|
||||
#include <cstring>
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
@@ -28,6 +29,20 @@ namespace Nz
|
||||
FreeStream();
|
||||
}
|
||||
|
||||
inline const UInt8* NetPacket::GetConstData() const
|
||||
{
|
||||
NazaraAssert(m_buffer, "Invalid buffer");
|
||||
|
||||
return m_buffer->GetConstBuffer();
|
||||
}
|
||||
|
||||
inline UInt8* NetPacket::GetData() const
|
||||
{
|
||||
NazaraAssert(m_buffer, "Invalid buffer");
|
||||
|
||||
return m_buffer->GetBuffer();
|
||||
}
|
||||
|
||||
inline UInt16 NetPacket::GetNetCode() const
|
||||
{
|
||||
return m_netCode;
|
||||
|
||||
Reference in New Issue
Block a user