diff options
Diffstat (limited to 'src/server/game/Handlers/CharacterHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 81 |
1 files changed, 4 insertions, 77 deletions
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 1ee32b74991..02496195170 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -517,23 +517,6 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact return; } - if (charCreate.CreateInfo->Class == CLASS_DEATH_KNIGHT && !HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEATH_KNIGHT)) - { - // speedup check for death knight class disabled case - if (!sWorld->getIntConfig(CONFIG_DEATH_KNIGHTS_PER_REALM)) - { - SendCharCreate(CHAR_CREATE_UNIQUE_CLASS_LIMIT); - return; - } - - // speedup check for death knight class disabled case - if (sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEATH_KNIGHT) > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) - { - SendCharCreate(CHAR_CREATE_LEVEL_REQUIREMENT); - return; - } - } - std::shared_ptr<WorldPackets::Character::CharacterCreateInfo> createInfo = charCreate.CreateInfo; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME); stmt->setString(0, charCreate.CreateInfo->Name); @@ -590,47 +573,20 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact std::function<void(PreparedQueryResult)> finalizeCharacterCreation = [this, createInfo](PreparedQueryResult result) { bool haveSameRace = false; - uint32 deathKnightReqLevel = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEATH_KNIGHT); uint32 demonHunterReqLevel = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEMON_HUNTER); - bool hasDeathKnightReqLevel = (deathKnightReqLevel == 0); bool hasDemonHunterReqLevel = (demonHunterReqLevel == 0); bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || HasPermission(rbac::RBAC_PERM_TWO_SIDE_CHARACTER_CREATION); uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS); - bool checkDeathKnightReqs = createInfo->Class == CLASS_DEATH_KNIGHT && !HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEATH_KNIGHT); bool checkDemonHunterReqs = createInfo->Class == CLASS_DEMON_HUNTER && !HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEMON_HUNTER); if (result) { uint32 team = Player::TeamForRace(createInfo->Race); - uint32 freeDeathKnightSlots = sWorld->getIntConfig(CONFIG_DEATH_KNIGHTS_PER_REALM); uint32 freeDemonHunterSlots = sWorld->getIntConfig(CONFIG_DEMON_HUNTERS_PER_REALM); Field* field = result->Fetch(); uint8 accRace = field[1].GetUInt8(); - if (checkDeathKnightReqs) - { - uint8 accClass = field[2].GetUInt8(); - if (accClass == CLASS_DEATH_KNIGHT) - { - if (freeDeathKnightSlots > 0) - --freeDeathKnightSlots; - - if (freeDeathKnightSlots == 0) - { - SendCharCreate(CHAR_CREATE_UNIQUE_CLASS_LIMIT); - return; - } - } - - if (!hasDeathKnightReqLevel) - { - uint8 accLevel = field[0].GetUInt8(); - if (accLevel >= deathKnightReqLevel) - hasDeathKnightReqLevel = true; - } - } - if (checkDemonHunterReqs) { uint8 accClass = field[2].GetUInt8(); @@ -671,7 +627,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact // search same race for cinematic or same class if need /// @todo check if cinematic already shown? (already logged in?; cinematic field) - while ((skipCinematics == 1 && !haveSameRace) || createInfo->Class == CLASS_DEATH_KNIGHT || createInfo->Class == CLASS_DEMON_HUNTER) + while ((skipCinematics == 1 && !haveSameRace) || createInfo->Class == CLASS_DEMON_HUNTER) { if (!result->NextRow()) break; @@ -682,29 +638,6 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact if (!haveSameRace) haveSameRace = createInfo->Race == accRace; - if (checkDeathKnightReqs) - { - uint8 acc_class = field[2].GetUInt8(); - if (acc_class == CLASS_DEATH_KNIGHT) - { - if (freeDeathKnightSlots > 0) - --freeDeathKnightSlots; - - if (freeDeathKnightSlots == 0) - { - SendCharCreate(CHAR_CREATE_UNIQUE_CLASS_LIMIT); - return; - } - } - - if (!hasDeathKnightReqLevel) - { - uint8 acc_level = field[0].GetUInt8(); - if (acc_level >= deathKnightReqLevel) - hasDeathKnightReqLevel = true; - } - } - if (checkDemonHunterReqs) { uint8 accClass = field[2].GetUInt8(); @@ -730,15 +663,9 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact } } - if (checkDeathKnightReqs && !hasDeathKnightReqLevel) - { - SendCharCreate(CHAR_CREATE_LEVEL_REQUIREMENT); - return; - } - if (checkDemonHunterReqs && !hasDemonHunterReqLevel) { - SendCharCreate(CHAR_CREATE_LEVEL_REQUIREMENT); + SendCharCreate(CHAR_CREATE_FAILED); return; } @@ -786,7 +713,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact newChar.CleanupsBeforeDelete(); }; - if (allowTwoSideAccounts && !skipCinematics && createInfo->Class != CLASS_DEATH_KNIGHT && createInfo->Class != CLASS_DEMON_HUNTER) + if (allowTwoSideAccounts && !skipCinematics && createInfo->Class != CLASS_DEMON_HUNTER) { finalizeCharacterCreation(PreparedQueryResult(nullptr)); return; @@ -794,7 +721,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CREATE_INFO); stmt->setUInt32(0, GetAccountId()); - stmt->setUInt32(1, (skipCinematics == 1 || createInfo->Class == CLASS_DEATH_KNIGHT || createInfo->Class == CLASS_DEMON_HUNTER) ? 12 : 1); + stmt->setUInt32(1, (skipCinematics == 1 || createInfo->Class == CLASS_DEMON_HUNTER) ? 12 : 1); queryCallback.WithPreparedCallback(std::move(finalizeCharacterCreation)).SetNextQuery(CharacterDatabase.AsyncQuery(stmt)); })); } |