diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/trinityrealm/AuthCodes.h | 9 | ||||
-rw-r--r-- | src/trinityrealm/AuthSocket.cpp | 30 |
2 files changed, 22 insertions, 17 deletions
diff --git a/src/trinityrealm/AuthCodes.h b/src/trinityrealm/AuthCodes.h index 51e19f6cc45..944d98f788e 100644 --- a/src/trinityrealm/AuthCodes.h +++ b/src/trinityrealm/AuthCodes.h @@ -72,12 +72,5 @@ enum LoginResult //2.4.3 build 8606 //3.1.3 build 9947 //3.1.3 build 10146 Chinese build - -int accepted_versions[3][3] -{ - {5875, 6005, 0} - {8606, 0, 0} - {10146, 9947, 0} -} - +int accepted_versions[3][3]; #endif diff --git a/src/trinityrealm/AuthSocket.cpp b/src/trinityrealm/AuthSocket.cpp index a80459c77cc..d4acaafac15 100644 --- a/src/trinityrealm/AuthSocket.cpp +++ b/src/trinityrealm/AuthSocket.cpp @@ -539,9 +539,24 @@ bool AuthSocket::_HandleLogonChallenge() return true; } +bool valid_pre_version = false; +bool valid_tbc_version = false; +bool valid_wlk_version = false; /// Logon Proof command handler bool AuthSocket::_HandleLogonProof() { + for (int a = 0; a < 3; ++a) + { + accepted_versions[0][a] = 5875, 6005, 0; + } + for (int a = 0; a < 3; ++a) + { + accepted_versions[1][a] = 8606, 0, 0; + } + for (int a = 0; a < 3; ++a) + { + accepted_versions[2][a] = 10146, 9947, 0; + } DEBUG_LOG("Entering _HandleLogonProof"); ///- Read the packet if (ibuf.GetLength() < sizeof(sAuthLogonProof_C)) @@ -550,29 +565,26 @@ bool AuthSocket::_HandleLogonProof() ibuf.Read((char *)&lp, sizeof(sAuthLogonProof_C)); ///- Check if the client has one of the expected version numbers - bool valid_pre_version = false; - bool valid_tbc_version = false; - bool valid_wlk_version = false; //int accepted_versions[] = EXPECTED_TRINITY_CLIENT_BUILD; - for (int i = 0; accepted_versions[1][i]; ++i) + for (int i = 0; accepted_versions[0][i]; ++i) { - if (_build == accepted_versions[1][i]) + if (_build == accepted_versions[0][i]) { valid_pre_version = true; break; } } - for (int i = 0; accepted_versions[2][i]; ++i) + for (int i = 0; accepted_versions[1][i]; ++i) { - if (_build == accepted_versions[2][i]) + if (_build == accepted_versions[1][i]) { valid_tbc_version = true; break; } } - for (int i = 0; accepted_versions[3][i]; ++i) + for (int i = 0; accepted_versions[2][i]; ++i) { - if (_build == accepted_versions[3][i]) + if (_build == accepted_versions[2][i]) { valid_wlk_version = true; break; |