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

Method SendProtocol

src/network/network_admin.cpp:148–167  ·  view source on GitHub ↗

Send the protocol version to the admin. */

Source from the content-addressed store, hash-verified

146
147/** Send the protocol version to the admin. */
148NetworkRecvStatus ServerNetworkAdminSocketHandler::SendProtocol()
149{
150 this->status = ADMIN_STATUS_ACTIVE;
151
152 auto p = std::make_unique<Packet>(this, ADMIN_PACKET_SERVER_PROTOCOL);
153
154 /* announce the protocol version */
155 p->Send_uint8(NETWORK_GAME_ADMIN_VERSION);
156
157 for (int i = 0; i < ADMIN_UPDATE_END; i++) {
158 p->Send_bool (true);
159 p->Send_uint16(i);
160 p->Send_uint16(_admin_update_type_frequencies[i].base());
161 }
162
163 p->Send_bool(false);
164 this->SendPacket(std::move(p));
165
166 return this->SendWelcome();
167}
168
169/** Send a welcome message to the admin. */
170NetworkRecvStatus ServerNetworkAdminSocketHandler::SendWelcome()

Callers 2

Receive_ADMIN_JOINMethod · 0.95

Calls 6

SendWelcomeMethod · 0.95
Send_boolMethod · 0.80
Send_uint16Method · 0.80
Send_uint8Method · 0.45
baseMethod · 0.45
SendPacketMethod · 0.45

Tested by

no test coverage detected