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

Method SendWelcome

src/network/network_admin.cpp:170–188  ·  view source on GitHub ↗

Send a welcome message to the admin. */

Source from the content-addressed store, hash-verified

168
169/** Send a welcome message to the admin. */
170NetworkRecvStatus ServerNetworkAdminSocketHandler::SendWelcome()
171{
172 auto p = std::make_unique<Packet>(this, ADMIN_PACKET_SERVER_WELCOME);
173
174 p->Send_string(_settings_client.network.server_name);
175 p->Send_string(GetNetworkRevisionString());
176 p->Send_bool (_network_dedicated);
177
178 p->Send_string(""); // Used to be map-name.
179 p->Send_uint32(_settings_game.game_creation.generation_seed);
180 p->Send_uint8 (to_underlying(_settings_game.game_creation.landscape));
181 p->Send_uint32(TimerGameCalendar::ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1).base());
182 p->Send_uint16(Map::SizeX());
183 p->Send_uint16(Map::SizeY());
184
185 this->SendPacket(std::move(p));
186
187 return NETWORK_RECV_STATUS_OKAY;
188}
189
190/** Tell the admin we started a new game. */
191NetworkRecvStatus ServerNetworkAdminSocketHandler::SendNewGame()

Callers 2

SendProtocolMethod · 0.95
WelcomeAllMethod · 0.45

Calls 9

GetNetworkRevisionStringFunction · 0.85
to_underlyingFunction · 0.85
Send_stringMethod · 0.80
Send_boolMethod · 0.80
Send_uint32Method · 0.80
Send_uint16Method · 0.80
Send_uint8Method · 0.45
baseMethod · 0.45
SendPacketMethod · 0.45

Tested by

no test coverage detected