diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-07-18 17:48:15 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-10-14 19:39:42 +0200 |
| commit | 3418a33a87cba1ed5cedc7de35e799cddb546d4f (patch) | |
| tree | 5d110f1d8255a6ebc5a4e459e3ed8756d1835a67 /src/server/game | |
| parent | ab5792a33a42dea6f0ddfbf358b6e29571f4fb2a (diff) | |
Misc: Pass std::chrono types by value everywhere.
(cherry picked from commit 2ef9d301f0869b443122e2ba543af054c5b0e53c)
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 8 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.h | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Object.h | 2 | ||||
| -rw-r--r-- | src/server/game/Scripting/ScriptReloadMgr.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/Server/WorldSession.cpp | 6 |
8 files changed, 15 insertions, 14 deletions
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 7237deb2493..4783d67f6dc 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -802,7 +802,7 @@ void AuctionHouseMgr::Update() ++itr; } - _playerThrottleObjectsCleanupTime = now + Hours(1); + _playerThrottleObjectsCleanupTime = now + 1h; } } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ef6c5385fda..2ca94a09e97 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2271,7 +2271,7 @@ void Creature::Respawn(bool force) } -void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds const& forceRespawnTimer) +void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds forceRespawnTimer) { if (timeMSToDespawn) { @@ -2323,7 +2323,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds const& forceRespawn } } -void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/, Seconds const& forceRespawnTimer /*= 0*/) +void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/, Seconds forceRespawnTimer /*= 0*/) { if (TempSummon* summon = ToTempSummon()) summon->UnSummon(msTimeToDespawn); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 8cec597febc..9c53daa0efb 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -258,8 +258,8 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma void RemoveCorpse(bool setSpawnTime = true, bool destroyForNearbyPlayers = true); - void DespawnOrUnsummon(uint32 msTimeToDespawn = 0, Seconds const& forceRespawnTime = Seconds(0)); - void DespawnOrUnsummon(Milliseconds const& time, Seconds const& forceRespawnTime = Seconds(0)) { DespawnOrUnsummon(uint32(time.count()), forceRespawnTime); } + void DespawnOrUnsummon(uint32 msTimeToDespawn = 0, Seconds forceRespawnTime = 0s); + void DespawnOrUnsummon(Milliseconds time, Seconds forceRespawnTime = 0s) { DespawnOrUnsummon(uint32(time.count()), forceRespawnTime); } time_t const& GetRespawnTime() const { return m_respawnTime; } time_t GetRespawnTimeEx() const; @@ -423,7 +423,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma bool CanAlwaysSee(WorldObject const* obj) const override; private: - void ForcedDespawn(uint32 timeMSToDespawn = 0, Seconds const& forceRespawnTimer = Seconds(0)); + void ForcedDespawn(uint32 timeMSToDespawn = 0, Seconds forceRespawnTimer = 0s); bool CheckNoGrayAggroConfig(uint32 playerLevel, uint32 creatureLevel) const; // No aggro from gray creatures // Waypoint path @@ -468,7 +468,7 @@ class TC_GAME_API AssistDelayEvent : public BasicEvent class TC_GAME_API ForcedDespawnDelayEvent : public BasicEvent { public: - ForcedDespawnDelayEvent(Creature& owner, Seconds const& respawnTimer) : BasicEvent(), m_owner(owner), m_respawnTimer(respawnTimer) { } + ForcedDespawnDelayEvent(Creature& owner, Seconds respawnTimer) : BasicEvent(), m_owner(owner), m_respawnTimer(respawnTimer) { } bool Execute(uint64 e_time, uint32 p_time) override; private: diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index f5b649ad4fd..c85374bd4be 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -965,7 +965,7 @@ void GameObject::AddUniqueUse(Player* player) m_unique_users.insert(player->GetGUID()); } -void GameObject::DespawnOrUnsummon(Milliseconds const& delay, Seconds const& forceRespawnTime) +void GameObject::DespawnOrUnsummon(Milliseconds delay, Seconds forceRespawnTime) { if (delay > 0ms) { diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index d16120e0edc..fd06e490ec9 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -164,7 +164,7 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject> void SetSpawnedByDefault(bool b) { m_spawnedByDefault = b; } uint32 GetRespawnDelay() const { return m_respawnDelayTime; } void Refresh(); - void DespawnOrUnsummon(Milliseconds const& delay = 0ms, Seconds const& forceRespawnTime = 0s); + void DespawnOrUnsummon(Milliseconds delay = 0ms, Seconds forceRespawnTime = 0s); void Delete(); void SendGameObjectDespawn(); void getFishLoot(Loot* loot, Player* loot_owner); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 874d45ea7c5..b194f96f8c0 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -542,7 +542,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation Scenario* GetScenario() const; TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty); - TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType, Milliseconds const& despawnTime, uint32 vehId = 0, uint32 spellId = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty) { return SummonCreature(entry, pos, despawnType, uint32(despawnTime.count()), vehId, spellId, privateObjectOwner); } + TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType, Milliseconds despawnTime, uint32 vehId = 0, uint32 spellId = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty) { return SummonCreature(entry, pos, despawnType, uint32(despawnTime.count()), vehId, spellId, privateObjectOwner); } TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty); GameObject* SummonGameObject(uint32 entry, Position const& pos, QuaternionData const& rot, uint32 respawnTime /* s */, GOSummonType summonType = GO_SUMMON_TIMED_OR_CORPSE_DESPAWN); GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, QuaternionData const& rot, uint32 respawnTime /* s */); diff --git a/src/server/game/Scripting/ScriptReloadMgr.cpp b/src/server/game/Scripting/ScriptReloadMgr.cpp index 1df8b5705db..bfc4b226679 100644 --- a/src/server/game/Scripting/ScriptReloadMgr.cpp +++ b/src/server/game/Scripting/ScriptReloadMgr.cpp @@ -41,6 +41,7 @@ ScriptReloadMgr* ScriptReloadMgr::instance() #include "Config.h" #include "GitRevision.h" #include "CryptoHash.h" +#include "Duration.h" #include "Log.h" #include "MPSCQueue.h" #include "Regex.h" @@ -1035,7 +1036,7 @@ private: // Wait for the current build job to finish, if the job finishes in time // evaluate it and continue with the next one. if (_build_job->GetProcess()->GetFutureResult(). - wait_for(std::chrono::seconds(0)) == std::future_status::ready) + wait_for(0s) == std::future_status::ready) ProcessReadyBuildJob(); else return; // Return when the job didn't finish in time diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 628c455a0fc..328f2c394d6 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -893,13 +893,13 @@ void WorldSession::ProcessQueryCallbacks() _queryProcessor.ProcessReadyCallbacks(); _transactionCallbacks.ProcessReadyCallbacks(); - if (_realmAccountLoginCallback.valid() && _realmAccountLoginCallback.wait_for(std::chrono::seconds(0)) == std::future_status::ready && - _accountLoginCallback.valid() && _accountLoginCallback.wait_for(std::chrono::seconds(0)) == std::future_status::ready) + if (_realmAccountLoginCallback.valid() && _realmAccountLoginCallback.wait_for(0s) == std::future_status::ready && + _accountLoginCallback.valid() && _accountLoginCallback.wait_for(0s) == std::future_status::ready) InitializeSessionCallback(static_cast<LoginDatabaseQueryHolder*>(_realmAccountLoginCallback.get()), static_cast<CharacterDatabaseQueryHolder*>(_accountLoginCallback.get())); //! HandlePlayerLoginOpcode - if (_charLoginCallback.valid() && _charLoginCallback.wait_for(std::chrono::seconds(0)) == std::future_status::ready) + if (_charLoginCallback.valid() && _charLoginCallback.wait_for(0s) == std::future_status::ready) HandlePlayerLogin(reinterpret_cast<LoginQueryHolder*>(_charLoginCallback.get())); if (_charEnumCallback.valid() && _charEnumCallback.wait_for(std::chrono::seconds(0)) == std::future_status::ready) |
