mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
Add command for administrators to change channel publicity ingame rather than having to manually manipulate the database.
--HG-- branch : trunk
This commit is contained in:
@@ -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----------------------
|
||||
*-------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user