mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
feat(Core/RealmList): port TrinityCore realm api (#5626)
* feat(Core/RealmList): port TrinityCore realm api * 1 * whitespace cleanup * Update data/sql/updates/pending_db_auth/rev_1620114805872279900.sql Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * 1 * 2 * Update data/sql/updates/pending_db_auth/rev_1620114805872279900.sql Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * ` * 1 * small corrects * finish maybe * realm.Id.Realm * ws * 1 Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -5,66 +5,24 @@
|
||||
*/
|
||||
|
||||
#include "AuthCodes.h"
|
||||
#include <cstddef>
|
||||
#include "RealmList.h"
|
||||
|
||||
namespace AuthHelper
|
||||
{
|
||||
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
|
||||
};
|
||||
constexpr static uint32 MAX_PRE_BC_CLIENT_BUILD = 6141;
|
||||
|
||||
static RealmBuildInfo const PreBcAcceptedClientBuilds[] =
|
||||
bool IsPreBCAcceptedClientBuild(uint32 build)
|
||||
{
|
||||
{6141, 1, 12, 3, ' '},
|
||||
{6005, 1, 12, 2, ' '},
|
||||
{5875, 1, 12, 1, ' '},
|
||||
{0, 0, 0, 0, ' '} // terminator
|
||||
};
|
||||
|
||||
bool IsPreBCAcceptedClientBuild(int build)
|
||||
{
|
||||
for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i)
|
||||
if (PreBcAcceptedClientBuilds[i].Build == build)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return build <= MAX_PRE_BC_CLIENT_BUILD && sRealmList->GetBuildInfo(build);
|
||||
}
|
||||
|
||||
bool IsPostBCAcceptedClientBuild(int build)
|
||||
bool IsPostBCAcceptedClientBuild(uint32 build)
|
||||
{
|
||||
for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i)
|
||||
if (PostBcAcceptedClientBuilds[i].Build == build)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return build > MAX_PRE_BC_CLIENT_BUILD && sRealmList->GetBuildInfo(build);
|
||||
}
|
||||
|
||||
bool IsAcceptedClientBuild(int build)
|
||||
bool IsAcceptedClientBuild(uint32 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 nullptr;
|
||||
return sRealmList->GetBuildInfo(build) != nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user