From d29dd1eeb5c52dc76bd741fe1ee0e875c416b8e7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 5 Apr 2021 23:47:05 +0200 Subject: Core/Misc: Change all unix time columns in character database to bigint (signed) --- src/server/scripts/Commands/cs_ban.cpp | 16 ++++++++-------- src/server/scripts/Commands/cs_character.cpp | 2 +- src/server/scripts/Commands/cs_list.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index cfe151bcde1..f63be2f45c8 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -338,14 +338,14 @@ public: do { Field* fields = result->Fetch(); - time_t unbanDate = time_t(fields[3].GetUInt32()); + time_t unbanDate = fields[3].GetInt64(); bool active = false; - if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(nullptr))) + if (fields[2].GetUInt8() && (!fields[1].GetInt64() || unbanDate >= time(nullptr))) active = true; - bool permanent = (fields[1].GetUInt32() == uint32(0)); - std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt32(), true); + bool permanent = (fields[1].GetInt64() == SI64LIT(0)); + std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetInt64(), true); handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY, - TimeToTimestampStr(fields[0].GetUInt32()).c_str(), banTime.c_str(), active ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO), fields[4].GetCString(), fields[5].GetCString()); + TimeToTimestampStr(fields[0].GetInt64()).c_str(), banTime.c_str(), active ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO), fields[4].GetCString(), fields[5].GetCString()); } while (result->NextRow()); @@ -555,11 +555,11 @@ public: Field* banFields = banInfo->Fetch(); do { - time_t timeBan = time_t(banFields[0].GetUInt32()); + time_t timeBan = banFields[0].GetInt64(); tm tmBan; localtime_r(&timeBan, &tmBan); - if (banFields[0].GetUInt32() == banFields[1].GetUInt32()) + if (banFields[0].GetInt64() == banFields[1].GetInt64()) { handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-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, @@ -567,7 +567,7 @@ public: } else { - time_t timeUnban = time_t(banFields[1].GetUInt32()); + time_t timeUnban = banFields[1].GetInt64(); tm tmUnban; localtime_r(&timeUnban, &tmUnban); handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|", diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index f440f0bbff2..833eec17be0 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -144,7 +144,7 @@ public: // account name will be empty for nonexisting account AccountMgr::GetName(info.accountId, info.accountName); - info.deleteDate = time_t(fields[3].GetUInt32()); + info.deleteDate = fields[3].GetInt64(); foundList.push_back(info); } while (result->NextRow()); diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 1d187685fe6..6c189b4fa19 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -580,8 +580,8 @@ public: ObjectGuid::LowType receiverId = queryFields[3].GetUInt64(); std::string receiver = queryFields[4].GetString(); std::string subject = queryFields[5].GetString(); - uint64 deliverTime = queryFields[6].GetUInt32(); - uint64 expireTime = queryFields[7].GetUInt32(); + time_t deliverTime = queryFields[6].GetInt64(); + time_t expireTime = queryFields[7].GetInt64(); uint64 money = queryFields[8].GetUInt64(); uint8 hasItem = queryFields[9].GetUInt8(); uint32 gold = money / GOLD; -- cgit v1.2.3