diff options
author | p0wer <none@none> | 2010-02-24 21:30:00 -0600 |
---|---|---|
committer | p0wer <none@none> | 2010-02-24 21:30:00 -0600 |
commit | ba51f553fc3a677aa4d8ae846f86f8a560d9982c (patch) | |
tree | 38ce0a9b84459c9d1efdf17955fa57ddf69aab1e /src/game/Level3.cpp | |
parent | fc2264bf891b4059a64b680e828731e6f33edd07 (diff) |
Add command for administrators to change channel publicity ingame rather than having to manually manipulate the database.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Level3.cpp')
-rw-r--r-- | src/game/Level3.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 0d56d12a816..e1e67ce99ad 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -7234,6 +7234,30 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args) return true; } +bool ChatHandler::HandleChannelSetPublic(const char *args) +{ + if(!*args) + return false; + std::string channel = strtok((char*)args, " "); + uint32 val = atoi((char*)args); + + if(val) + { + CharacterDatabase.PExecute("UPDATE channels SET m_public = 1 WHERE n_name LIKE '%s'", channel); + val = 1; + } + else + { + CharacterDatabase.PExecute("UPDATE channels SET m_public = 0 WHERE n_name LIKE '%s'", channel); + val = 0; + } + + PSendSysMessage(LANG_CHANNEL_PUBLIC_CHANGED, channel.c_str(), val); + + return true; +} + + /*------------------------------------------ *-------------TRINITY---------------------- *-------------------------------------*/ |