mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 16:37:04 +00:00
[8607] more userfriendly eventcommands
.event start/stop will now output the started/stopped eventame+id .event activelist got renamed to .event list with optional parameter "all" so .event list - will list all active events and .event list all - will list all events including inactive ones
This commit is contained in:
parent
f591211538
commit
ed5130c1c1
10 changed files with 48 additions and 12 deletions
|
|
@ -173,7 +173,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
|
||||
static ChatCommand eventCommandTable[] =
|
||||
{
|
||||
{ "activelist", SEC_GAMEMASTER, true, &ChatHandler::HandleEventActiveListCommand, "", NULL },
|
||||
{ "list", SEC_GAMEMASTER, true, &ChatHandler::HandleEventListCommand, "", NULL },
|
||||
{ "start", SEC_GAMEMASTER, true, &ChatHandler::HandleEventStartCommand, "", NULL },
|
||||
{ "stop", SEC_GAMEMASTER, true, &ChatHandler::HandleEventStopCommand, "", NULL },
|
||||
{ "", SEC_GAMEMASTER, true, &ChatHandler::HandleEventInfoCommand, "", NULL },
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class ChatHandler
|
|||
bool HandleDebugSendSetPhaseShiftCommand(const char * args);
|
||||
bool HandleDebugSendSpellFailCommand(const char* args);
|
||||
|
||||
bool HandleEventActiveListCommand(const char* args);
|
||||
bool HandleEventListCommand(const char* args);
|
||||
bool HandleEventStartCommand(const char* args);
|
||||
bool HandleEventStopCommand(const char* args);
|
||||
bool HandleEventInfoCommand(const char* args);
|
||||
|
|
|
|||
|
|
@ -765,7 +765,9 @@ enum MangosStrings
|
|||
LANG_RESET_PET_TALENTS_ONLINE = 1127,
|
||||
LANG_TAXINODE_ENTRY_LIST_CHAT = 1128,
|
||||
LANG_TAXINODE_ENTRY_LIST_CONSOLE = 1129,
|
||||
// Room for more level 3 1130-1199 not used
|
||||
LANG_EVENT_STARTED = 1130,
|
||||
LANG_EVENT_STOPPED = 1131,
|
||||
// Room for more level 3 1132-1199 not used
|
||||
|
||||
// Debug commands
|
||||
LANG_CINEMATIC_NOT_EXIST = 1200,
|
||||
|
|
|
|||
|
|
@ -3717,24 +3717,38 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleEventActiveListCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleEventListCommand(const char* args)
|
||||
{
|
||||
uint32 counter = 0;
|
||||
bool all = false;
|
||||
std::string arg = args;
|
||||
if (arg == "all")
|
||||
all = true;
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
|
||||
char const* active = GetMangosString(LANG_ACTIVE);
|
||||
char const* inactive = GetMangosString(LANG_FACTION_INACTIVE);
|
||||
char const* state = "";
|
||||
|
||||
for(GameEventMgr::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr )
|
||||
for (uint32 event_id = 0; event_id < events.size(); ++event_id)
|
||||
{
|
||||
uint32 event_id = *itr;
|
||||
if (activeEvents.find(event_id) == activeEvents.end())
|
||||
{
|
||||
if (!all)
|
||||
continue;
|
||||
state = inactive;
|
||||
}
|
||||
else
|
||||
state = active;
|
||||
|
||||
GameEventData const& eventData = events[event_id];
|
||||
|
||||
if(m_session)
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,event_id,event_id,eventData.description.c_str(),active );
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, event_id, event_id, eventData.description.c_str(), state);
|
||||
else
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,event_id,eventData.description.c_str(),active );
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, event_id, eventData.description.c_str(), state);
|
||||
|
||||
++counter;
|
||||
}
|
||||
|
|
@ -3831,6 +3845,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_EVENT_STARTED, event_id, eventData.description.c_str());
|
||||
gameeventmgr.StartEvent(event_id,true);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3873,6 +3888,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_EVENT_STOPPED, event_id, eventData.description.c_str());
|
||||
gameeventmgr.StopEvent(event_id,true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8606"
|
||||
#define REVISION_NR "8607"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_8596_01_characters_bugreport"
|
||||
#define REVISION_DB_MANGOS "required_8600_01_mangos_command"
|
||||
#define REVISION_DB_MANGOS "required_8607_02_mangos_command"
|
||||
#define REVISION_DB_REALMD "required_8332_01_realmd_realmcharacters"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue