Merge remote branch 'origin/master' into 330

Also move accepteble build number to src/game/SharedDefines.h
as expected by new realmd code.
This commit is contained in:
VladimirMangos 2009-12-17 03:55:33 +03:00
commit 34d8d69e2b
42 changed files with 462 additions and 229 deletions

View file

@ -745,7 +745,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
BigNumber K;
// Read the content of the packet
recvPacket >> ClientBuild; // for now no use
recvPacket >> ClientBuild;
recvPacket >> unk2;
recvPacket >> account;
recvPacket >> unk3;
@ -760,6 +760,29 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
unk3,
clientSeed);
// Check the version of client trying to connect
bool valid_version = false;
int accepted_versions[] = EXPECTED_MANGOSD_CLIENT_BUILD;
for(int i = 0; accepted_versions[i]; ++i)
{
if(ClientBuild == accepted_versions[i])
{
valid_version = true;
break;
}
}
if(!valid_version)
{
packet.Initialize (SMSG_AUTH_RESPONSE, 1);
packet << uint8 (AUTH_VERSION_MISMATCH);
SendPacket (packet);
sLog.outError ("WorldSocket::HandleAuthSession: Sent Auth Response (version mismatch).");
return -1;
}
// Get the account information from the realmd database
std::string safe_account = account; // Duplicate, else will screw the SHA hash verification below
loginDatabase.escape_string (safe_account);