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

Method Send_string

src/network/core/packet.cpp:172–177  ·  view source on GitHub ↗

* Sends a string over the network. It sends out * the string + '\0'. No size-byte or something. * @param data The string to send */

Source from the content-addressed store, hash-verified

170 * @param data The string to send
171 */
172void Packet::Send_string(std::string_view data)
173{
174 assert(this->CanWriteToPacket(data.size() + 1));
175 this->buffer.insert(this->buffer.end(), data.begin(), data.end());
176 this->buffer.emplace_back('\0');
177}
178
179/**
180 * Copy a sized byte buffer into the packet.

Callers 15

SendWelcomeMethod · 0.80
SendClientInfoMethod · 0.80
SendClientUpdateMethod · 0.80
SendCompanyInfoMethod · 0.80
SendCompanyUpdateMethod · 0.80
SendChatMethod · 0.80
SendRconEndMethod · 0.80
SendRconMethod · 0.80
SendConsoleMethod · 0.80
SendGameScriptMethod · 0.80
SendCmdNamesMethod · 0.80
RegisterMethod · 0.80

Calls 5

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

Tested by

no test coverage detected