#include <networkpacket.h>
◆ NetworkPacket() [1/3]
NetworkPacket::NetworkPacket |
( |
u16 | command, |
|
|
u32 | preallocate, |
|
|
session_t | peer_id ) |
|
inline |
◆ NetworkPacket() [2/3]
NetworkPacket::NetworkPacket |
( |
u16 | command, |
|
|
u32 | preallocate ) |
|
inline |
◆ NetworkPacket() [3/3]
NetworkPacket::NetworkPacket |
( |
| ) |
|
|
default |
◆ ~NetworkPacket()
NetworkPacket::~NetworkPacket |
( |
| ) |
|
|
default |
◆ checkDataSize()
void NetworkPacket::checkDataSize |
( |
u32 | field_size | ) |
|
|
inlineprivate |
References m_data, m_datasize, and m_read_offset.
Referenced by operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), and putRawString().
◆ checkReadOffset()
void NetworkPacket::checkReadOffset |
( |
u32 | from_offset, |
|
|
u32 | field_size ) const |
|
private |
References getSize(), and m_datasize.
Referenced by getString(), getU16(), getU8(), getU8Ptr(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), and readLongString().
◆ clear()
void NetworkPacket::clear |
( |
| ) |
|
◆ getCommand()
u16 NetworkPacket::getCommand |
( |
| ) |
const |
|
inline |
References m_command.
Referenced by Client::handleCommand(), Server::handleCommand(), Client::handleCommand_AccessDenied(), Client::handleCommand_Deprecated(), Server::handleCommand_Deprecated(), Client::ProcessData(), Server::ProcessData(), Client::Send(), con::Connection::Send(), ClientInterface::send(), Server::SendActiveObjectMessages(), ClientInterface::sendCustom(), and ClientInterface::sendToAll().
◆ getPeerId()
References m_peer_id.
Referenced by Server::handleCommand_ChatMessage(), Server::handleCommand_ClientReady(), Server::handleCommand_Damage(), Server::handleCommand_DeletedBlocks(), Client::handleCommand_Deprecated(), Server::handleCommand_FirstSrp(), Server::handleCommand_GotBlocks(), Server::handleCommand_HaveMedia(), Server::handleCommand_Init(), Server::handleCommand_Init2(), Server::handleCommand_Interact(), Server::handleCommand_InventoryAction(), Server::handleCommand_InventoryFields(), Server::handleCommand_ModChannelJoin(), Server::handleCommand_ModChannelLeave(), Client::handleCommand_ModChannelMsg(), Server::handleCommand_ModChannelMsg(), Server::handleCommand_NodeMetaFields(), Server::handleCommand_PlayerItem(), Server::handleCommand_PlayerPos(), Server::handleCommand_RemovedSounds(), Server::handleCommand_RequestMedia(), Server::handleCommand_SrpBytesA(), Server::handleCommand_SrpBytesM(), Server::handleCommand_UpdateClientInfo(), Client::ProcessData(), Server::ProcessData(), Server::Receive(), Server::Send(), Server::SendActiveObjectMessages(), and TestConnection::testConnectSendReceive().
◆ getRemainingBytes()
u32 NetworkPacket::getRemainingBytes |
( |
| ) |
const |
|
inline |
◆ getRemainingString()
const char * NetworkPacket::getRemainingString |
( |
| ) |
|
|
inline |
◆ getSize()
u32 NetworkPacket::getSize |
( |
| ) |
const |
|
inline |
References m_datasize.
Referenced by checkReadOffset(), Client::handleCommand_AccessDenied(), Client::handleCommand_ActiveObjectMessages(), Client::handleCommand_AddNode(), Client::handleCommand_AddParticleSpawner(), Client::handleCommand_AnnounceMedia(), Client::handleCommand_BlockData(), Server::handleCommand_DeletedBlocks(), Server::handleCommand_GotBlocks(), Client::handleCommand_Hello(), Client::handleCommand_HudSetSky(), Server::handleCommand_Init(), Server::handleCommand_Init2(), Client::handleCommand_Inventory(), Server::handleCommand_InventoryAction(), Client::handleCommand_ItemDef(), Client::handleCommand_Media(), Client::handleCommand_NodeDef(), Client::handleCommand_NodemetaChanged(), Server::handleCommand_PlayerItem(), Client::handleCommand_RemoveNode(), Client::handleCommand_SpawnParticle(), Client::handleCommand_TimeOfDay(), Client::request_media(), con::Connection::Send(), Server::SendActiveObjectRemoveAdd(), Server::SendItemDef(), Server::sendMediaAnnouncement(), Server::SendNodeDef(), Server::sendRequestedMedia(), and TestConnection::testConnectSendReceive().
◆ getString()
const char * NetworkPacket::getString |
( |
u32 | from_offset | ) |
const |
◆ getU16()
u16 NetworkPacket::getU16 |
( |
u32 | from_offset | ) |
|
◆ getU8()
u8 NetworkPacket::getU8 |
( |
u32 | offset | ) |
|
◆ getU8Ptr()
u8 * NetworkPacket::getU8Ptr |
( |
u32 | offset | ) |
|
◆ oldForgePacket()
Buffer< u8 > NetworkPacket::oldForgePacket |
( |
| ) |
|
◆ operator<<() [1/17]
◆ operator<<() [2/17]
◆ operator<<() [3/17]
◆ operator<<() [4/17]
◆ operator<<() [5/17]
◆ operator<<() [6/17]
NetworkPacket & NetworkPacket::operator<< |
( |
std::string_view | src | ) |
|
◆ operator<<() [7/17]
NetworkPacket & NetworkPacket::operator<< |
( |
std::wstring_view | src | ) |
|
◆ operator<<() [8/17]
◆ operator<<() [9/17]
◆ operator<<() [10/17]
◆ operator<<() [11/17]
◆ operator<<() [12/17]
◆ operator<<() [13/17]
◆ operator<<() [14/17]
◆ operator<<() [15/17]
◆ operator<<() [16/17]
◆ operator<<() [17/17]
◆ operator>>() [1/17]
◆ operator>>() [2/17]
◆ operator>>() [3/17]
◆ operator>>() [4/17]
◆ operator>>() [5/17]
◆ operator>>() [6/17]
◆ operator>>() [7/17]
◆ operator>>() [8/17]
◆ operator>>() [9/17]
◆ operator>>() [10/17]
◆ operator>>() [11/17]
◆ operator>>() [12/17]
◆ operator>>() [13/17]
◆ operator>>() [14/17]
◆ operator>>() [15/17]
◆ operator>>() [16/17]
◆ operator>>() [17/17]
◆ putLongString()
void NetworkPacket::putLongString |
( |
std::string_view | src | ) |
|
References LONG_STRING_MAX_LEN, and putRawString().
Referenced by Server::dynamicAddMedia(), Client::interact(), Server::SendActiveObjectRemoveAdd(), Server::SendAddParticleSpawner(), Client::sendInventoryFields(), Server::SendItemDef(), Server::sendMetadataChanged(), Server::SendNodeDef(), Client::sendNodemetaFields(), Server::SendPlayerInventoryFormspec(), Server::sendRequestedMedia(), and Server::SendShowFormspecMessage().
◆ putRawPacket()
void NetworkPacket::putRawPacket |
( |
const u8 * | data, |
|
|
u32 | datasize, |
|
|
session_t | peer_id ) |
◆ putRawString() [1/2]
void NetworkPacket::putRawString |
( |
const char * | src, |
|
|
u32 | len ) |
References checkDataSize(), m_data, and m_read_offset.
Referenced by operator<<(), putLongString(), putRawString(), Server::SendActiveObjectMessages(), Server::SendAddParticleSpawner(), Server::SendBlockNoLock(), Server::sendDetachedInventory(), Server::SendInventory(), Client::sendInventoryAction(), Client::sendReady(), Server::SendSpawnParticle(), and TestConnection::testConnectSendReceive().
◆ putRawString() [2/2]
void NetworkPacket::putRawString |
( |
std::string_view | src | ) |
|
|
inline |
◆ readLongString()
std::string NetworkPacket::readLongString |
( |
| ) |
|
References checkReadOffset(), LONG_STRING_MAX_LEN, m_data, m_read_offset, and readU32().
Referenced by Client::handleCommand_ActiveObjectRemoveAdd(), Server::handleCommand_Interact(), Client::handleCommand_InventoryFormSpec(), Client::handleCommand_ItemDef(), Client::handleCommand_Media(), Client::handleCommand_MediaPush(), Client::handleCommand_NodeDef(), Client::handleCommand_NodemetaChanged(), Client::handleCommand_ShowFormSpec(), and pkt_read_formspec_fields().
◆ m_command
u16 NetworkPacket::m_command = 0 |
|
private |
◆ m_data
std::vector<u8> NetworkPacket::m_data |
|
private |
Referenced by NetworkPacket(), NetworkPacket(), checkDataSize(), clear(), getString(), getU16(), getU8(), getU8Ptr(), oldForgePacket(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), putRawPacket(), putRawString(), and readLongString().
◆ m_datasize
u32 NetworkPacket::m_datasize = 0 |
|
private |
◆ m_peer_id
◆ m_read_offset
u32 NetworkPacket::m_read_offset = 0 |
|
private |
Referenced by checkDataSize(), clear(), getRemainingBytes(), getRemainingString(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), putRawString(), and readLongString().
The documentation for this class was generated from the following files: