|
|
@ -41,11 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com |
|
|
|
*==LICENSE==*/ |
|
|
|
*==LICENSE==*/ |
|
|
|
|
|
|
|
|
|
|
|
#include "pnNbSrvs.h" |
|
|
|
#include "pnNbSrvs.h" |
|
|
|
|
|
|
|
#include "plString.h" |
|
|
|
#if !HS_BUILD_FOR_WIN32 |
|
|
|
|
|
|
|
# include <wchar.h> |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
/*****************************************************************************
|
|
|
|
* |
|
|
|
* |
|
|
@ -53,22 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com |
|
|
|
* |
|
|
|
* |
|
|
|
***/ |
|
|
|
***/ |
|
|
|
|
|
|
|
|
|
|
|
static char s_authAddrConsole[64] = {0}; |
|
|
|
static plString s_authAddrs[] = { "" }; |
|
|
|
static const char* s_authAddrs[] = { |
|
|
|
static plString s_fileAddrs[] = { "" }; |
|
|
|
s_authAddrConsole |
|
|
|
static plString s_gateKeeperAddrs[] = { "" }; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static char s_fileAddrConsole[64] = {0}; |
|
|
|
|
|
|
|
static const char* s_fileAddrs[] = { |
|
|
|
|
|
|
|
s_fileAddrConsole |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static char s_gateKeeperAddrConsole[64] = {0}; |
|
|
|
|
|
|
|
static const char* s_gateKeeperAddrs[] = { |
|
|
|
|
|
|
|
s_gateKeeperAddrConsole |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static unsigned s_clientPort = 14617; |
|
|
|
static unsigned s_clientPort = 14617; |
|
|
|
|
|
|
|
|
|
|
@ -82,45 +65,40 @@ static unsigned s_clientPort = 14617; |
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
// Auth
|
|
|
|
// Auth
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
unsigned GetAuthSrvHostnames (const char*** addrs) { |
|
|
|
unsigned GetAuthSrvHostnames (const plString*& addrs) { |
|
|
|
|
|
|
|
addrs = s_authAddrs; |
|
|
|
*addrs = s_authAddrs;
|
|
|
|
|
|
|
|
return arrsize(s_authAddrs); |
|
|
|
return arrsize(s_authAddrs); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void SetAuthSrvHostname (const char addr[]) { |
|
|
|
void SetAuthSrvHostname (const plString& addr) { |
|
|
|
|
|
|
|
s_authAddrs[0] = addr; |
|
|
|
strncpy(s_authAddrConsole, addr, arrsize(s_authAddrConsole)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
// File
|
|
|
|
// File
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
unsigned GetFileSrvHostnames (const char*** addrs) { |
|
|
|
unsigned GetFileSrvHostnames (const plString*& addrs) { |
|
|
|
|
|
|
|
addrs = s_fileAddrs; |
|
|
|
*addrs = s_fileAddrs;
|
|
|
|
|
|
|
|
return arrsize(s_fileAddrs); |
|
|
|
return arrsize(s_fileAddrs); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void SetFileSrvHostname (const char addr[]) { |
|
|
|
void SetFileSrvHostname (const plString& addr) { |
|
|
|
|
|
|
|
s_fileAddrs[0] = addr; |
|
|
|
strncpy(s_fileAddrConsole, addr, arrsize(s_fileAddrConsole)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
// GateKeeper
|
|
|
|
// GateKeeper
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
unsigned GetGateKeeperSrvHostnames (const char*** addrs) { |
|
|
|
unsigned GetGateKeeperSrvHostnames (const plString*& addrs) { |
|
|
|
|
|
|
|
addrs = s_gateKeeperAddrs; |
|
|
|
*addrs = s_gateKeeperAddrs;
|
|
|
|
|
|
|
|
return arrsize(s_gateKeeperAddrs); |
|
|
|
return arrsize(s_gateKeeperAddrs); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void SetGateKeeperSrvHostname (const char addr[]) { |
|
|
|
void SetGateKeeperSrvHostname (const plString& addr) { |
|
|
|
strncpy(s_gateKeeperAddrConsole, addr, arrsize(s_gateKeeperAddrConsole)); |
|
|
|
s_gateKeeperAddrs[0] = addr; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
@ -139,36 +117,36 @@ void SetClientPort(unsigned port) { |
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
// User-visible Server
|
|
|
|
// User-visible Server
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
static char s_serverStatusUrl[256] = {0}; |
|
|
|
static plString s_serverStatusUrl; |
|
|
|
static char s_serverSignupUrl[256] = {0}; |
|
|
|
static plString s_serverSignupUrl; |
|
|
|
static char s_serverName[256] = {0}; |
|
|
|
static plString s_serverName; |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
const char* GetServerStatusUrl () { |
|
|
|
plString GetServerStatusUrl () { |
|
|
|
return s_serverStatusUrl; |
|
|
|
return s_serverStatusUrl; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void SetServerStatusUrl (const char url[]) { |
|
|
|
void SetServerStatusUrl (const plString& url) { |
|
|
|
strncpy(s_serverStatusUrl, url, arrsize(s_serverStatusUrl)); |
|
|
|
s_serverStatusUrl = url; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
const char* GetServerSignupUrl () { |
|
|
|
plString GetServerSignupUrl () { |
|
|
|
return s_serverSignupUrl; |
|
|
|
return s_serverSignupUrl; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void SetServerSignupUrl (const char url[]) { |
|
|
|
void SetServerSignupUrl (const plString& url) { |
|
|
|
strncpy(s_serverSignupUrl, url, arrsize(s_serverSignupUrl)); |
|
|
|
s_serverSignupUrl = url; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
const char* GetServerDisplayName () { |
|
|
|
plString GetServerDisplayName () { |
|
|
|
return s_serverName; |
|
|
|
return s_serverName; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void SetServerDisplayName (const char name[]) { |
|
|
|
void SetServerDisplayName (const plString& name) { |
|
|
|
strncpy(s_serverName, name, arrsize(s_serverName)); |
|
|
|
s_serverName = name; |
|
|
|
} |
|
|
|
} |
|
|
|