mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Common/TraversalClient: Move interface into Common namespace
Gets the interface out of the global namespace.
This commit is contained in:
@ -12,6 +12,8 @@
|
||||
#include "Common/Random.h"
|
||||
#include "Core/NetPlayProto.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
TraversalClient::TraversalClient(ENetHost* netHost, const std::string& server, const u16 port)
|
||||
: m_NetHost(netHost), m_Server(server), m_port(port)
|
||||
{
|
||||
@ -304,7 +306,7 @@ int ENET_CALLBACK TraversalClient::InterceptCallback(ENetHost* host, ENetEvent*
|
||||
}
|
||||
|
||||
std::unique_ptr<TraversalClient> g_TraversalClient;
|
||||
Common::ENet::ENetHostPtr g_MainNetHost;
|
||||
ENet::ENetHostPtr g_MainNetHost;
|
||||
|
||||
// The settings at the previous TraversalClient reset - notably, we
|
||||
// need to know not just what port it's on, but whether it was
|
||||
@ -348,3 +350,4 @@ void ReleaseTraversalClient()
|
||||
g_TraversalClient.reset();
|
||||
g_MainNetHost.reset();
|
||||
}
|
||||
} // namespace Common
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include "Common/Thread.h"
|
||||
#include "Common/TraversalProto.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
class TraversalClientClient
|
||||
{
|
||||
public:
|
||||
@ -90,9 +92,12 @@ private:
|
||||
u16 m_port;
|
||||
u32 m_PingTime = 0;
|
||||
};
|
||||
|
||||
extern std::unique_ptr<TraversalClient> g_TraversalClient;
|
||||
// the NetHost connected to the TraversalClient.
|
||||
extern Common::ENet::ENetHostPtr g_MainNetHost;
|
||||
extern ENet::ENetHostPtr g_MainNetHost;
|
||||
|
||||
// Create g_TraversalClient and g_MainNetHost if necessary.
|
||||
bool EnsureTraversalClient(const std::string& server, u16 server_port, u16 listen_port = 0);
|
||||
void ReleaseTraversalClient();
|
||||
} // namespace Common
|
||||
|
Reference in New Issue
Block a user