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

Method SendEnableEncryption

src/network/network_server.cpp:458–469  ·  view source on GitHub ↗

Notify the client that the authentication has completed and tell that for the remainder of this socket encryption is enabled. */

Source from the content-addressed store, hash-verified

456
457/** Notify the client that the authentication has completed and tell that for the remainder of this socket encryption is enabled. */
458NetworkRecvStatus ServerNetworkGameSocketHandler::SendEnableEncryption()
459{
460 Debug(net, 9, "client[{}] SendEnableEncryption()", this->client_id);
461
462 /* Invalid packet when status is anything but STATUS_AUTH_GAME. */
463 if (this->status != STATUS_AUTH_GAME) return this->CloseConnection(NETWORK_RECV_STATUS_MALFORMED_PACKET);
464
465 auto p = std::make_unique<Packet>(this, PACKET_SERVER_ENABLE_ENCRYPTION);
466 this->authentication_handler->SendEnableEncryption(*p);
467 this->SendPacket(std::move(p));
468 return NETWORK_RECV_STATUS_OKAY;
469}
470
471/** Send the client a welcome message with some basic information. */
472NetworkRecvStatus ServerNetworkGameSocketHandler::SendWelcome()

Callers 1

Calls 2

CloseConnectionMethod · 0.95
SendPacketMethod · 0.45

Tested by

no test coverage detected