Common/TraversalClient: Move interface into Common namespace

Gets the interface out of the global namespace.
This commit is contained in:
Lioncash
2023-04-24 08:15:55 -04:00
parent ffbbd72741
commit 27f38c6c8f
8 changed files with 66 additions and 52 deletions

View File

@ -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