Core: Backport 6.x realm changes

Make acessible all the info about current realm (e.g name) anywhere, not only realm id
Reduce the number of differences between the two branches

Original changes by Shauren

Partial port of bacc90b6ba and 63def8aa32
This commit is contained in:
DDuarte
2016-02-28 03:48:28 +00:00
parent 510bb30b2c
commit 2ea31027e5
23 changed files with 266 additions and 127 deletions

View File

@@ -164,7 +164,7 @@ public:
///- Get the accounts with GM Level >0
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS);
stmt->setUInt8(0, uint8(SEC_MODERATOR));
stmt->setInt32(1, int32(realmID));
stmt->setInt32(1, int32(realm.Id.Realm));
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)

View File

@@ -1588,7 +1588,7 @@ public:
// Query the prepared statement for login data
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
stmt->setInt32(0, int32(realmID));
stmt->setInt32(0, int32(realm.Id.Realm));
stmt->setUInt32(1, accId);
PreparedQueryResult result = LoginDatabase.Query(stmt);

View File

@@ -157,7 +157,7 @@ public:
if (!rdata)
{
data->rbac = new rbac::RBACData(accountId, accountName, realmID, AccountMgr::GetSecurity(accountId, realmID));
data->rbac = new rbac::RBACData(accountId, accountName, realm.Id.Realm, AccountMgr::GetSecurity(accountId, realm.Id.Realm));
data->rbac->LoadFromDB();
data->needDelete = true;
}

View File

@@ -95,7 +95,7 @@ public:
ObjectGuid targetGuid = sObjectMgr->GetPlayerGUIDByName(target);
uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
// Target must exist and have administrative rights
if (!AccountMgr::HasPermission(accountId, rbac::RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET, realmID))
if (!AccountMgr::HasPermission(accountId, rbac::RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET, realm.Id.Realm))
{
handler->SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
return true;
@@ -119,7 +119,7 @@ public:
// Assign ticket
SQLTransaction trans = SQLTransaction(NULL);
ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(AccountMgr::GetSecurity(accountId, realmID)));
ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(AccountMgr::GetSecurity(accountId, realm.Id.Realm)));
ticket->SaveToDB(trans);
sTicketMgr->UpdateLastChange();
@@ -387,7 +387,7 @@ public:
{
ObjectGuid guid = ticket->GetAssignedToGUID();
uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(guid);
security = AccountMgr::GetSecurity(accountId, realmID);
security = AccountMgr::GetSecurity(accountId, realm.Id.Realm);
}
// Check security