diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 58a551262..f376da0fa 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1335,12 +1335,12 @@ bool ChatHandler::ParseCommands(const char* text) MANGOS_ASSERT(text); MANGOS_ASSERT(*text); - // if(m_session->GetSecurity() == SEC_PLAYER) - // return false; - /// chat case (.command or !command format) if (m_session) { + if (m_session->GetSecurity() == SEC_PLAYER && !sWorld.getConfig(CONFIG_BOOL_PLAYER_COMMANDS)) + return false; + if (text[0] != '!' && text[0] != '.') return false; diff --git a/src/game/World.cpp b/src/game/World.cpp index ebce674b0..b646b4af3 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -789,6 +789,8 @@ void World::LoadConfigSettings(bool reload) setConfig(CONFIG_BOOL_KICK_PLAYER_ON_BAD_PACKET, "Network.KickOnBadPacket", false); + setConfig(CONFIG_BOOL_PLAYER_COMMANDS, "PlayerCommands", false); + if (int clientCacheId = sConfig.GetIntDefault("ClientCacheVersion", 0)) { // overwrite DB/old value @@ -2554,4 +2556,4 @@ void World::UpdatePhaseDefinitions() if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld()) itr->second->GetPlayer()->GetPhaseMgr()->NotifyStoresReloaded(); } -} \ No newline at end of file +} diff --git a/src/game/World.h b/src/game/World.h index df635f5f9..dce30f30f 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -356,6 +356,7 @@ enum eConfigBoolValues CONFIG_BOOL_VMAP_INDOOR_CHECK, CONFIG_BOOL_PET_UNSUMMON_AT_MOUNT, CONFIG_BOOL_MMAP_ENABLED, + CONFIG_BOOL_PLAYER_COMMANDS, CONFIG_BOOL_GUILD_LEVELING_ENABLED, CONFIG_BOOL_VALUE_COUNT }; diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index d11d8ae10..406505168 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -3,7 +3,7 @@ ##################################### [MangosdConf] -ConfVersion=2013012201 +ConfVersion=2013122901 ################################################################################################################### # CONNECTIONS AND DIRECTORIES @@ -757,6 +757,11 @@ LogColors = "" # Default: 0 (not wait) # N (>0, wait N secs) # +# PlayerCommands +# Should player chat be parsed for GM commands. +# Default: 0 (ignore commands) +# 1 (parse commands) +# # Motd # Message of the Day. Displayed at worldlogin for every user ('@' for a newline). # @@ -833,6 +838,7 @@ Event.Announce = 0 BeepAtStart = 1 ShowProgressBars = 1 WaitAtStartupError = 0 +PlayerCommands = 0 Motd = "Welcome to the Massive Network Game Object Server." Raid.MinLevel = 10 diff --git a/src/shared/SystemConfig.h.in b/src/shared/SystemConfig.h.in index a938d8f27..52c5cca6b 100644 --- a/src/shared/SystemConfig.h.in +++ b/src/shared/SystemConfig.h.in @@ -36,7 +36,7 @@ // Format is YYYYMMDDRR where RR is the change in the conf file // for that day. #ifndef _MANGOSDCONFVERSION -# define _MANGOSDCONFVERSION 2013012201 +# define _MANGOSDCONFVERSION 2013122901 #endif #ifndef _REALMDCONFVERSION # define _REALMDCONFVERSION 2010062001 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 93ef3373e..0642adea6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12756" + #define REVISION_NR "12757" #endif // __REVISION_NR_H__