MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Size

Method Size

src/network/core/packet.cpp:250–253  ·  view source on GitHub ↗

* Get the number of bytes in the packet. * When sending a packet this is the size of the data up to that moment. * When receiving a packet (before PrepareToRead) this is the allocated size for the data to be read. * When reading a packet (after PrepareToRead) this is the full size of the packet. * @return The packet's size. */

Source from the content-addressed store, hash-verified

248 * @return The packet's size.
249 */
250size_t Packet::Size() const
251{
252 return this->buffer.size();
253}
254
255/**
256 * Reads the packet size from the raw packet and stores it in the packet->size

Callers 12

PrepareToSendMethod · 0.95
CanWriteToPacketMethod · 0.95
Send_bytesMethod · 0.95
CanReadFromPacketMethod · 0.95
GetPacketTypeMethod · 0.95
ReceivePacketMethod · 0.45
ReceivePacketsMethod · 0.45
CreatePacketForReadingFunction · 0.45
LoadMethod · 0.45
SaveMethod · 0.45
AfterLoadLinkGraphsFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by 1

CreatePacketForReadingFunction · 0.36