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

Method Send_buffer

src/network/core/packet.cpp:183–188  ·  view source on GitHub ↗

* Copy a sized byte buffer into the packet. * @param data The data to send. */

Source from the content-addressed store, hash-verified

181 * @param data The data to send.
182 */
183void Packet::Send_buffer(const std::vector<uint8_t> &data)
184{
185 assert(this->CanWriteToPacket(sizeof(uint16_t) + data.size()));
186 this->Send_uint16((uint16_t)data.size());
187 this->buffer.insert(this->buffer.end(), data.begin(), data.end());
188}
189
190/**
191 * Send as many of the bytes as possible in the packet. This can mean

Callers 2

SendCommandMethod · 0.80
SendCmdLoggingMethod · 0.80

Calls 6

CanWriteToPacketMethod · 0.95
Send_uint16Method · 0.95
sizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected