mirror of
https://github.com/overte-org/overte.git
synced 2025-04-07 09:33: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),
|
||||
(sockaddr*) &agentLocalAddress);
|
||||
|
||||
sockaddr* destinationSocket = (sockaddr*) &agentPublicAddress;
|
||||
|
||||
// check the agent public address
|
||||
// if it matches our local address we're on the same box
|
||||
// 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
|
||||
if (!isLocalMode) {
|
||||
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
|
||||
currentBufferPos += packAgentId(currentBufferPos, newAgent->getAgentID());
|
||||
|
||||
sockaddr* destinationSocket = (sockaddr*) (isLocalMode ? &agentPublicAddress : &agentLocalAddress);
|
||||
|
||||
// send the constructed list back to this agent
|
||||
agentList->getAgentSocket()->send(destinationSocket,
|
||||
broadcastPacket,
|
||||
|
|
Loading…
Reference in a new issue