feat(Core/Time): Implement saparated manager for game time (#8630)

This commit is contained in:
Kargatum
2022-01-24 17:55:00 +07:00
committed by GitHub
parent 12da792a90
commit 8b7df23f06
129 changed files with 1147 additions and 817 deletions

View File

@@ -150,7 +150,6 @@ class Channel
{
ObjectGuid player;
uint8 flags;
uint64 lastSpeakTime; // pussywizard
Player* plrPtr; // pussywizard
[[nodiscard]] bool HasFlag(uint8 flag) const { return flags & flag; }
@@ -175,16 +174,6 @@ class Channel
if (state) flags |= MEMBER_FLAG_MUTED;
else flags &= ~MEMBER_FLAG_MUTED;
}
bool IsAllowedToSpeak(uint64 speakDelay) // pussywizard
{
if (lastSpeakTime + speakDelay <= static_cast<uint64>(sWorld->GetGameTime()))
{
lastSpeakTime = sWorld->GetGameTime();
return true;
}
else
return false;
}
private:
bool _gmStatus = false;
};
@@ -234,6 +223,7 @@ public:
// pussywizard:
void AddWatching(Player* p);
void RemoveWatching(Player* p);
bool IsAllowedToSpeak(uint32 speakDelay); // pussywizard
private:
// initial packet data (notify type and channel name)
@@ -339,6 +329,7 @@ private:
uint32 _channelDBId;
TeamId _teamId;
ObjectGuid _ownerGUID;
uint32 _lastSpeakTime;
std::string _name;
std::string _password;
ChannelRights _channelRights;