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:
p0wer
2010-02-24 21:30:00 -06:00
parent fc2264bf89
commit ba51f553fc
7 changed files with 44 additions and 1 deletions

View File

@@ -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----------------------
*-------------------------------------*/