mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 00:53:46 +00:00
Revert "feat(core): Ensure that all actions are compared to fixed point in time (#1236) (#1458)" (#1471)
This reverts commit 51b8773528.
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#include "Chat.h"
|
||||
#include "Config.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GameTime.h"
|
||||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "Language.h"
|
||||
@@ -161,8 +160,6 @@ inline uint32 Guild::LogHolder::GetNextGUID()
|
||||
return m_nextGUID;
|
||||
}
|
||||
|
||||
Guild::LogEntry::LogEntry(uint32 guildId, uint32 guid) : m_guildId(guildId), m_guid(guid), m_timestamp(GameTime::GetGameTime()) { }
|
||||
|
||||
// EventLogEntry
|
||||
void Guild::EventLogEntry::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
@@ -196,7 +193,7 @@ void Guild::EventLogEntry::WritePacket(WorldPacket& data) const
|
||||
if (m_eventType == GUILD_EVENT_LOG_PROMOTE_PLAYER || m_eventType == GUILD_EVENT_LOG_DEMOTE_PLAYER)
|
||||
data << uint8(m_newRank);
|
||||
// Event timestamp
|
||||
data << uint32(::GameTime::GetGameTime() - m_timestamp);
|
||||
data << uint32(::time(NULL) - m_timestamp);
|
||||
}
|
||||
|
||||
// BankEventLogEntry
|
||||
@@ -246,7 +243,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPacket& data) const
|
||||
data << uint32(m_itemOrMoney);
|
||||
}
|
||||
|
||||
data << uint32(GameTime::GetGameTime() - m_timestamp);
|
||||
data << uint32(time(NULL) - m_timestamp);
|
||||
}
|
||||
|
||||
// RankInfo
|
||||
@@ -641,11 +638,6 @@ void Guild::Member::ChangeRank(uint8 newRank)
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
void Guild::Member::UpdateLogoutTime()
|
||||
{
|
||||
m_logoutTime = GameTime::GetGameTime();
|
||||
}
|
||||
|
||||
void Guild::Member::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER);
|
||||
@@ -716,7 +708,7 @@ void Guild::Member::WritePacket(WorldPacket& data, bool sendOfficerNote) const
|
||||
<< uint32(m_zoneId);
|
||||
|
||||
if (!m_flags)
|
||||
data << float(float(::GameTime::GetGameTime() - m_logoutTime) / DAY);
|
||||
data << float(float(::time(NULL) - m_logoutTime) / DAY);
|
||||
|
||||
data << m_publicNote;
|
||||
|
||||
@@ -1169,7 +1161,7 @@ bool Guild::Create(Player* pLeader, std::string const& name)
|
||||
m_info = "";
|
||||
m_motd = "No message set.";
|
||||
m_bankMoney = 0;
|
||||
m_createdDate = GameTime::GetGameTime();
|
||||
m_createdDate = sWorld->GetGameTime();
|
||||
_CreateLogHolders();
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
|
||||
@@ -281,6 +281,7 @@ public: // pussywizard: public class Member
|
||||
m_level(0),
|
||||
m_class(0),
|
||||
m_flags(GUILDMEMBER_STATUS_NONE),
|
||||
m_logoutTime(::time(NULL)),
|
||||
m_accountId(0),
|
||||
m_rankId(rankId)
|
||||
{
|
||||
@@ -319,7 +320,7 @@ public: // pussywizard: public class Member
|
||||
|
||||
void ChangeRank(uint8 newRank);
|
||||
|
||||
inline void UpdateLogoutTime();
|
||||
inline void UpdateLogoutTime() { m_logoutTime = ::time(NULL); }
|
||||
inline bool IsRank(uint8 rankId) const { return m_rankId == rankId; }
|
||||
inline bool IsRankNotLower(uint8 rankId) const { return m_rankId <= rankId; }
|
||||
inline bool IsSamePlayer(uint64 guid) const { return m_guid == guid; }
|
||||
@@ -374,7 +375,7 @@ private:
|
||||
class LogEntry
|
||||
{
|
||||
public:
|
||||
LogEntry(uint32 guildId, uint32 guid);
|
||||
LogEntry(uint32 guildId, uint32 guid) : m_guildId(guildId), m_guid(guid), m_timestamp(::time(NULL)) { }
|
||||
LogEntry(uint32 guildId, uint32 guid, time_t timestamp) : m_guildId(guildId), m_guid(guid), m_timestamp(timestamp) { }
|
||||
virtual ~LogEntry() { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user