mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
chore(Core/EventMgr): Align code to Code standard & improve LoadFromDB function (#21151)
Co-authored-by: Jelle Meeus <sogladev@gmail.com> Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
This commit is contained in:
@@ -68,9 +68,9 @@ public:
|
||||
GameEventData const& eventData = events[eventId];
|
||||
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, eventId, eventId, eventData.description, active);
|
||||
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, eventId, eventId, eventData.Description, active);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, eventId, eventData.description, active);
|
||||
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, eventId, eventData.Description, active);
|
||||
|
||||
++counter;
|
||||
}
|
||||
@@ -104,17 +104,17 @@ public:
|
||||
bool active = activeEvents.find(eventId) != activeEvents.end();
|
||||
std::string activeStr = active ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
|
||||
std::string startTimeStr = Acore::Time::TimeToTimestampStr(Seconds(eventData.start));
|
||||
std::string endTimeStr = Acore::Time::TimeToTimestampStr(Seconds(eventData.end));
|
||||
std::string startTimeStr = Acore::Time::TimeToTimestampStr(Seconds(eventData.Start));
|
||||
std::string endTimeStr = Acore::Time::TimeToTimestampStr(Seconds(eventData.End));
|
||||
|
||||
uint32 delay = sGameEventMgr->NextCheck(eventId);
|
||||
time_t nextTime = GameTime::GetGameTime().count() + delay;
|
||||
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? Acore::Time::TimeToTimestampStr(Seconds(nextTime)) : "-";
|
||||
std::string nextStr = nextTime >= eventData.Start && nextTime < eventData.End ? Acore::Time::TimeToTimestampStr(Seconds(nextTime)) : "-";
|
||||
|
||||
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE, true);
|
||||
std::string lengthStr = secsToTimeString(eventData.length * MINUTE, true);
|
||||
std::string occurenceStr = secsToTimeString(eventData.Occurence * MINUTE, true);
|
||||
std::string lengthStr = secsToTimeString(eventData.Length * MINUTE, true);
|
||||
|
||||
handler->PSendSysMessage(LANG_EVENT_INFO, uint16(eventId), eventData.description, activeStr,
|
||||
handler->PSendSysMessage(LANG_EVENT_INFO, uint16(eventId), eventData.Description, activeStr,
|
||||
startTimeStr, endTimeStr, occurenceStr, lengthStr,
|
||||
nextStr);
|
||||
|
||||
@@ -141,11 +141,11 @@ public:
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
|
||||
if (activeEvents.find(eventId) != activeEvents.end())
|
||||
{
|
||||
handler->SendErrorMessage(LANG_EVENT_ALREADY_ACTIVE, uint16(eventId), eventData.description);
|
||||
handler->SendErrorMessage(LANG_EVENT_ALREADY_ACTIVE, uint16(eventId), eventData.Description);
|
||||
return false;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_EVENT_STARTED, uint16(eventId), eventData.description);
|
||||
handler->PSendSysMessage(LANG_EVENT_STARTED, uint16(eventId), eventData.Description);
|
||||
sGameEventMgr->StartEvent(eventId, true);
|
||||
return true;
|
||||
}
|
||||
@@ -171,11 +171,11 @@ public:
|
||||
|
||||
if (activeEvents.find(eventId) == activeEvents.end())
|
||||
{
|
||||
handler->SendErrorMessage(LANG_EVENT_NOT_ACTIVE, uint16(eventId), eventData.description);
|
||||
handler->SendErrorMessage(LANG_EVENT_NOT_ACTIVE, uint16(eventId), eventData.Description);
|
||||
return false;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_EVENT_STOPPED, uint16(eventId), eventData.description);
|
||||
handler->PSendSysMessage(LANG_EVENT_STOPPED, uint16(eventId), eventData.Description);
|
||||
sGameEventMgr->StopEvent(eventId, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user