From be9fca1b378f6ffd1739bec155da204fdf078a5a Mon Sep 17 00:00:00 2001 From: bobsayshilol Date: Wed, 17 Apr 2019 21:03:01 +0100 Subject: [PATCH] Set the remote's address when initiating a direct UDP connection. Without this, status change callbacks would always have an invalid remote address if we were the one who initiated the connection. --- .../clientlib/steamnetworkingsockets_udp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_udp.cpp b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_udp.cpp index 6efba26..46a01c0 100644 --- a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_udp.cpp +++ b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_udp.cpp @@ -734,6 +734,9 @@ bool CSteamNetworkConnectionUDP::BInitConnect( const SteamNetworkingIPAddr &addr Assert( m_identityRemote.IsInvalid() ); m_identityRemote.Clear(); + // We just opened a socket aiming at this address, so we know what the remote addr will be. + m_netAdrRemote = netadrRemote; + // We should know our own identity, unless the app has said it's OK to go without this. if ( m_identityLocal.IsInvalid() ) // Specific identity hasn't already been set (by derived class, etc) {