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

Method StunResult

src/network/network_coordinator.cpp:621–630  ·  view source on GitHub ↗

* Callback from the STUN connecter to inform the Game Coordinator about the * result of the STUN. * * This helps the Game Coordinator not to wait for a timeout on its end, but * rather react as soon as the client/server knows the result. */

Source from the content-addressed store, hash-verified

619 * rather react as soon as the client/server knows the result.
620 */
621void ClientNetworkCoordinatorSocketHandler::StunResult(std::string_view token, uint8_t family, bool result)
622{
623 auto p = std::make_unique<Packet>(this, PACKET_COORDINATOR_SERCLI_STUN_RESULT);
624 p->Send_uint8(NETWORK_COORDINATOR_VERSION);
625 p->Send_string(token);
626 p->Send_uint8(family);
627 p->Send_bool(result);
628 Debug(net, 9, "Coordinator::SendStunResult({}, {}, {})", token, family, result);
629 this->SendPacket(std::move(p));
630}
631
632/**
633 * Close the STUN handler.

Callers 2

OnFailureMethod · 0.80
SendReceiveMethod · 0.80

Calls 4

Send_stringMethod · 0.80
Send_boolMethod · 0.80
Send_uint8Method · 0.45
SendPacketMethod · 0.45

Tested by

no test coverage detected