From e66fa5ffb17412a98e50f300adc9bcef74350626 Mon Sep 17 00:00:00 2001 From: Rene Jochum Date: Fri, 29 Apr 2011 14:22:29 +0200 Subject: [PATCH] Moves the declaration of "lobbyclient" to netplay.cpp/h as it should not be part of the lobby library. --- lib/netplay/netlobby.cpp | 7 +------ lib/netplay/netlobby.h | 2 -- lib/netplay/netplay.cpp | 3 +++ lib/netplay/netplay.h | 2 ++ 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/netplay/netlobby.cpp b/lib/netplay/netlobby.cpp index 6abd41d1a..77c988f3d 100644 --- a/lib/netplay/netlobby.cpp +++ b/lib/netplay/netlobby.cpp @@ -20,11 +20,6 @@ #include "netlobby.h" -/** - * Variables - */ -Lobby::Client lobbyclient; - namespace Lobby { Client::Client() @@ -57,7 +52,7 @@ namespace Lobby isAuthenticated_ = false; // and disconnect. - lobbyclient.disconnect(); + disconnect(); } RETURN_CODES Client::addGame(char** result, const uint32_t port, const uint32_t maxPlayers, diff --git a/lib/netplay/netlobby.h b/lib/netplay/netlobby.h index ab9864ab4..a8811b394 100644 --- a/lib/netplay/netlobby.h +++ b/lib/netplay/netlobby.h @@ -184,6 +184,4 @@ namespace Lobby } // namespace Lobby -extern Lobby::Client lobbyclient; - #endif // #ifndef _netlobby_h diff --git a/lib/netplay/netplay.cpp b/lib/netplay/netplay.cpp index fc36dca61..2fcd305b7 100644 --- a/lib/netplay/netplay.cpp +++ b/lib/netplay/netplay.cpp @@ -156,6 +156,9 @@ char VersionString[VersionStringSize] = "master, netcode 4.1012"; static int NETCODE_VERSION_MAJOR = 4; static int NETCODE_VERSION_MINOR = 1012; +// The Lobby Client - declared external in netplay.h +Lobby::Client lobbyclient; + bool NETisCorrectVersion(uint32_t game_version_major, uint32_t game_version_minor) { return (NETCODE_VERSION_MAJOR == game_version_major && NETCODE_VERSION_MINOR == game_version_minor); diff --git a/lib/netplay/netplay.h b/lib/netplay/netplay.h index 4eb4c5608..84f923574 100644 --- a/lib/netplay/netplay.h +++ b/lib/netplay/netplay.h @@ -251,6 +251,8 @@ extern bool netPlayersUpdated; extern int mapDownloadProgress; extern char iptoconnect[PATH_MAX]; // holds IP/hostname from command line +extern Lobby::Client lobbyclient; + // //////////////////////////////////////////////////////////////////////// // functions available to you. extern int NETinit(bool bFirstCall); // init