mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 03:17:08 +02:00
clients not on EC2 box should be talked to at public address
This commit is contained in:
parent
5e8e50e53b
commit
350ebfb80f
1 changed files with 3 additions and 2 deletions
|
@ -103,6 +103,8 @@ int main(int argc, const char * argv[])
|
||||||
int numBytesSocket = unpackSocket(packetData + sizeof(PACKET_HEADER) + sizeof(AGENT_TYPE),
|
int numBytesSocket = unpackSocket(packetData + sizeof(PACKET_HEADER) + sizeof(AGENT_TYPE),
|
||||||
(sockaddr*) &agentLocalAddress);
|
(sockaddr*) &agentLocalAddress);
|
||||||
|
|
||||||
|
sockaddr* destinationSocket = (sockaddr*) &agentPublicAddress;
|
||||||
|
|
||||||
// check the agent public address
|
// check the agent public address
|
||||||
// if it matches our local address we're on the same box
|
// if it matches our local address we're on the same box
|
||||||
// so hardcode the EC2 public address for now
|
// so hardcode the EC2 public address for now
|
||||||
|
@ -111,6 +113,7 @@ int main(int argc, const char * argv[])
|
||||||
// with the EC2 IP. Otherwise, we use our normal public IP
|
// with the EC2 IP. Otherwise, we use our normal public IP
|
||||||
if (!isLocalMode) {
|
if (!isLocalMode) {
|
||||||
agentPublicAddress.sin_addr.s_addr = 895283510; // local IP in this format...
|
agentPublicAddress.sin_addr.s_addr = 895283510; // local IP in this format...
|
||||||
|
destinationSocket = (sockaddr*) &agentLocalAddress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,8 +180,6 @@ int main(int argc, const char * argv[])
|
||||||
// add the agent ID to the end of the pointer
|
// add the agent ID to the end of the pointer
|
||||||
currentBufferPos += packAgentId(currentBufferPos, newAgent->getAgentID());
|
currentBufferPos += packAgentId(currentBufferPos, newAgent->getAgentID());
|
||||||
|
|
||||||
sockaddr* destinationSocket = (sockaddr*) (isLocalMode ? &agentPublicAddress : &agentLocalAddress);
|
|
||||||
|
|
||||||
// send the constructed list back to this agent
|
// send the constructed list back to this agent
|
||||||
agentList->getAgentSocket()->send(destinationSocket,
|
agentList->getAgentSocket()->send(destinationSocket,
|
||||||
broadcastPacket,
|
broadcastPacket,
|
||||||
|
|
Loading…
Reference in a new issue