aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Server/Protocol
diff options
context:
space:
mode:
authorazazel <none@none>2010-09-06 23:34:16 +0600
committerazazel <none@none>2010-09-06 23:34:16 +0600
commit7afc640ef42d648f06d22259d786dfe9ed51a31e (patch)
tree04eac69e3f1e5d6637ed2ccaa7967e3e533e6ff5 /src/server/game/Server/Protocol
parentd54225189e6f8d0e881e25658192849ab1f83e3c (diff)
Core: add possibility to disable creating of characters of specified races/classes.
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/Server/Protocol')
-rw-r--r--src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
index 0cd7fd98445..e777071b306 100644
--- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
@@ -175,7 +175,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
if (GetSecurity() == SEC_PLAYER)
{
- if (uint32 mask = sWorld.getIntConfig(CONFIG_CHARACTERS_CREATING_DISABLED))
+ if (uint32 mask = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED))
{
bool disabled = false;
@@ -224,6 +224,25 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
return;
}
+ if (GetSecurity() == SEC_PLAYER)
+ {
+ uint32 raceMaskDisabled = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
+ if ((1 << (race_ - 1)) & raceMaskDisabled)
+ {
+ data << uint8(CHAR_CREATE_DISABLED);
+ SendPacket(&data);
+ return;
+ }
+
+ uint32 classMaskDisabled = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK);
+ if ((1 << (class_ - 1)) & classMaskDisabled)
+ {
+ data << uint8(CHAR_CREATE_DISABLED);
+ SendPacket(&data);
+ return;
+ }
+ }
+
// prevent character creating with invalid name
if (!normalizePlayerName(name))
{
@@ -295,7 +314,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
}
// speedup check for heroic class disabled case
- uint32 req_level_for_heroic = sWorld.getIntConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING);
+ uint32 req_level_for_heroic = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER);
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;