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:
Exitare
2025-02-07 05:25:07 -08:00
committed by GitHub
parent 2e91c83433
commit ff4d1ef053
10 changed files with 1068 additions and 991 deletions

View File

@@ -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;
}