Preliminary IPV6 Support

This commit is contained in:
James Urquhart 2016-09-10 23:01:10 +01:00
parent 1a851f167d
commit 704577e051
22 changed files with 1712 additions and 592 deletions

View file

@ -157,7 +157,7 @@ bool NetConnection::mFilesWereDownloaded = false;
static inline U32 HashNetAddress(const NetAddress *addr)
{
return *((U32 *)addr->netNum) % NetConnection::HashTableSize;
return addr->getHash() % NetConnection::HashTableSize;
}
NetConnection *NetConnection::lookup(const NetAddress *addr)
@ -1421,7 +1421,7 @@ DefineEngineMethod( NetConnection, connect, void, (const char* remoteAddress),,
)
{
NetAddress addr;
if(!Net::stringToAddress(remoteAddress, &addr))
if (Net::stringToAddress(remoteAddress, &addr) != Net::NoError)
{
Con::errorf("NetConnection::connect: invalid address - %s", remoteAddress);
return;

View file

@ -41,7 +41,7 @@ NetInterface::NetInterface()
GNet = this;
mLastTimeoutCheckTime = 0;
mAllowConnections = true;
mAllowConnections = false;
}
@ -109,7 +109,7 @@ void NetInterface::processPacketReceiveEvent(NetAddress srcAddress, RawData pack
pStream.read(&packetType);
NetAddress *addr = &srcAddress;
if(packetType <= GameHeartbeat)
if(packetType <= GameHeartbeat || packetType == MasterServerExtendedListResponse)
handleInfoPacket(addr, packetType, &pStream);
#ifdef GGC_PLUGIN
else if (packetType == GGCPacket)
@ -556,10 +556,7 @@ void NetInterface::computeNetMD5(const NetAddress *address, U32 connectSequence,
U32 in[16];
in[0] = address->type;
in[1] = (U32(address->netNum[0]) << 24) |
(U32(address->netNum[1]) << 16) |
(U32(address->netNum[2]) << 8) |
(U32(address->netNum[3]));
in[1] = address->getHash();
in[2] = address->port;
in[3] = connectSequence;
for(U32 i = 0; i < 12; i++)

View file

@ -46,7 +46,7 @@ public:
GameInfoRequest = 18,
GameInfoResponse = 20,
GameHeartbeat = 22,
GGCPacket = 24,
GGCPacket = 24,
ConnectChallengeRequest = 26,
ConnectChallengeReject = 28,
ConnectChallengeResponse = 30,
@ -54,6 +54,9 @@ public:
ConnectReject = 34,
ConnectAccept = 36,
Disconnect = 38,
MasterServerExtendedListResponse = 40,
MasterServerChallenge = 42,
MasterServerExtendedListRequest = 44,
};
protected: