mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:56:25 +02:00
Merge branch 'master' of https://github.com/worklist/hifi
This commit is contained in:
commit
e917924f7b
2 changed files with 11 additions and 4 deletions
|
@ -55,10 +55,10 @@ int main(int argc, const char * argv[])
|
||||||
// domain server
|
// domain server
|
||||||
bool isLocalMode = cmdOptionExists(argc, argv, "--local");
|
bool isLocalMode = cmdOptionExists(argc, argv, "--local");
|
||||||
if (isLocalMode) {
|
if (isLocalMode) {
|
||||||
printf("NOTE: Running in Local Mode!\n");
|
printf("NOTE: Running in local mode!\n");
|
||||||
} else {
|
} else {
|
||||||
printf("--------------------------------------------------\n");
|
printf("--------------------------------------------------\n");
|
||||||
printf("NOTE: Running in EC2 Mode. \n");
|
printf("NOTE: Not running in local mode. \n");
|
||||||
printf("If you're a developer testing a local system, you\n");
|
printf("If you're a developer testing a local system, you\n");
|
||||||
printf("probably want to include --local on command line.\n");
|
printf("probably want to include --local on command line.\n");
|
||||||
printf("--------------------------------------------------\n");
|
printf("--------------------------------------------------\n");
|
||||||
|
@ -104,9 +104,10 @@ int main(int argc, const char * argv[])
|
||||||
// so hardcode the EC2 public address for now
|
// so hardcode the EC2 public address for now
|
||||||
if (nodePublicAddress.sin_addr.s_addr == serverLocalAddress) {
|
if (nodePublicAddress.sin_addr.s_addr == serverLocalAddress) {
|
||||||
// If we're not running "local" then we do replace the IP
|
// If we're not running "local" then we do replace the IP
|
||||||
// with the EC2 IP. Otherwise, we use our normal public IP
|
// with 0. This designates to clients that the server is reachable
|
||||||
|
// at the same IP address
|
||||||
if (!isLocalMode) {
|
if (!isLocalMode) {
|
||||||
nodePublicAddress.sin_addr.s_addr = 895283510; // local IP in this format...
|
nodePublicAddress.sin_addr.s_addr = 0;
|
||||||
destinationSocket = (sockaddr*) &nodeLocalAddress;
|
destinationSocket = (sockaddr*) &nodeLocalAddress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,6 +352,12 @@ int NodeList::processDomainServerList(unsigned char* packetData, size_t dataByte
|
||||||
readPtr += unpackSocket(readPtr, (sockaddr*) &nodePublicSocket);
|
readPtr += unpackSocket(readPtr, (sockaddr*) &nodePublicSocket);
|
||||||
readPtr += unpackSocket(readPtr, (sockaddr*) &nodeLocalSocket);
|
readPtr += unpackSocket(readPtr, (sockaddr*) &nodeLocalSocket);
|
||||||
|
|
||||||
|
// if the public socket address is 0 then it's reachable at the same IP
|
||||||
|
// as the domain server
|
||||||
|
if (nodePublicSocket.sin_addr.s_addr == 0) {
|
||||||
|
inet_aton(_domainIP, &nodePublicSocket.sin_addr);
|
||||||
|
}
|
||||||
|
|
||||||
addOrUpdateNode((sockaddr*) &nodePublicSocket, (sockaddr*) &nodeLocalSocket, nodeType, nodeId);
|
addOrUpdateNode((sockaddr*) &nodePublicSocket, (sockaddr*) &nodeLocalSocket, nodeType, nodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue