diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2019-08-04 12:22:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-04 12:22:57 +0200 |
| commit | a5e73e41c0e813e674bb0a644e0052052435494e (patch) | |
| tree | cabbeadc1e07635f1a8fc53599895613cbe61723 /src/common | |
| parent | 15e85f882fdb7b5d1d48302907e76c993ee4e923 (diff) | |
Core/Pooling: Quest pooling rewrite: (PR#23627)
- Split quest pooling from PoolMgr (into QuestPoolMgr)
- Proper saving/restoring on server restart
- No more hacking into sObjectMgr to insert/remove available quests
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/Utilities/Util.cpp | 9 | ||||
| -rw-r--r-- | src/common/Utilities/Util.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index fa8fb5edbe0..0a778f33654 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -209,6 +209,15 @@ std::string TimeToTimestampStr(time_t t) return std::string(buf); } +std::string TimeToHumanReadable(time_t t) +{ + tm time; + localtime_r(&t, &time); + char buf[30]; + strftime(buf, 30, "%c", &time); + return std::string(buf); +} + /// Check if the string is a valid ip address representation bool IsIPAddress(char const* ipaddress) { diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index 125442865c5..5f4228dc596 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -65,6 +65,7 @@ TC_COMMON_API tm TimeBreakdown(time_t t); TC_COMMON_API std::string secsToTimeString(uint64 timeInSecs, bool shortText = false, bool hoursOnly = false); TC_COMMON_API uint32 TimeStringToSecs(std::string const& timestring); TC_COMMON_API std::string TimeToTimestampStr(time_t t); +TC_COMMON_API std::string TimeToHumanReadable(time_t t); // Percentage calculation template <class T, class U> |
