|
|
@ -1365,51 +1365,14 @@ void NetCliFileStartConnect ( |
|
|
|
&cancelId, |
|
|
|
&cancelId, |
|
|
|
AsyncLookupCallback, |
|
|
|
AsyncLookupCallback, |
|
|
|
fileAddrList[i], |
|
|
|
fileAddrList[i], |
|
|
|
kNetDefaultClientPort, |
|
|
|
GetClientPort(), |
|
|
|
nil |
|
|
|
nil |
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!name[0]) { |
|
|
|
if (!name[0]) { |
|
|
|
plNetAddress addr(fileAddrList[i], kNetDefaultClientPort); |
|
|
|
plNetAddress addr(fileAddrList[i], GetClientPort()); |
|
|
|
Connect(fileAddrList[i], addr); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
void NetCliFileStartConnectAsServer ( |
|
|
|
|
|
|
|
const char* fileAddrList[], |
|
|
|
|
|
|
|
uint32_t fileAddrCount, |
|
|
|
|
|
|
|
unsigned serverType, |
|
|
|
|
|
|
|
unsigned serverBuildId |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
// TEMP: Only connect to one file server until we fill out this module
|
|
|
|
|
|
|
|
// to choose the "best" file connection.
|
|
|
|
|
|
|
|
fileAddrCount = std::min(fileAddrCount, 1u); |
|
|
|
|
|
|
|
s_connectBuildId = serverBuildId; |
|
|
|
|
|
|
|
s_serverType = serverType; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < fileAddrCount; ++i) { |
|
|
|
|
|
|
|
// Do we need to lookup the address?
|
|
|
|
|
|
|
|
const char* name = fileAddrList[i]; |
|
|
|
|
|
|
|
while (unsigned ch = *name) { |
|
|
|
|
|
|
|
++name; |
|
|
|
|
|
|
|
if (!(isdigit(ch) || ch == L'.' || ch == L':')) { |
|
|
|
|
|
|
|
AsyncCancelId cancelId; |
|
|
|
|
|
|
|
AsyncAddressLookupName( |
|
|
|
|
|
|
|
&cancelId, |
|
|
|
|
|
|
|
AsyncLookupCallback, |
|
|
|
|
|
|
|
fileAddrList[i], |
|
|
|
|
|
|
|
kNetDefaultClientPort, |
|
|
|
|
|
|
|
nil |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!name[0]) { |
|
|
|
|
|
|
|
plNetAddress addr(fileAddrList[i], kNetDefaultServerPort); |
|
|
|
|
|
|
|
Connect(fileAddrList[i], addr); |
|
|
|
Connect(fileAddrList[i], addr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|