diff --git a/src/trinityrealm/AuthCodes.h b/src/trinityrealm/AuthCodes.h index 53ae2236bc..e0bfcf96ce 100644 --- a/src/trinityrealm/AuthCodes.h +++ b/src/trinityrealm/AuthCodes.h @@ -72,8 +72,19 @@ enum LoginResult //2.4.3 build 8606 //3.1.3 build 9947 //3.1.3 build 10146 Chinese build -//3.2.2a build 10505 -#define EXPECTED_TRINITY_CLIENT_BUILD {10505, 10146, 9947, 8606, 5875, 6005, 0} +#define POST_BC_ACCEPTED_CLIENT_BUILD {10505, 10146, 9947, 8606, 0} +#define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0} + +#define POST_BC_EXP_FLAG 0x2 +#define PRE_BC_EXP_FLAG 0x1 +#define NO_VALID_EXP_FLAG 0x0 + +namespace AuthHelper +{ + bool IsAcceptedClientBuild(int build); + bool IsPostBCAcceptedClientBuild(int build); + bool IsPreBCAcceptedClientBuild(int build); +}; #endif diff --git a/src/trinityrealm/AuthSocket.cpp b/src/trinityrealm/AuthSocket.cpp index bd79fc5d20..a19d16106f 100644 --- a/src/trinityrealm/AuthSocket.cpp +++ b/src/trinityrealm/AuthSocket.cpp @@ -379,6 +379,7 @@ bool AuthSocket::_HandleLogonChallenge() _login = (const char*)ch->I; _build = ch->build; + _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) + (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG); ///- Normalize account name //utf8ToUpperOnlyLatin(_login); -- client already send account in expected form @@ -549,22 +550,10 @@ bool AuthSocket::_HandleLogonProof() sAuthLogonProof_C lp; ibuf.Read((char *)&lp, sizeof(sAuthLogonProof_C)); - ///- Check if the client has one of the expected version numbers - bool valid_version = false; - int accepted_versions[] = EXPECTED_TRINITY_CLIENT_BUILD; - for (int i = 0; accepted_versions[i]; ++i) - { - if (_build == accepted_versions[i]) - { - valid_version = true; - break; - } - } - ///