mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
feat(Core/Common): add new helpers for time utility (#10207)
This commit is contained in:
@@ -474,9 +474,7 @@ public:
|
||||
Field* fields2 = banInfo->Fetch();
|
||||
do
|
||||
{
|
||||
time_t timeBan = time_t(fields2[0].GetUInt32());
|
||||
tm tmBan;
|
||||
localtime_r(&timeBan, &tmBan);
|
||||
tm tmBan = Acore::Time::TimeBreakdown(fields2[0].GetUInt32());
|
||||
|
||||
if (fields2[0].GetUInt32() == fields2[1].GetUInt32())
|
||||
{
|
||||
@@ -486,9 +484,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
time_t timeUnban = time_t(fields2[1].GetUInt32());
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
tm tmUnban = Acore::Time::TimeBreakdown(fields2[1].GetUInt32());
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
accountName.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
@@ -562,9 +558,7 @@ public:
|
||||
Field* banFields = banInfo->Fetch();
|
||||
do
|
||||
{
|
||||
time_t timeBan = time_t(banFields[0].GetUInt32());
|
||||
tm tmBan;
|
||||
localtime_r(&timeBan, &tmBan);
|
||||
tm tmBan = Acore::Time::TimeBreakdown(banFields[0].GetUInt32());
|
||||
|
||||
if (banFields[0].GetUInt32() == banFields[1].GetUInt32())
|
||||
{
|
||||
@@ -574,9 +568,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
time_t timeUnban = time_t(banFields[1].GetUInt32());
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
tm tmUnban = Acore::Time::TimeBreakdown(banFields[1].GetUInt32());
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
char_name.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
@@ -640,9 +632,7 @@ public:
|
||||
{
|
||||
handler->SendSysMessage("-------------------------------------------------------------------------------");
|
||||
Field* fields = result->Fetch();
|
||||
time_t timeBan = time_t(fields[1].GetUInt32());
|
||||
tm tmBan;
|
||||
localtime_r(&timeBan, &tmBan);
|
||||
tm tmBan = Acore::Time::TimeBreakdown(fields[1].GetUInt32());
|
||||
if (fields[1].GetUInt32() == fields[2].GetUInt32())
|
||||
{
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
|
||||
@@ -651,9 +641,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
time_t timeUnban = time_t(fields[2].GetUInt32());
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
tm tmUnban = Acore::Time::TimeBreakdown(fields[2].GetUInt32());
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
fields[0].GetCString(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
|
||||
Reference in New Issue
Block a user