Skip to content

Commit

Permalink
Merge pull request mangos#127 from Patman64/no_player_commands
Browse files Browse the repository at this point in the history
Allow server admins to disable GM commands for players entirely.

Add new config option to mangosd: PlayerCommands to be able to toggle parsing commands for players.
Update your mangosd.conf file if you want to use it
  • Loading branch information
Schmoozerd committed Oct 21, 2013
2 parents dacf7b1 + 5fef6f5 commit de015a7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game/Chat.cpp
Expand Up @@ -1328,8 +1328,8 @@ bool ChatHandler::ParseCommands(const char* text)
MANGOS_ASSERT(text);
MANGOS_ASSERT(*text);

// if(m_session->GetSecurity() == SEC_PLAYER)
// return false;
if (m_session->GetSecurity() == SEC_PLAYER && !sWorld.getConfig(CONFIG_BOOL_PLAYER_COMMANDS))
return false;

/// chat case (.command or !command format)
if (m_session)
Expand Down
2 changes: 2 additions & 0 deletions src/game/World.cpp
Expand Up @@ -775,6 +775,8 @@ void World::LoadConfigSettings(bool reload)

setConfig(CONFIG_BOOL_KICK_PLAYER_ON_BAD_PACKET, "Network.KickOnBadPacket", false);

setConfig(CONFIG_BOOL_PLAYER_COMMANDS, "PlayerCommands", true);

if (int clientCacheId = sConfig.GetIntDefault("ClientCacheVersion", 0))
{
// overwrite DB/old value
Expand Down
1 change: 1 addition & 0 deletions src/game/World.h
Expand Up @@ -343,6 +343,7 @@ enum eConfigBoolValues
CONFIG_BOOL_VMAP_INDOOR_CHECK,
CONFIG_BOOL_PET_UNSUMMON_AT_MOUNT,
CONFIG_BOOL_MMAP_ENABLED,
CONFIG_BOOL_PLAYER_COMMANDS,
CONFIG_BOOL_VALUE_COUNT
};

Expand Down
6 changes: 6 additions & 0 deletions src/mangosd/mangosd.conf.dist.in
Expand Up @@ -776,6 +776,11 @@ LogColors = ""
# You can bypass this setting by typing "/script SetAllowLowLevelRaid(true/false)" command in chat
# Default: 10
#
# PlayerCommands
# Should player chat be parsed for GM commands.
# Default: 1 (parse commands)
# 0 (ignore commands)
#
###################################################################################################################

GameType = 1
Expand Down Expand Up @@ -849,6 +854,7 @@ ShowProgressBars = 1
WaitAtStartupError = 0
Motd = "Welcome to the Massive Network Game Object Server."
Raid.MinLevel = 10
PlayerCommands = 1

###################################################################################################################
# PLAYER INTERACTION
Expand Down

0 comments on commit de015a7

Please sign in to comment.