From 43b595111dce03258c29fd926201660b9d3acb8d Mon Sep 17 00:00:00 2001 From: HelloKitty Date: Fri, 15 May 2020 13:41:16 -0500 Subject: Further improve ChrRace DBC handling (#24508) * Core/DBC: Added ChrRacesAllianceType for ChrRaces.dbc * Core/Character: Check ChrRace DBC playable in HandleCharCreateOpcode * Core/DBC: Implement ChrRacesFlags removing literals Cannot take credit for this enum, derived from documentation in https://wowdev.wiki/DB/ChrRaces * Core/Character: Check CHRRACES_FLAGS_NOT_PLAYABLE on creation * Core/DBC: Fix formatting of ChrRaces enums * Core/DBC: Use ChrRaces CreatureType instead of hardcoded humanoid assumption * Address enum style code changes --- src/server/game/Handlers/CharacterHandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/server/game/Handlers/CharacterHandler.cpp') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index ed3923ca971..85b43125068 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -341,6 +341,13 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData) if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RACEMASK)) { + if (raceEntry->Alliance == CHRRACES_ALLIANCE_TYPE_NOT_PLAYABLE || raceEntry->HasFlag(CHRRACES_FLAGS_NOT_PLAYABLE)) + { + TC_LOG_ERROR("network", "Race (%u) was not playable but requested while creating new char for account (ID: %u): wrong DBC files or cheater?", createInfo->Race, GetAccountId()); + SendCharCreate(CHAR_CREATE_DISABLED); + return; + } + uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK); if ((1 << (createInfo->Race - 1)) & raceMaskDisabled) { -- cgit v1.2.3