Merge pull request #11753 from lioncash/upnp

Common/UPnP: Move interface into Common namespace
This commit is contained in:
Admiral H. Curtiss 2023-04-12 21:33:16 +02:00 committed by GitHub
commit 1e4b0d032e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -164,14 +164,14 @@ static void UnmapPortThread()
UnmapPort(s_mapped); UnmapPort(s_mapped);
} }
void UPnP::TryPortmapping(u16 port) void Common::UPnP::TryPortmapping(u16 port)
{ {
if (s_thread.joinable()) if (s_thread.joinable())
s_thread.join(); s_thread.join();
s_thread = std::thread(&MapPortThread, port); s_thread = std::thread(&MapPortThread, port);
} }
void UPnP::StopPortmapping() void Common::UPnP::StopPortmapping()
{ {
if (s_thread.joinable()) if (s_thread.joinable())
s_thread.join(); s_thread.join();

View File

@ -7,10 +7,10 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
namespace UPnP namespace Common::UPnP
{ {
void TryPortmapping(u16 port); void TryPortmapping(u16 port);
void StopPortmapping(); void StopPortmapping();
} // namespace UPnP } // namespace Common::UPnP
#endif #endif

View File

@ -111,7 +111,7 @@ NetPlayServer::~NetPlayServer()
} }
#ifdef USE_UPNP #ifdef USE_UPNP
UPnP::StopPortmapping(); Common::UPnP::StopPortmapping();
#endif #endif
} }
@ -168,7 +168,7 @@ NetPlayServer::NetPlayServer(const u16 port, const bool forward_port, NetPlayUI*
#ifdef USE_UPNP #ifdef USE_UPNP
if (forward_port) if (forward_port)
UPnP::TryPortmapping(port); Common::UPnP::TryPortmapping(port);
#endif #endif
} }
} }