diff options
| author | Léo Lam <leo@leolam.fr> | 2022-03-15 16:03:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-15 16:03:28 +0100 |
| commit | bf261f6144a8cc75bcbdd4c09b19bdfa3dbe49b3 (patch) | |
| tree | 504a1bf3b411fcdba6855f3335ceae59381574d2 /Source/Core/Common | |
| parent | e10967e918594b3f22dfb3da1d092fd3f58b8af6 (diff) | |
| parent | c058c8e1a6de382b9edcca88dc26fec51336b39a (diff) | |
Merge pull request #10493 from jordan-woyak/netplay-show-traversal-external-port
NetPlayDialog: Display external IP/Port as seen by the traversal server.
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/TraversalClient.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/Common/TraversalClient.h | 2 | ||||
| -rw-r--r-- | Source/Core/Common/TraversalProto.h | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/Source/Core/Common/TraversalClient.cpp b/Source/Core/Common/TraversalClient.cpp index faaae56519..4c416a0bdb 100644 --- a/Source/Core/Common/TraversalClient.cpp +++ b/Source/Core/Common/TraversalClient.cpp @@ -29,6 +29,11 @@ TraversalHostId TraversalClient::GetHostID() const return m_HostId; } +TraversalInetAddress TraversalClient::GetExternalAddress() const +{ + return m_external_address; +} + TraversalClient::State TraversalClient::GetState() const { return m_State; @@ -153,6 +158,7 @@ void TraversalClient::HandleServerPacket(TraversalPacket* packet) break; } m_HostId = packet->helloFromServer.yourHostId; + m_external_address = packet->helloFromServer.yourAddress; m_State = State::Connected; if (m_Client) m_Client->OnTraversalStateChanged(); diff --git a/Source/Core/Common/TraversalClient.h b/Source/Core/Common/TraversalClient.h index 7b0bbfa3f9..1f33f01cef 100644 --- a/Source/Core/Common/TraversalClient.h +++ b/Source/Core/Common/TraversalClient.h @@ -44,6 +44,7 @@ public: ~TraversalClient(); TraversalHostId GetHostID() const; + TraversalInetAddress GetExternalAddress() const; State GetState() const; FailureReason GetFailureReason() const; @@ -77,6 +78,7 @@ private: ENetHost* m_NetHost; TraversalHostId m_HostId{}; + TraversalInetAddress m_external_address{}; State m_State{}; FailureReason m_FailureReason{}; TraversalRequestId m_ConnectRequestId = 0; diff --git a/Source/Core/Common/TraversalProto.h b/Source/Core/Common/TraversalProto.h index c739e599a3..fc7404048a 100644 --- a/Source/Core/Common/TraversalProto.h +++ b/Source/Core/Common/TraversalProto.h @@ -69,7 +69,7 @@ struct TraversalPacket { u8 ok; TraversalHostId yourHostId; - TraversalInetAddress yourAddress; // currently unused + TraversalInetAddress yourAddress; } helloFromServer; struct { |
