mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Get rid of pnUtW32Addr and make IP strings char*s.
IP addresses don't need to be unicode. pnUtAddr is still around until we replace all NetAddress uses with plNetAddress (they are typedef'ed to each other right now).
This commit is contained in:
@ -110,11 +110,11 @@ static bool s_loginComplete = false;
|
||||
static bool s_hasAuthSrvIpAddress = false;
|
||||
static bool s_hasFileSrvIpAddress = false;
|
||||
static ENetError s_authResult = kNetErrAuthenticationFailed;
|
||||
static wchar_t s_authSrvAddr[256];
|
||||
static wchar_t s_fileSrvAddr[256];
|
||||
static char s_authSrvAddr[256];
|
||||
static char s_fileSrvAddr[256];
|
||||
|
||||
static wchar_t s_iniServerAddr[256];
|
||||
static wchar_t s_iniFileServerAddr[256];
|
||||
static char s_iniServerAddr[256];
|
||||
static char s_iniFileServerAddr[256];
|
||||
static wchar_t s_iniAccountUsername[kMaxAccountNameLength];
|
||||
static ShaDigest s_namePassHash;
|
||||
static wchar_t s_iniAuthToken[kMaxPublisherAuthKeyLength];
|
||||
@ -667,7 +667,7 @@ static void AuthSrvIpAddressCallback (
|
||||
void * param,
|
||||
const wchar_t addr[]
|
||||
) {
|
||||
StrCopy(s_authSrvAddr, addr, arrsize(s_authSrvAddr));
|
||||
StrToAnsi(s_authSrvAddr, addr, arrsize(s_authSrvAddr));
|
||||
s_hasAuthSrvIpAddress = true;
|
||||
}
|
||||
|
||||
@ -677,7 +677,7 @@ static void FileSrvIpAddressCallback (
|
||||
void * param,
|
||||
const wchar_t addr[]
|
||||
) {
|
||||
StrCopy(s_fileSrvAddr, addr, arrsize(s_fileSrvAddr));
|
||||
StrToAnsi(s_fileSrvAddr, addr, arrsize(s_fileSrvAddr));
|
||||
s_hasFileSrvIpAddress = true;
|
||||
}
|
||||
|
||||
@ -822,12 +822,12 @@ void NetCommUpdate () {
|
||||
//============================================================================
|
||||
void NetCommConnect () {
|
||||
|
||||
const wchar_t ** addrs;
|
||||
const char** addrs;
|
||||
unsigned count;
|
||||
hsBool connectedToKeeper = false;
|
||||
|
||||
// if a console override was specified for a authserv, connect directly to the authserver rather than going through the gatekeeper
|
||||
if((count = GetAuthSrvHostnames(&addrs)) && wcslen(addrs[0]))
|
||||
if((count = GetAuthSrvHostnames(&addrs)) && strlen(addrs[0]))
|
||||
{
|
||||
NetCliAuthStartConnect(addrs, count);
|
||||
}
|
||||
@ -845,7 +845,7 @@ void NetCommConnect () {
|
||||
AsyncSleep(10);
|
||||
}
|
||||
|
||||
const wchar_t * authSrv[] = {
|
||||
const char* authSrv[] = {
|
||||
s_authSrvAddr
|
||||
};
|
||||
NetCliAuthStartConnect(authSrv, 1);
|
||||
@ -854,7 +854,7 @@ void NetCommConnect () {
|
||||
if (!gDataServerLocal) {
|
||||
|
||||
// if a console override was specified for a filesrv, connect directly to the fileserver rather than going through the gatekeeper
|
||||
if((count = GetFileSrvHostnames(&addrs)) && wcslen(addrs[0]))
|
||||
if((count = GetFileSrvHostnames(&addrs)) && strlen(addrs[0]))
|
||||
{
|
||||
NetCliFileStartConnect(addrs, count);
|
||||
}
|
||||
@ -874,7 +874,7 @@ void NetCommConnect () {
|
||||
AsyncSleep(10);
|
||||
}
|
||||
|
||||
const wchar_t * fileSrv[] = {
|
||||
const char* fileSrv[] = {
|
||||
s_fileSrvAddr
|
||||
};
|
||||
NetCliFileStartConnect(fileSrv, 1);
|
||||
|
@ -90,7 +90,7 @@ struct CliAuConn : AtomicRef {
|
||||
LINK(CliAuConn) link;
|
||||
AsyncSocket sock;
|
||||
NetCli * cli;
|
||||
wchar_t name[MAX_PATH];
|
||||
char name[MAX_PATH];
|
||||
plNetAddress addr;
|
||||
Uuid token;
|
||||
unsigned seq;
|
||||
@ -197,7 +197,7 @@ struct AgeRequestTrans : NetAuthTrans {
|
||||
unsigned m_ageMcpId;
|
||||
Uuid m_ageInstId;
|
||||
unsigned m_ageVaultId;
|
||||
NetAddressNode m_gameSrvNode;
|
||||
uint32_t m_gameSrvNode;
|
||||
|
||||
AgeRequestTrans (
|
||||
const wchar_t ageName[],
|
||||
@ -1527,7 +1527,7 @@ static void Connect (
|
||||
|
||||
//============================================================================
|
||||
static void Connect (
|
||||
const wchar_t name[],
|
||||
const char name[],
|
||||
const NetAddress & addr
|
||||
) {
|
||||
ASSERT(s_running);
|
||||
@ -1536,7 +1536,7 @@ static void Connect (
|
||||
conn->addr = addr;
|
||||
conn->seq = ConnNextSequence();
|
||||
conn->lastHeardTimeMs = GetNonZeroTimeMs(); // used in connect timeout, and ping timeout
|
||||
StrCopy(conn->name, name, arrsize(conn->name));
|
||||
strncpy(conn->name, name, arrsize(conn->name));
|
||||
|
||||
conn->IncRef("Lifetime");
|
||||
conn->AutoReconnect();
|
||||
@ -1545,7 +1545,7 @@ static void Connect (
|
||||
//============================================================================
|
||||
static void AsyncLookupCallback (
|
||||
void * param,
|
||||
const wchar_t name[],
|
||||
const char name[],
|
||||
unsigned addrCount,
|
||||
const plNetAddress addrs[]
|
||||
) {
|
||||
@ -5121,8 +5121,8 @@ void AuthPingEnable (bool enable) {
|
||||
|
||||
//============================================================================
|
||||
void NetCliAuthStartConnect (
|
||||
const wchar_t * authAddrList[],
|
||||
unsigned authAddrCount
|
||||
const char* authAddrList[],
|
||||
uint32_t authAddrCount
|
||||
) {
|
||||
// TEMP: Only connect to one auth server until we fill out this module
|
||||
// to choose the "best" auth connection.
|
||||
@ -5130,7 +5130,7 @@ void NetCliAuthStartConnect (
|
||||
|
||||
for (unsigned i = 0; i < authAddrCount; ++i) {
|
||||
// Do we need to lookup the address?
|
||||
const wchar_t * name = authAddrList[i];
|
||||
const char* name = authAddrList[i];
|
||||
while (unsigned ch = *name) {
|
||||
++name;
|
||||
if (!(isdigit(ch) || ch == L'.' || ch == L':')) {
|
||||
@ -5146,8 +5146,7 @@ void NetCliAuthStartConnect (
|
||||
}
|
||||
}
|
||||
if (!name[0]) {
|
||||
NetAddress addr;
|
||||
NetAddressFromString(&addr, authAddrList[i], kNetDefaultClientPort);
|
||||
NetAddress addr(authAddrList[i], kNetDefaultClientPort);
|
||||
Connect(authAddrList[i], addr);
|
||||
}
|
||||
}
|
||||
|
@ -62,8 +62,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
// Connect
|
||||
//============================================================================
|
||||
void NetCliAuthStartConnect (
|
||||
const wchar_t * authAddrList[],
|
||||
unsigned authAddrCount
|
||||
const char* authAddrList[],
|
||||
uint32_t authAddrCount
|
||||
);
|
||||
bool NetCliAuthQueryConnected ();
|
||||
void NetCliAuthAutoReconnectEnable (bool enable); // is enabled by default
|
||||
|
@ -413,7 +413,7 @@ static void Connect (
|
||||
//============================================================================
|
||||
static void AsyncLookupCallback (
|
||||
void * param,
|
||||
const wchar_t name[],
|
||||
const char name[],
|
||||
unsigned addrCount,
|
||||
const NetAddress addrs[]
|
||||
) {
|
||||
@ -830,8 +830,8 @@ unsigned CsrGetConnId () {
|
||||
|
||||
//============================================================================
|
||||
void NetCliCsrStartConnect (
|
||||
const wchar_t * addrList[],
|
||||
unsigned addrCount,
|
||||
const char* addrList[],
|
||||
uint32_t addrCount,
|
||||
FNetCliCsrConnectedCallback callback,
|
||||
void * param
|
||||
) {
|
||||
@ -840,7 +840,7 @@ void NetCliCsrStartConnect (
|
||||
|
||||
for (unsigned i = 0; i < addrCount; ++i) {
|
||||
// Do we need to lookup the address?
|
||||
const wchar_t * name = addrList[i];
|
||||
const char* name = addrList[i];
|
||||
while (unsigned ch = *name) {
|
||||
++name;
|
||||
if (!(isdigit(ch) || ch == L'.' || ch == L':')) {
|
||||
@ -860,8 +860,7 @@ void NetCliCsrStartConnect (
|
||||
}
|
||||
}
|
||||
if (!name[0]) {
|
||||
NetAddress addr;
|
||||
NetAddressFromString(&addr, addrList[i], kNetDefaultClientPort);
|
||||
NetAddress addr(addrList[i], kNetDefaultClientPort);
|
||||
|
||||
ConnectParam * cp = new ConnectParam;
|
||||
cp->callback = callback;
|
||||
|
@ -62,8 +62,8 @@ typedef void (*FNetCliCsrConnectedCallback) (
|
||||
unsigned latestBuildId
|
||||
);
|
||||
void NetCliCsrStartConnect (
|
||||
const wchar_t * addrList[],
|
||||
unsigned addrCount,
|
||||
const char* addrList[],
|
||||
uint32_t addrCount,
|
||||
FNetCliCsrConnectedCallback callback = nil,
|
||||
void * param = nil
|
||||
);
|
||||
|
@ -64,7 +64,7 @@ struct CliFileConn : AtomicRef {
|
||||
LINK(CliFileConn) link;
|
||||
CLock sockLock; // to protect the socket pointer so we don't nuke it while using it
|
||||
AsyncSocket sock;
|
||||
wchar_t name[MAX_PATH];
|
||||
char name[MAX_PATH];
|
||||
NetAddress addr;
|
||||
unsigned seq;
|
||||
ARRAY(uint8_t) recvBuffer;
|
||||
@ -539,13 +539,13 @@ static void Connect (CliFileConn * conn) {
|
||||
|
||||
//============================================================================
|
||||
static void Connect (
|
||||
const wchar_t name[],
|
||||
const char name[],
|
||||
const NetAddress & addr
|
||||
) {
|
||||
ASSERT(s_running);
|
||||
|
||||
CliFileConn * conn = NEWZERO(CliFileConn);
|
||||
StrCopy(conn->name, name, arrsize(conn->name));
|
||||
strncpy(conn->name, name, arrsize(conn->name));
|
||||
conn->addr = addr;
|
||||
conn->buildId = s_connectBuildId;
|
||||
conn->serverType = s_serverType;
|
||||
@ -559,7 +559,7 @@ static void Connect (
|
||||
//============================================================================
|
||||
static void AsyncLookupCallback (
|
||||
void * param,
|
||||
const wchar_t name[],
|
||||
const char name[],
|
||||
unsigned addrCount,
|
||||
const NetAddress addrs[]
|
||||
) {
|
||||
@ -1334,8 +1334,8 @@ unsigned FileGetConnId () {
|
||||
|
||||
//============================================================================
|
||||
void NetCliFileStartConnect (
|
||||
const wchar_t * fileAddrList[],
|
||||
unsigned fileAddrCount,
|
||||
const char* fileAddrList[],
|
||||
uint32_t fileAddrCount,
|
||||
bool isPatcher /* = false */
|
||||
) {
|
||||
// TEMP: Only connect to one file server until we fill out this module
|
||||
@ -1346,7 +1346,7 @@ void NetCliFileStartConnect (
|
||||
|
||||
for (unsigned i = 0; i < fileAddrCount; ++i) {
|
||||
// Do we need to lookup the address?
|
||||
const wchar_t * name = fileAddrList[i];
|
||||
const char* name = fileAddrList[i];
|
||||
while (unsigned ch = *name) {
|
||||
++name;
|
||||
if (!(isdigit(ch) || ch == L'.' || ch == L':')) {
|
||||
@ -1362,8 +1362,7 @@ void NetCliFileStartConnect (
|
||||
}
|
||||
}
|
||||
if (!name[0]) {
|
||||
NetAddress addr;
|
||||
NetAddressFromString(&addr, fileAddrList[i], kNetDefaultClientPort);
|
||||
NetAddress addr(fileAddrList[i], kNetDefaultClientPort);
|
||||
Connect(fileAddrList[i], addr);
|
||||
}
|
||||
}
|
||||
@ -1371,8 +1370,8 @@ void NetCliFileStartConnect (
|
||||
|
||||
//============================================================================
|
||||
void NetCliFileStartConnectAsServer (
|
||||
const wchar_t * fileAddrList[],
|
||||
unsigned fileAddrCount,
|
||||
const char* fileAddrList[],
|
||||
uint32_t fileAddrCount,
|
||||
unsigned serverType,
|
||||
unsigned serverBuildId
|
||||
) {
|
||||
@ -1384,7 +1383,7 @@ void NetCliFileStartConnectAsServer (
|
||||
|
||||
for (unsigned i = 0; i < fileAddrCount; ++i) {
|
||||
// Do we need to lookup the address?
|
||||
const wchar_t * name = fileAddrList[i];
|
||||
const char* name = fileAddrList[i];
|
||||
while (unsigned ch = *name) {
|
||||
++name;
|
||||
if (!(isdigit(ch) || ch == L'.' || ch == L':')) {
|
||||
@ -1400,8 +1399,7 @@ void NetCliFileStartConnectAsServer (
|
||||
}
|
||||
}
|
||||
if (!name[0]) {
|
||||
NetAddress addr;
|
||||
NetAddressFromString(&addr, fileAddrList[i], kNetDefaultServerPort);
|
||||
NetAddress addr(fileAddrList[i], kNetDefaultServerPort);
|
||||
Connect(fileAddrList[i], addr);
|
||||
}
|
||||
}
|
||||
|
@ -62,12 +62,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
// Connect
|
||||
//============================================================================
|
||||
void NetCliFileStartConnect (
|
||||
const wchar_t * fileAddrList[],
|
||||
const char* fileAddrList[],
|
||||
unsigned fileAddrCount,
|
||||
bool isPatcher = false
|
||||
);
|
||||
void NetCliFileStartConnectAsServer (
|
||||
const wchar_t * fileAddrList[],
|
||||
const char* fileAddrList[],
|
||||
unsigned fileAddrCount,
|
||||
unsigned serverType,
|
||||
unsigned serverBuildId
|
||||
|
@ -796,7 +796,7 @@ void GamePingEnable (bool enable) {
|
||||
|
||||
//============================================================================
|
||||
void NetCliGameStartConnect (
|
||||
const NetAddressNode & node
|
||||
const uint32_t node
|
||||
) {
|
||||
plNetAddress addr(node, kNetDefaultClientPort);
|
||||
Connect(addr);
|
||||
|
@ -61,7 +61,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
// Connect
|
||||
//============================================================================
|
||||
void NetCliGameStartConnect (
|
||||
const NetAddressNode & node
|
||||
const uint32_t node
|
||||
);
|
||||
|
||||
//============================================================================
|
||||
|
@ -89,7 +89,7 @@ struct CliGkConn : AtomicRef {
|
||||
LINK(CliGkConn) link;
|
||||
AsyncSocket sock;
|
||||
NetCli * cli;
|
||||
wchar_t name[MAX_PATH];
|
||||
char name[MAX_PATH];
|
||||
NetAddress addr;
|
||||
Uuid token;
|
||||
unsigned seq;
|
||||
@ -463,7 +463,7 @@ static void Connect (
|
||||
|
||||
//============================================================================
|
||||
static void Connect (
|
||||
const wchar_t name[],
|
||||
const char name[],
|
||||
const NetAddress & addr
|
||||
) {
|
||||
ASSERT(s_running);
|
||||
@ -472,7 +472,7 @@ static void Connect (
|
||||
conn->addr = addr;
|
||||
conn->seq = ConnNextSequence();
|
||||
conn->lastHeardTimeMs = GetNonZeroTimeMs(); // used in connect timeout, and ping timeout
|
||||
StrCopy(conn->name, name, arrsize(conn->name));
|
||||
strncpy(conn->name, name, arrsize(conn->name));
|
||||
|
||||
conn->IncRef("Lifetime");
|
||||
conn->AutoReconnect();
|
||||
@ -481,7 +481,7 @@ static void Connect (
|
||||
//============================================================================
|
||||
static void AsyncLookupCallback (
|
||||
void * param,
|
||||
const wchar_t name[],
|
||||
const char name[],
|
||||
unsigned addrCount,
|
||||
const NetAddress addrs[]
|
||||
) {
|
||||
@ -1053,14 +1053,14 @@ unsigned GateKeeperGetConnId () {
|
||||
|
||||
//============================================================================
|
||||
void NetCliGateKeeperStartConnect (
|
||||
const wchar_t * gateKeeperAddrList[],
|
||||
unsigned gateKeeperAddrCount
|
||||
const char* gateKeeperAddrList[],
|
||||
uint32_t gateKeeperAddrCount
|
||||
) {
|
||||
gateKeeperAddrCount = min(gateKeeperAddrCount, 1);
|
||||
|
||||
for (unsigned i = 0; i < gateKeeperAddrCount; ++i) {
|
||||
// Do we need to lookup the address?
|
||||
const wchar_t * name = gateKeeperAddrList[i];
|
||||
const char* name = gateKeeperAddrList[i];
|
||||
while (unsigned ch = *name) {
|
||||
++name;
|
||||
if (!(isdigit(ch) || ch == L'.' || ch == L':')) {
|
||||
@ -1076,8 +1076,7 @@ void NetCliGateKeeperStartConnect (
|
||||
}
|
||||
}
|
||||
if (!name[0]) {
|
||||
NetAddress addr;
|
||||
NetAddressFromString(&addr, gateKeeperAddrList[i], kNetDefaultClientPort);
|
||||
NetAddress addr(gateKeeperAddrList[i], kNetDefaultClientPort);
|
||||
Connect(gateKeeperAddrList[i], addr);
|
||||
}
|
||||
}
|
||||
|
@ -62,8 +62,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
// Connect
|
||||
//============================================================================
|
||||
void NetCliGateKeeperStartConnect (
|
||||
const wchar_t * gateKeeperAddrList[],
|
||||
unsigned gateKeeperAddrCount
|
||||
const char* gateKeeperAddrList[],
|
||||
uint32_t gateKeeperAddrCount
|
||||
);
|
||||
|
||||
bool NetCliGateKeeperQueryConnected ();
|
||||
|
Reference in New Issue
Block a user