diff options
author | Nay <dnpd.dd@gmail.com> | 2012-08-28 14:12:17 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2012-08-28 14:12:17 +0100 |
commit | 449e577b70dab742942eeae2da88973d36048e8b (patch) | |
tree | f9e6e2266bc4589f701558b19a2cb70c538fbc0a /src/server/authserver/Authentication | |
parent | 9bb198d17037a9b41be09d137bb6237f9acd62c5 (diff) |
Core/Authserver: Fix previous merge
Diffstat (limited to 'src/server/authserver/Authentication')
-rw-r--r-- | src/server/authserver/Authentication/AuthCodes.cpp | 56 | ||||
-rwxr-xr-x | src/server/authserver/Authentication/AuthCodes.h | 18 |
2 files changed, 69 insertions, 5 deletions
diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp index 7a97cbee3de..bdb96ca0d25 100644 --- a/src/server/authserver/Authentication/AuthCodes.cpp +++ b/src/server/authserver/Authentication/AuthCodes.cpp @@ -16,17 +16,65 @@ */ #include "AuthCodes.h" +#include <cstddef> namespace AuthHelper { - bool IsAcceptedClientBuild(int build) + static RealmBuildInfo const PostBcAcceptedClientBuilds[] = + { + {15595, 4, 3, 4, ' '}, + {14545, 4, 2, 2, ' '}, + {13623, 4, 0, 6, 'a'}, + {12340, 3, 3, 5, 'a'}, + {11723, 3, 3, 3, 'a'}, + {11403, 3, 3, 2, ' '}, + {11159, 3, 3, 0, 'a'}, + {10505, 3, 2, 2, 'a'}, + {9947, 3, 1, 3, ' '}, + {8606, 2, 4, 3, ' '}, + {0, 0, 0, 0, ' '} // terminator + }; + + static RealmBuildInfo const PreBcAcceptedClientBuilds[] = + { + {6005, 1, 12, 2, ' '}, + {5875, 1, 12, 1, ' '}, + {0, 0, 0, 0, ' '} // terminator + }; + + bool IsPreBCAcceptedClientBuild(int build) { - static int accepted_versions[] = TRINITYCORE_ACCEPTED_CLIENT_BUILD; + for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i) + if (PreBcAcceptedClientBuilds[i].Build == build) + return true; - for (int i = 0; accepted_versions[i]; ++i) - if (build == accepted_versions[i]) + return false; + } + + bool IsPostBCAcceptedClientBuild(int build) + { + for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i) + if (PostBcAcceptedClientBuilds[i].Build == build) return true; return false; } + + bool IsAcceptedClientBuild(int build) + { + return (IsPostBCAcceptedClientBuild(build) || IsPreBCAcceptedClientBuild(build)); + } + + RealmBuildInfo const* GetBuildInfo(int build) + { + for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i) + if (PostBcAcceptedClientBuilds[i].Build == build) + return &PostBcAcceptedClientBuilds[i]; + + for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i) + if (PreBcAcceptedClientBuilds[i].Build == build) + return &PreBcAcceptedClientBuilds[i]; + + return NULL; + } }; diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index 9d631a5800d..148225377ff 100755 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -65,12 +65,28 @@ enum LoginResult LOGIN_LOCKED_ENFORCED = 0x10, }; -#define TRINITYCORE_ACCEPTED_CLIENT_BUILD {15595, 12340, 0} // accept one Cataclysm and one Wrath of the Lich King build +enum ExpansionFlags +{ + POST_BC_EXP_FLAG = 0x2, + PRE_BC_EXP_FLAG = 0x1, + NO_VALID_EXP_FLAG = 0x0 +}; +struct RealmBuildInfo +{ + int Build; + int MajorVersion; + int MinorVersion; + int BugfixVersion; + int HotfixVersion; +}; namespace AuthHelper { + RealmBuildInfo const* GetBuildInfo(int build); bool IsAcceptedClientBuild(int build); + bool IsPostBCAcceptedClientBuild(int build); + bool IsPreBCAcceptedClientBuild(int build); }; #endif |