diff options
| author | Tom Pratt <tom.pratt@outlook.com> | 2026-05-05 19:19:00 +0200 |
|---|---|---|
| committer | Tom Pratt <tompratt@squareup.com> | 2026-05-19 12:03:00 +0200 |
| commit | eb02680cb6ad8a8b700ccf37608c064fbb24fb8c (patch) | |
| tree | e40790087b1dc7767c50818779b8a7b428fa7003 /Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp | |
| parent | 6655672ee3d15cceb9fdb73f4b16df9553fefeb1 (diff) | |
Separate out GetExternalIPAddress helper function
De-duplicates the two inline implementations and prepares it for use from Android.
Diffstat (limited to 'Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp index 6cadce9203..5282fdb9b9 100644 --- a/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp @@ -30,7 +30,7 @@ #endif #include "Common/Config/Config.h" -#include "Common/HttpRequest.h" +#include "Core/NetPlayCommon.h" #include "Common/Logging/Log.h" #include "Common/TraversalClient.h" @@ -550,17 +550,8 @@ void NetPlayDialog::show(std::string nickname, bool use_traversal) void NetPlayDialog::ResetExternalIP() { - m_external_ip_address = Common::Lazy<std::string>([]() -> std::string { - Common::HttpRequest request; - // ENet does not support IPv6, so IPv4 has to be used - request.UseIPv4(); - Common::HttpRequest::Response response = - request.Get("https://ip.dolphin-emu.org/", {{"X-Is-Dolphin", "1"}}); - - if (response.has_value()) - return std::string(response->begin(), response->end()); - return ""; - }); + m_external_ip_address = + Common::Lazy<std::string>([]() -> std::string { return NetPlay::GetExternalIPAddress(); }); } void NetPlayDialog::UpdateDiscordPresence() |
