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:
@@ -130,6 +130,16 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand channelSetCommandTable[] =
|
||||
{
|
||||
{ "public", SEC_ADMINISTRATOR, true, &ChatHandler::HandleChannelSetPublic, "", NULL },
|
||||
};
|
||||
|
||||
static ChatCommand channelCommandTable[] =
|
||||
{
|
||||
{ "set", SEC_ADMINISTRATOR, true, NULL, "", channelSetCommandTable },
|
||||
};
|
||||
|
||||
static ChatCommand debugPlayCommandTable[] =
|
||||
{
|
||||
{ "cinematic", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlayCinematicCommand, "", NULL },
|
||||
@@ -670,6 +680,8 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
|
||||
{ "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable },
|
||||
|
||||
{ "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable },
|
||||
|
||||
{ "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable },
|
||||
{ "loadpath", SEC_ADMINISTRATOR, false, &ChatHandler::HandleReloadAllPaths, "", NULL },
|
||||
{ "ahbotoptions", SEC_GAMEMASTER, true, &ChatHandler::HandleAHBotOptionsCommand, "", NULL },
|
||||
|
||||
@@ -139,6 +139,8 @@ class ChatHandler
|
||||
bool HandleCharacterReputationCommand(const char* args);
|
||||
bool HandleCharacterTitlesCommand(const char* args);
|
||||
|
||||
bool HandleChannelSetPublic(const char *args);
|
||||
|
||||
bool HandleDebugAnimCommand(const char* args);
|
||||
bool HandleDebugArenaCommand(const char * args);
|
||||
bool HandleDebugBattlegroundCommand(const char * args);
|
||||
|
||||
+2
-1
@@ -878,7 +878,8 @@ enum TrinityStrings
|
||||
LANG_NPCINFO_PHASEMASK = 5020,
|
||||
LANG_NPCINFO_ARMOR = 5021,
|
||||
LANG_CHANNEL_NOT_PUBLIC = 5022,
|
||||
// Room for more Trinity strings 5023-9999
|
||||
LANG_CHANNEL_PUBLIC_CHANGED = 5023,
|
||||
// Room for more Trinity strings 5024-9999
|
||||
// Used for GM Announcements
|
||||
LANG_GM_BROADCAST = 6613,
|
||||
LANG_GM_NOTIFY = 6614,
|
||||
|
||||
@@ -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