From a27f97d2baf351bb95f31bed2a196e50d70c104b Mon Sep 17 00:00:00 2001 From: Wall <90075138+Wall-core@users.noreply.github.com> Date: Tue, 4 Jul 2023 05:56:09 -0400 Subject: [PATCH] Fix XML Whitespace & Comments (#1996) --- src/framework/Dynamic/FactoryHolder.h | 2 +- src/framework/Dynamic/ObjectRegistry.h | 12 +- src/framework/GameSystem/TypeContainer.h | 4 +- src/framework/Network/MangosSocket.h | 96 +++++----- src/framework/Network/MangosSocketMgr.h | 8 +- src/framework/Utilities/Callback.h | 10 +- src/game/AI/CreatureAI.h | 12 +- src/game/AI/PlayerAI.h | 6 +- src/game/AI/ScriptedInstance.cpp | 10 +- src/game/AI/ScriptedInstance.h | 36 ++-- src/game/AccountMgr.h | 4 +- src/game/AuctionHouse/AuctionHouseMgr.cpp | 10 +- src/game/Battlegrounds/BattleGroundAV.cpp | 6 +- src/game/Camera.h | 4 +- src/game/Chat/AsyncCommandHandlers.cpp | 6 +- src/game/Chat/Chat.cpp | 12 +- src/game/Chat/Chat.h | 10 +- src/game/Commands/AccountCommands.cpp | 48 ++--- src/game/Commands/CreatureCommands.cpp | 12 +- src/game/Commands/MiscCommands.cpp | 24 +-- src/game/Commands/ServerCommands.cpp | 12 +- src/game/GMTicketMgr.h | 2 +- src/game/Group/Group.cpp | 4 +- src/game/Handlers/CharacterHandler.cpp | 2 +- src/game/Handlers/MailHandler.cpp | 2 +- src/game/Handlers/PetitionsHandler.cpp | 6 +- src/game/Handlers/QueryHandler.cpp | 4 +- src/game/Mail/Mail.h | 94 +++++----- src/game/Mail/MassMailMgr.h | 6 +- src/game/Maps/Map.cpp | 30 ++-- src/game/Maps/MapManager.cpp | 4 +- src/game/Movement/WaypointManager.cpp | 4 +- src/game/Movement/WaypointManager.h | 2 +- src/game/Movement/spline/util.cpp | 2 +- src/game/ObjectAccessor.cpp | 4 +- src/game/Objects/Corpse.cpp | 4 +- src/game/Objects/Creature.cpp | 6 +- src/game/Objects/Creature.h | 8 +- src/game/Objects/DynamicObject.cpp | 4 +- src/game/Objects/GameObject.cpp | 6 +- src/game/Objects/Object.cpp | 2 +- src/game/Objects/Pet.cpp | 6 +- src/game/Objects/Player.cpp | 42 ++--- src/game/Objects/Player.h | 16 +- src/game/Objects/Unit.cpp | 10 +- src/game/Objects/UnitDefines.h | 2 +- src/game/PlayerBots/PlayerBotAI.cpp | 10 +- src/game/Protocol/Opcodes.cpp | 6 +- src/game/Protocol/Opcodes.h | 30 ++-- src/game/Protocol/WorldSocket.h | 6 +- src/game/Protocol/WorldSocketMgr.h | 4 +- src/game/SharedDefines.h | 4 +- src/game/SocialMgr.h | 2 +- src/game/Spells/Spell.cpp | 10 +- src/game/Spells/SpellEntry.h | 4 +- src/game/Spells/SpellMgr.cpp | 2 +- src/game/Transports/Transport.h | 4 +- src/game/UnitAuraProcHandler.cpp | 4 +- src/game/Weather.cpp | 58 +++--- src/game/Weather.h | 18 +- src/game/World.cpp | 166 +++++++++--------- src/game/World.h | 74 ++++---- src/game/WorldSession.cpp | 63 ++++--- src/mangosd/ChatSocket.cpp | 12 +- src/mangosd/ChatSocket.h | 22 +-- src/mangosd/CliRunnable.cpp | 18 +- src/mangosd/CliRunnable.h | 10 +- src/mangosd/Main.cpp | 30 ++-- src/mangosd/Master.cpp | 62 +++---- src/mangosd/Master.h | 10 +- src/mangosd/RASocket.cpp | 32 ++-- src/mangosd/RASocket.h | 32 ++-- src/mangosd/WorldRunnable.h | 10 +- src/realmd/AuthCodes.h | 56 +++--- src/realmd/AuthSocket.cpp | 98 +++++------ src/realmd/AuthSocket.h | 10 +- src/realmd/Main.cpp | 48 ++--- src/realmd/RealmList.cpp | 10 +- src/realmd/RealmList.h | 14 +- .../blackrock_spire/boss_urok.cpp | 2 +- .../naxxramas/boss_kelthuzad.cpp | 2 +- .../naxxramas/instance_naxxramas.cpp | 2 +- .../searing_gorge/searing_gorge.cpp | 2 +- .../zulgurub/boss_venoxis.cpp | 2 +- src/scripts/kalimdor/silithus/silithus.cpp | 10 +- src/shared/Database/DBCFileLoader.h | 2 +- src/shared/Database/Database.h | 20 +-- src/shared/Database/DatabaseImpl.h | 2 +- src/shared/Database/SqlDelayThread.h | 12 +- src/shared/Database/SqlOperations.cpp | 40 ++--- src/shared/Database/SqlOperations.h | 16 +- src/shared/Duration.h | 10 +- src/shared/LockedQueue.h | 2 +- src/shared/Log.cpp | 4 +- src/shared/Util.cpp | 4 +- 95 files changed, 843 insertions(+), 844 deletions(-) diff --git a/src/framework/Dynamic/FactoryHolder.h b/src/framework/Dynamic/FactoryHolder.h index 8d452f9d7..c3176330f 100644 --- a/src/framework/Dynamic/FactoryHolder.h +++ b/src/framework/Dynamic/FactoryHolder.h @@ -43,7 +43,7 @@ class FactoryHolder void RegisterSelf(void) { FactoryHolderRepository::Instance().InsertItem(this, i_key); } void DeregisterSelf(void) { FactoryHolderRepository::Instance().RemoveItem(this, false); } - /// Abstract Factory create method + // Abstract Factory create method virtual T* Create(void *data = nullptr) const = 0; private: Key i_key; diff --git a/src/framework/Dynamic/ObjectRegistry.h b/src/framework/Dynamic/ObjectRegistry.h index 230fb7cbe..736dd8a56 100644 --- a/src/framework/Dynamic/ObjectRegistry.h +++ b/src/framework/Dynamic/ObjectRegistry.h @@ -38,14 +38,14 @@ class ObjectRegistry public: typedef std::map RegistryMapType; - /// Returns a registry item + // Returns a registry item const T* GetRegistryItem(Key key) const { typename RegistryMapType::const_iterator iter = i_registeredObjects.find(key); return (iter == i_registeredObjects.end() ? nullptr : iter->second); } - /// Inserts a registry item + // Inserts a registry item bool InsertItem(T *obj, Key key, bool replace = false) { typename RegistryMapType::iterator iter = i_registeredObjects.find(key); @@ -61,7 +61,7 @@ class ObjectRegistry return true; } - /// Removes a registry item + // Removes a registry item void RemoveItem(Key key, bool delete_object = true) { typename RegistryMapType::iterator iter = i_registeredObjects.find(key); @@ -73,13 +73,13 @@ class ObjectRegistry } } - /// Returns true if registry contains an item + // Returns true if registry contains an item bool HasItem(Key key) const { return (i_registeredObjects.find(key) != i_registeredObjects.end()); } - /// Inefficiently return a vector of registered items + // Inefficiently return a vector of registered items unsigned int GetRegisteredItems(std::vector &l) const { unsigned int sz = l.size(); @@ -89,7 +89,7 @@ class ObjectRegistry return i_registeredObjects.size(); } - /// Return the map of registered items + // Return the map of registered items RegistryMapType const &GetRegisteredItems() const { return i_registeredObjects; diff --git a/src/framework/GameSystem/TypeContainer.h b/src/framework/GameSystem/TypeContainer.h index 654c298a6..e3e723dfb 100644 --- a/src/framework/GameSystem/TypeContainer.h +++ b/src/framework/GameSystem/TypeContainer.h @@ -216,7 +216,7 @@ class TypeMapContainer template size_t Count() const { return MaNGOS::Count(i_elements, (SPECIFIC_TYPE*)nullptr); } - /// inserts a specific object into the container + // inserts a specific object into the container template bool insert(SPECIFIC_TYPE *obj) { @@ -224,7 +224,7 @@ class TypeMapContainer return (t != nullptr); } - /// Removes the object from the container, and returns the removed object + // Removes the object from the container, and returns the removed object template bool remove(SPECIFIC_TYPE* obj) { diff --git a/src/framework/Network/MangosSocket.h b/src/framework/Network/MangosSocket.h index f1409ec30..fc969398c 100644 --- a/src/framework/Network/MangosSocket.h +++ b/src/framework/Network/MangosSocket.h @@ -48,7 +48,7 @@ struct ClientPktHeader #pragma pack(pop) #endif -/// Handler that can communicate over stream sockets. +// Handler that can communicate over stream sockets. typedef ACE_Svc_Handler WorldHandler; /** @@ -91,47 +91,47 @@ template class MangosSocket : public WorldHandler { public: - /// things called by ACE framework. + // things called by ACE framework. MangosSocket(); virtual ~MangosSocket(void); - /// Declare the acceptor for this class + // Declare the acceptor for this class typedef ACE_Connector Connector; - /// Declare some friends + // Declare some friends friend class ACE_Connector; friend class ACE_NonBlocking_Connect_Handler; - /// Mutex type used for various synchronizations. + // Mutex type used for various synchronizations. using LockType = std::mutex; typedef std::unique_lock GuardType; - /// Queue for storing packets for which there is no space. + // Queue for storing packets for which there is no space. typedef ACE_Unbounded_Queue PacketQueueT; - /// Check if socket is closed. + // Check if socket is closed. bool IsClosed() const { return closing_; } - /// Close the socket. + // Close the socket. void CloseSocket (void); - /// Called on open ,the void* is the acceptor. + // Called on open ,the void* is the acceptor. virtual int open(void *); - /// Called on failures inside of the acceptor, don't call from your code. + // Called on failures inside of the acceptor, don't call from your code. virtual int close(int); - /// Get address of connected peer. + // Get address of connected peer. const std::string& GetRemoteAddress () const { return m_Address; } - /// Send A packet on the socket, this function is reentrant. - /// @param pct packet to send - /// @return -1 of failure + // Send A packet on the socket, this function is reentrant. + // @param pct packet to send + // @return -1 of failure int SendPacket (const WorldPacket& pct); - /// Add reference to this object. + // Add reference to this object. long AddReference() { return static_cast(add_reference()); } - /// Remove reference to this object. + // Remove reference to this object. long RemoveReference() { return static_cast(remove_reference()); } void SetSession(SessionType* t) { m_Session = t; } @@ -141,87 +141,87 @@ class MangosSocket : public WorldHandler */ bool IsServerSide() { return m_isServerSocket; } protected: - /// process one incoming packet. - /// @param new_pct received packet ,note that you need to delete it. + // process one incoming packet. + // @param new_pct received packet ,note that you need to delete it. int ProcessIncoming (WorldPacket* new_pct) { delete new_pct; return 0; } int OnSocketOpen() { return 0; } - /// Called when we can read from the socket. + // Called when we can read from the socket. virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE); - /// Called when the socket can write. + // Called when the socket can write. virtual int handle_output (ACE_HANDLE = ACE_INVALID_HANDLE); - /// Called when connection is closed or error happens. + // Called when connection is closed or error happens. virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - /// Called by WorldSocketMgr/ReactorRunnable. + // Called by WorldSocketMgr/ReactorRunnable. int Update (void); - /// Helper functions for processing incoming data. + // Helper functions for processing incoming data. int handle_input_header (void); int handle_input_payload (void); int handle_input_missing_data (void); - /// Help functions to mark/unmark the socket for output. - /// @param g the guard is for m_OutBufferLock, the function will release it + // Help functions to mark/unmark the socket for output. + // @param g the guard is for m_OutBufferLock, the function will release it int cancel_wakeup_output (GuardType& g); int schedule_wakeup_output (GuardType& g); - /// Try to write WorldPacket to m_OutBuffer ,return -1 if no space - /// Need to be called with m_OutBufferLock lock held + // Try to write WorldPacket to m_OutBuffer ,return -1 if no space + // Need to be called with m_OutBufferLock lock held int iSendPacket (const WorldPacket& pct); - /// Flush m_PacketQueue if there are packets in it - /// Need to be called with m_OutBufferLock lock held - /// @return true if it wrote to the buffer ( AKA you need - /// to mark the socket for output ). + // Flush m_PacketQueue if there are packets in it + // Need to be called with m_OutBufferLock lock held + // @return true if it wrote to the buffer ( AKA you need + // to mark the socket for output ). bool iFlushPacketQueue (); - /// Time in which the last ping was received + // Time in which the last ping was received ACE_Time_Value m_LastPingTime; - /// Keep track of over-speed pings ,to prevent ping flood. + // Keep track of over-speed pings ,to prevent ping flood. uint32 m_OverSpeedPings; - /// Address of the remote peer + // Address of the remote peer std::string m_Address; - /// Class used for managing encryption of the headers + // Class used for managing encryption of the headers Crypt m_Crypt; - /// Mutex lock to protect m_Session + // Mutex lock to protect m_Session LockType m_SessionLock; - /// Session to which received packets are routed + // Session to which received packets are routed SessionType* m_Session; - /// here are stored the fragments of the received data + // here are stored the fragments of the received data WorldPacket* m_RecvWPct; - /// This block actually refers to m_RecvWPct contents, - /// which allows easy and safe writing to it. - /// It wont free memory when its deleted. m_RecvWPct takes care of freeing. + // This block actually refers to m_RecvWPct contents, + // which allows easy and safe writing to it. + // It wont free memory when its deleted. m_RecvWPct takes care of freeing. ACE_Message_Block m_RecvPct; - /// Fragment of the received header. + // Fragment of the received header. ACE_Message_Block m_Header; - /// Mutex for protecting output related data. + // Mutex for protecting output related data. LockType m_OutBufferLock; - /// Buffer used for writing output. + // Buffer used for writing output. ACE_Message_Block *m_OutBuffer; - /// Size of the m_OutBuffer. + // Size of the m_OutBuffer. size_t m_OutBufferSize; - /// Here are stored packets for which there was no space on m_OutBuffer, - /// this allows not-to kick player if its buffer is overflowed. + // Here are stored packets for which there was no space on m_OutBuffer, + // this allows not-to kick player if its buffer is overflowed. PacketQueueT m_PacketQueue; - /// True if the socket is registered with the reactor for output + // True if the socket is registered with the reactor for output bool m_OutActive; uint32 m_Seed; diff --git a/src/framework/Network/MangosSocketMgr.h b/src/framework/Network/MangosSocketMgr.h index a533226d4..b90fbb85a 100644 --- a/src/framework/Network/MangosSocketMgr.h +++ b/src/framework/Network/MangosSocketMgr.h @@ -11,19 +11,19 @@ template class ReactorRunnable; class ACE_Event_Handler; -/// Manages all sockets connected to peers and network threads +// Manages all sockets connected to peers and network threads template class MangosSocketMgr { public: - /// Start network, listen at address:port . + // Start network, listen at address:port . int StartNetwork(ACE_UINT16 port, std::string& address); - /// Stops all network threads, It will wait for all running threads . + // Stops all network threads, It will wait for all running threads . void StopNetwork(); - /// Wait untill all network threads have "joined" . + // Wait untill all network threads have "joined" . void Wait(); void SetOutKBuff(int v) { m_SockOutKBuff = v; } diff --git a/src/framework/Utilities/Callback.h b/src/framework/Utilities/Callback.h index 386fa6d99..378d70903 100644 --- a/src/framework/Utilities/Callback.h +++ b/src/framework/Utilities/Callback.h @@ -47,7 +47,7 @@ //empty struct to use in templates instead of void type struct null { null() {} }; -/// ------------ BASE CLASSES ------------ +// ------------ BASE CLASSES ------------ namespace MaNGOS { @@ -181,7 +181,7 @@ namespace MaNGOS } }; - /// ---- Statics ---- + // ---- Statics ---- template class _SCallback @@ -308,7 +308,7 @@ namespace MaNGOS }; } -/// --------- GENERIC CALLBACKS ---------- +// --------- GENERIC CALLBACKS ---------- namespace MaNGOS { @@ -405,7 +405,7 @@ namespace MaNGOS }; } -/// ---------- QUERY CALLBACKS ----------- +// ---------- QUERY CALLBACKS ----------- class QueryResult; @@ -496,7 +496,7 @@ namespace MaNGOS } }; - /// ---- Statics ---- + // ---- Statics ---- template class SQueryCallback : public _IQueryCallback<_SCallback > diff --git a/src/game/AI/CreatureAI.h b/src/game/AI/CreatureAI.h index 6be84a1e3..a556d187e 100644 --- a/src/game/AI/CreatureAI.h +++ b/src/game/AI/CreatureAI.h @@ -54,13 +54,13 @@ class CreatureAI virtual ~CreatureAI(); - ///== Information about AI ======================== + // == Information about AI ======================== virtual void GetAIInformation(ChatHandler& /*reader*/) {} virtual uint32 GetData(uint32 /*type*/) { return 0; } - ///== Reactions At ================================= + // == Reactions At ================================= // Called when an unit moves within visibility distance virtual void MoveInLineOfSight(Unit*) {} @@ -146,7 +146,7 @@ class CreatureAI // called when the corpse of this creature gets removed virtual void CorpseRemoved(uint32& /*respawnDelay*/) {} - ///== Triggered Actions Requested ================== + // == Triggered Actions Requested ================== // Called when creature attack expected (if creature can and no have current victim) // Note: for reaction at hostile action must be called AttackedBy function. @@ -164,7 +164,7 @@ class CreatureAI // Will auto attack if the swing timer is ready. bool DoMeleeAttackIfReady(); - ///== State checks ================================= + // == State checks ================================= // Is corpse looting allowed ? virtual bool CanBeLooted() const { return true; } @@ -178,7 +178,7 @@ class CreatureAI // Does the creature melee attack. bool IsMeleeAttackEnabled() const { return m_bMeleeAttack; } - ///== Helper functions ============================= + // == Helper functions ============================= // Attempts to cast a spell and returns the result. SpellCastResult DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32 uiCastFlags = 0); @@ -211,7 +211,7 @@ class CreatureAI protected: bool CanTriggerAlert(Unit const* who); void TriggerAlertDirect(Unit const* who); - ///== Fields ======================================= + // == Fields ======================================= bool m_bUseAiAtControl; bool m_bMeleeAttack; // If we allow melee auto attack bool m_bCombatMovement; // If we allow targeted movement gen (chasing target) diff --git a/src/game/AI/PlayerAI.h b/src/game/AI/PlayerAI.h index 7b31380f6..d6b22157f 100644 --- a/src/game/AI/PlayerAI.h +++ b/src/game/AI/PlayerAI.h @@ -41,10 +41,10 @@ class PlayerAI virtual void UpdateAI(uint32 const /*diff*/); virtual void MovementInform(uint32 MovementType, uint32 Data = 0) {} - ///== Helpers ===================================== + // == Helpers ===================================== bool CanCastSpell(Unit* pTarget, SpellEntry const* pSpell, bool isTriggered, bool checkControlled = true); - ///== Fields ======================================= + // == Fields ======================================= // Pointer to controlled by AI player Player* me; @@ -63,7 +63,7 @@ class PlayerControlledAI: public PlayerAI Unit* FindController(); void UpdateTarget(Unit* victim); - ///== Fields ======================================= + // == Fields ======================================= ObjectGuid controllerGuid; uint32 uiGlobalCD; std::vector usableSpells; diff --git a/src/game/AI/ScriptedInstance.cpp b/src/game/AI/ScriptedInstance.cpp index 8feab388f..b1b8a357e 100644 --- a/src/game/AI/ScriptedInstance.cpp +++ b/src/game/AI/ScriptedInstance.cpp @@ -123,7 +123,7 @@ void ScriptedInstance::LoadSaveData(char const* pStr, uint32* encounters, uint32 } -/// Get the first found Player* (with requested properties) in the map. Can return nullptr. +// Get the first found Player* (with requested properties) in the map. Can return nullptr. Player* ScriptedInstance::GetPlayerInMap(bool bOnlyAlive /*=false*/, bool bCanBeGamemaster /*=true*/) { Map::PlayerList const& lPlayers = instance->GetPlayers(); @@ -138,7 +138,7 @@ Player* ScriptedInstance::GetPlayerInMap(bool bOnlyAlive /*=false*/, bool bCanBe return nullptr; } -/// Returns a pointer to a loaded GameObject that was stored in m_mGoEntryGuidStore. Can return nullptr +// Returns a pointer to a loaded GameObject that was stored in m_mGoEntryGuidStore. Can return nullptr GameObject* ScriptedInstance::GetSingleGameObjectFromStorage(uint32 uiEntry) { EntryGuidMap::iterator find = m_mGoEntryGuidStore.find(uiEntry); @@ -151,7 +151,7 @@ GameObject* ScriptedInstance::GetSingleGameObjectFromStorage(uint32 uiEntry) return nullptr; } -/// Returns a pointer to a loaded Creature that was stored in m_mGoEntryGuidStore. Can return nullptr +// Returns a pointer to a loaded Creature that was stored in m_mGoEntryGuidStore. Can return nullptr Creature* ScriptedInstance::GetSingleCreatureFromStorage(uint32 uiEntry, bool bSkipDebugLog /*=false*/) { EntryGuidMap::iterator find = m_mNpcEntryGuidStore.find(uiEntry); @@ -271,7 +271,7 @@ void DialogueHelper::StartNextDialogueText(int32 iTextEntry) DoNextDialogueStep(); } -/// Internal helper function to do the actual say of a DialogueEntry +// Internal helper function to do the actual say of a DialogueEntry void DialogueHelper::DoNextDialogueStep() { // Last Dialogue Entry done? @@ -327,7 +327,7 @@ void DialogueHelper::DoNextDialogueStep() ++m_pCurrentEntryTwoSide; } -/// Call this function within any DialogueUpdate method. This is required for saying next steps in a dialogue +// Call this function within any DialogueUpdate method. This is required for saying next steps in a dialogue void DialogueHelper::DialogueUpdate(uint32 uiDiff) { if (m_uiTimer) diff --git a/src/game/AI/ScriptedInstance.h b/src/game/AI/ScriptedInstance.h index 69737301a..fb125c73f 100644 --- a/src/game/AI/ScriptedInstance.h +++ b/src/game/AI/ScriptedInstance.h @@ -54,7 +54,7 @@ class ScriptedInstance : public InstanceData // Get a Player from map Player* GetPlayerInMap(bool bOnlyAlive = false, bool bCanBeGamemaster = true); - /// Wrapper for simulating map-wide text in this instance. It is expected that the Creature is stored in m_mNpcEntryGuidStore if loaded. + // Wrapper for simulating map-wide text in this instance. It is expected that the Creature is stored in m_mNpcEntryGuidStore if loaded. void DoOrSimulateScriptTextForThisInstance(int32 iTextEntry, uint32 uiCreatureEntry) { // Prevent debug output in GetSingleCreatureFromStorage @@ -64,8 +64,8 @@ class ScriptedInstance : public InstanceData protected: // Storage for GO-Guids and NPC-Guids typedef std::map EntryGuidMap; - EntryGuidMap m_mGoEntryGuidStore; ///< Store unique GO-Guids by entry - EntryGuidMap m_mNpcEntryGuidStore; ///< Store unique NPC-Guids by entry + EntryGuidMap m_mGoEntryGuidStore; // Store unique GO-Guids by entry + EntryGuidMap m_mNpcEntryGuidStore; // Store unique NPC-Guids by entry }; class ScriptedInstance_PTR : public ScriptedInstance @@ -79,25 +79,25 @@ protected: }; -/// A static const array of this structure must be handled to DialogueHelper +// A static const array of this structure must be handled to DialogueHelper struct SIDialogueEntry { - int32 iTextEntry; ///< To be said text entry - uint32 uiSayerEntry; ///< Entry of the mob who should say - uint32 uiTimer; ///< Time delay until next text of array is said (0 stops) + int32 iTextEntry; // To be said text entry + uint32 uiSayerEntry; // Entry of the mob who should say + uint32 uiTimer; // Time delay until next text of array is said (0 stops) }; -/// A static const array of this structure must be handled to DialogueHelper +// A static const array of this structure must be handled to DialogueHelper struct SIDialogueEntryTwoSide { - int32 iTextEntry; ///< To be said text entry (first side) - uint32 uiSayerEntry; ///< Entry of the mob who should say (first side) - int32 iTextEntryAlt; ///< To be said text entry (second side) - uint32 uiSayerEntryAlt; ///< Entry of the mob who should say (second side) - uint32 uiTimer; ///< Time delay until next text of array is said (0 stops) + int32 iTextEntry; // To be said text entry (first side) + uint32 uiSayerEntry; // Entry of the mob who should say (first side) + int32 iTextEntryAlt; // To be said text entry (second side) + uint32 uiSayerEntryAlt; // Entry of the mob who should say (second side) + uint32 uiTimer; // Time delay until next text of array is said (0 stops) }; -/// Helper class handling a dialogue given as static const array of DialogueEntry or DialogueEntryTwoSide +// Helper class handling a dialogue given as static const array of DialogueEntry or DialogueEntryTwoSide class DialogueHelper { public: @@ -106,9 +106,9 @@ public: // The array MUST be terminated by {0,0,0,0,0} DialogueHelper(SIDialogueEntryTwoSide const* aDialogueTwoSide); - /// Function to initialize the dialogue helper for instances. If not used with instances, GetSpeakerByEntry MUST be overwritten to obtain the speakers + // Function to initialize the dialogue helper for instances. If not used with instances, GetSpeakerByEntry MUST be overwritten to obtain the speakers void InitializeDialogueHelper(ScriptedInstance* pInstance, bool bCanSimulateText = false) { m_pInstance = pInstance; m_bCanSimulate = bCanSimulateText; } - /// Set if take first entries or second entries + // Set if take first entries or second entries void SetDialogueSide(bool bIsFirstSide) { m_bIsFirstSide = bIsFirstSide; } void StartNextDialogueText(int32 iTextEntry); @@ -116,9 +116,9 @@ public: void DialogueUpdate(uint32 uiDiff); protected: - /// Will be called when a dialogue step was done + // Will be called when a dialogue step was done virtual void JustDidDialogueStep(int32 /*iEntry*/) {} - /// Will be called to get a speaker, MUST be implemented if not used in instances + // Will be called to get a speaker, MUST be implemented if not used in instances virtual Creature* GetSpeakerByEntry(uint32 /*uiEntry*/) { return nullptr; } ScriptedInstance* m_pInstance; diff --git a/src/game/AccountMgr.h b/src/game/AccountMgr.h index 6c5bf1f9a..b2794514d 100644 --- a/src/game/AccountMgr.h +++ b/src/game/AccountMgr.h @@ -45,7 +45,7 @@ class MasterPlayer; class AccountPersistentData { -/// WHISP FLOOD +// WHISP FLOOD public: struct WhisperData { @@ -63,7 +63,7 @@ public: typedef std::map WhispersMap; WhispersMap m_whisperTargets; -/// MAIL FLOOD +// MAIL FLOOD public: void JustMailed(uint32 toAccount); bool CanMail(uint32 targetAccount); diff --git a/src/game/AuctionHouse/AuctionHouseMgr.cpp b/src/game/AuctionHouse/AuctionHouseMgr.cpp index c8ddeda40..621f7526e 100644 --- a/src/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouse/AuctionHouseMgr.cpp @@ -647,7 +647,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem void AuctionHouseObject::Update() { time_t curTime = sWorld.GetGameTime(); - ///- Handle expired auctions + // Handle expired auctions AuctionEntryMap::iterator next; // Store a ref to the entry and use it rather than derefencing the itr. // Also required to properly erase the itr and delete the entry if @@ -663,10 +663,10 @@ void AuctionHouseObject::Update() ++next; if (curTime > (entry->expireTime)) { - ///- Either cancel the auction if there was no bidder + // Either cancel the auction if there was no bidder if (entry->bidder == 0) sAuctionMgr.SendAuctionExpiredMail(entry); - ///- Or perform the transaction + // Or perform the transaction else { PlayerTransactionData data; @@ -687,7 +687,7 @@ void AuctionHouseObject::Update() sAuctionMgr.SendAuctionWonMail(entry); } - ///- In any case clear the auction + // In any case clear the auction entry->DeleteFromDB(); sAuctionMgr.RemoveAItem(entry->itemGuidLow); // Invalidates the ref to itr, cannot call delete on itr->second @@ -870,7 +870,7 @@ uint32 AuctionEntry::GetAuctionCut() const return uint32(auctionHouseEntry->cutPercent * bid * sWorld.getConfig(CONFIG_FLOAT_RATE_AUCTION_CUT) / 100.0f); } -/// the sum of outbid is (1% from current bid)*5, if bid is very small, it is 1c +// The sum of outbid is (1% from current bid)*5, if bid is very small, it is 1c uint32 AuctionEntry::GetAuctionOutBid() const { uint32 outbid = (bid / 100) * 5; diff --git a/src/game/Battlegrounds/BattleGroundAV.cpp b/src/game/Battlegrounds/BattleGroundAV.cpp index 5a217b11d..b46c3dc27 100644 --- a/src/game/Battlegrounds/BattleGroundAV.cpp +++ b/src/game/Battlegrounds/BattleGroundAV.cpp @@ -1181,8 +1181,8 @@ void BattleGroundAV::PopulateMineNode(uint8 mine, BattleGroundAVTeamIndex teamId } } -/// will spawn and despawn creatures around a node -/// more a wrapper around spawnevent cause graveyards are special +// will spawn and despawn creatures around a node +// more a wrapper around spawnevent cause graveyards are special void BattleGroundAV::PopulateNode(BG_AV_Nodes node) { ASSERT(node < BG_AV_NODES_MAX); @@ -1261,7 +1261,7 @@ void BattleGroundAV::PopulateNode(BG_AV_Nodes node) } -/// called when using a banner +// called when using a banner void BattleGroundAV::EventPlayerClickedOnFlag(Player* source, GameObject* targetGo) { if (GetStatus() != STATUS_IN_PROGRESS) diff --git a/src/game/Camera.h b/src/game/Camera.h index d4e13d6ba..1e59cae49 100644 --- a/src/game/Camera.h +++ b/src/game/Camera.h @@ -31,7 +31,7 @@ class UpdateData; class WorldPacket; class Player; -/// Camera - object-receiver. Receives broadcast packets from nearby worldobjects, object visibility changes and sends them to client +// Camera - object-receiver. Receives broadcast packets from nearby worldobjects, object visibility changes and sends them to client class Camera { friend class ViewPoint; @@ -79,7 +79,7 @@ class Camera GridReference m_gridRef; }; -/// Object-observer, notifies farsight object state to cameras that attached to it +// Object-observer, notifies farsight object state to cameras that attached to it class ViewPoint { friend class Camera; diff --git a/src/game/Chat/AsyncCommandHandlers.cpp b/src/game/Chat/AsyncCommandHandlers.cpp index 180653548..9ff83c790 100644 --- a/src/game/Chat/AsyncCommandHandlers.cpp +++ b/src/game/Chat/AsyncCommandHandlers.cpp @@ -353,7 +353,7 @@ void PlayerSearchHandler::ShowPlayerListHelper(QueryResult* result, ChatHandler& if (result) { LocaleConstant locale = chatHandler.GetSession() ? chatHandler.GetSession()->GetSessionDbcLocale() : LOCALE_enUS; - ///- Circle through them. Display username and GM level + // Circle through them. Display username and GM level do { // check limit @@ -439,7 +439,7 @@ void AccountSearchHandler::HandleAccountLookupResult(QueryResult* result, uint32 void AccountSearchHandler::ShowAccountListHelper(QueryResult* result, ChatHandler& chatHandler, uint32& count, uint32 limit, bool title) { - ///- Display the list of account/characters online + // Display the list of account/characters online if (!chatHandler.GetSession() && title) // not output header for online case { chatHandler.SendSysMessage(LANG_ACCOUNT_LIST_BAR); @@ -447,7 +447,7 @@ void AccountSearchHandler::ShowAccountListHelper(QueryResult* result, ChatHandle chatHandler.SendSysMessage(LANG_ACCOUNT_LIST_BAR); } - ///- Circle through accounts + // Circle through accounts AccountTypes sessionAccess = chatHandler.GetSession() ? chatHandler.GetSession()->GetSecurity() : SEC_CONSOLE; do { diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp index 64f4b63bc..47591655f 100644 --- a/src/game/Chat/Chat.cpp +++ b/src/game/Chat/Chat.cpp @@ -1862,13 +1862,13 @@ bool ChatHandler::ParseCommands(char const* text) MANGOS_ASSERT(text); MANGOS_ASSERT(*text); - /// chat case (.command or !command format) + // chat case (.command or !command format) if (m_session) { if (text[0] != '!' && text[0] != '.') return false; - /// ignore single . and ! in line + // ignore single . and ! in line if (strlen(text) < 2) return false; @@ -1876,11 +1876,11 @@ bool ChatHandler::ParseCommands(char const* text) return false; } - /// ignore messages staring from many dots. + // ignore messages staring from many dots. if ((text[0] == '.' && text[1] == '.') || (text[0] == '!' && text[1] == '!')) return false; - /// skip first . or ! (in console allowed use command with . and ! and without its) + // skip first . or ! (in console allowed use command with . and ! and without its) if (text[0] == '!' || text[0] == '.') ++text; @@ -3588,7 +3588,7 @@ uint32 ChatHandler::ExtractAccountId(char** args, std::string* accountName /*= n { uint32 account_id = 0; - ///- Get the account name from the command line + // Get the account name from the command line char* account_str = ExtractLiteralArg(args); if (!account_str) @@ -3596,7 +3596,7 @@ uint32 ChatHandler::ExtractAccountId(char** args, std::string* accountName /*= n if (!targetIfNullArg) return 0; - /// only target player different from self allowed (if targetPlayer!=nullptr then not console) + // only target player different from self allowed (if targetPlayer!=nullptr then not console) Player* targetPlayer = GetSelectedPlayer(); if (!targetPlayer) return 0; diff --git a/src/game/Chat/Chat.h b/src/game/Chat/Chat.h index 908570f7a..db41e902e 100644 --- a/src/game/Chat/Chat.h +++ b/src/game/Chat/Chat.h @@ -1088,11 +1088,11 @@ class ChatHandler */ struct DeletedInfo { - uint32 lowguid; ///< the low GUID from the character - std::string name; ///< the character name - uint32 accountId; ///< the account id - std::string accountName; ///< the account name - time_t deleteDate; ///< the date at which the character has been deleted + uint32 lowguid; // the low GUID from the character + std::string name; // the character name + uint32 accountId; // the account id + std::string accountName; // the account name + time_t deleteDate; // the date at which the character has been deleted }; typedef std::list DeletedInfoList; diff --git a/src/game/Commands/AccountCommands.cpp b/src/game/Commands/AccountCommands.cpp index acd75687f..f2af72171 100644 --- a/src/game/Commands/AccountCommands.cpp +++ b/src/game/Commands/AccountCommands.cpp @@ -41,10 +41,10 @@ bool ChatHandler::HandleAccountCommand(char* args) return true; } - /// Set/Unset the expansion level for an account + // Set/Unset the expansion level for an account bool ChatHandler::HandleAccountSetAddonCommand(char* args) { - ///- Get the command line arguments + // Get the command line arguments char* accountStr = ExtractOptNotLastArg(&args); std::string account_name; @@ -78,7 +78,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(char* args) if (!targetAccountId) return false; - /// only target player different from self allowed + // only target player different from self allowed if (GetAccountId() == targetAccountId) return false; @@ -93,12 +93,12 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(char* args) return false; } - /// can set security level only for target with less security and to less security that we have - /// This is also reject self apply in fact + // can set security level only for target with less security and to less security that we have + // This is also reject self apply in fact if (HasLowerSecurityAccount(nullptr, targetAccountId, true)) return false; - /// account can't set security to same or grater level, need more power GM or console + // account can't set security to same or grater level, need more power GM or console AccountTypes plSecurity = GetAccessLevel(); if (AccountTypes(gm) >= plSecurity) { @@ -119,10 +119,10 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(char* args) return true; } -/// Set password for account +// Set password for account bool ChatHandler::HandleAccountSetPasswordCommand(char* args) { - ///- Get the command line arguments + // Get the command line arguments std::string account_name; uint32 targetAccountId = ExtractAccountId(&args, &account_name); if (!targetAccountId) @@ -134,8 +134,8 @@ bool ChatHandler::HandleAccountSetPasswordCommand(char* args) if (!szPassword1 || !szPassword2) return false; - /// can set password only for target with less security - /// This is also reject self apply in fact + // can set password only for target with less security + // This is also reject self apply in fact if (HasLowerSecurityAccount(nullptr, targetAccountId, true)) return false; @@ -170,10 +170,10 @@ bool ChatHandler::HandleAccountSetPasswordCommand(char* args) return true; } -/// Set locked status for account +// Set locked status for account bool ChatHandler::HandleAccountSetLockedCommand(char* args) { - ///- Get the command line arguments + // Get the command line arguments char* accountStr = ExtractOptNotLastArg(&args); std::string account_name; @@ -208,17 +208,17 @@ bool ChatHandler::HandleAccountSetLockedCommand(char* args) return true; } -/// Output list of character for account +// Output list of character for account bool ChatHandler::HandleAccountCharactersCommand(char* args) { - ///- Get the command line arguments + // Get the command line arguments std::string account_name; Player* target = nullptr; // only for triggering use targeted player account uint32 account_id = ExtractAccountId(&args, &account_name, &target); if (!account_id) return false; - ///- Get the characters for account id + // Get the characters for account id CharacterDatabase.AsyncPQuery(&PlayerSearchHandler::HandlePlayerCharacterLookupResult, GetAccountId(), 100u, "SELECT `guid`, `name`, `race`, `class`, `level` FROM `characters` WHERE `account` = %u", @@ -235,10 +235,10 @@ bool ChatHandler::HandleAccountClearDataCommand(char* args) return true; } -/// Create an account +// Create an account bool ChatHandler::HandleAccountCreateCommand(char* args) { - ///- %Parse the command line arguments + // %Parse the command line arguments char *szAcc = ExtractQuotedOrLiteralArg(&args); char *szPassword = ExtractQuotedOrLiteralArg(&args); if (!szAcc || !szPassword) @@ -275,8 +275,8 @@ bool ChatHandler::HandleAccountCreateCommand(char* args) return true; } -/// Delete a user account and all associated characters in this realm -/// \todo This function has to be enhanced to respect the login/realm split (delete char, delete account chars in realm, delete account chars in realm then delete account +// Delete a user account and all associated characters in this realm +// TODO: This function has to be enhanced to respect the login/realm split (delete char, delete account chars in realm, delete account chars in realm then delete account bool ChatHandler::HandleAccountDeleteCommand(char* args) { if (!*args) @@ -287,9 +287,9 @@ bool ChatHandler::HandleAccountDeleteCommand(char* args) if (!account_id) return false; - /// Commands not recommended call from chat, but support anyway - /// can delete only for account with less security - /// This is also reject self apply in fact + // Commands not recommended call from chat, but support anyway + // can delete only for account with less security + // This is also reject self apply in fact if (HasLowerSecurityAccount (nullptr, account_id, true)) return false; @@ -316,14 +316,14 @@ bool ChatHandler::HandleAccountDeleteCommand(char* args) return true; } -/// Display info on users currently in the realm +// Display info on users currently in the realm bool ChatHandler::HandleAccountOnlineListCommand(char* args) { uint32 limit; if (!ExtractOptUInt32(&args, limit, 100)) return false; - ///- Get the list of accounts ID logged to the realm + // Get the list of accounts ID logged to the realm // 0 1 2 3 4 QueryResult* result = LoginDatabase.PQuery("SELECT `id`, `username`, `last_ip`, `gmlevel`, `expansion` FROM `account` WHERE `current_realm` = %u LIMIT %u", realmID, limit); if (!result) diff --git a/src/game/Commands/CreatureCommands.cpp b/src/game/Commands/CreatureCommands.cpp index bf2cd1d61..9324108b9 100644 --- a/src/game/Commands/CreatureCommands.cpp +++ b/src/game/Commands/CreatureCommands.cpp @@ -1697,7 +1697,7 @@ bool ChatHandler::HandleNpcGroupLinkCommand(char * args) return true; } -/// Helper function +// Helper function inline Creature* Helper_CreateWaypointFor(Creature* wpOwner, WaypointPathOrigin wpOrigin, int32 pathId, uint32 wpId, WaypointNode const* wpNode, CreatureInfo const* waypointInfo) { TemporarySummonWaypoint* wpCreature = new TemporarySummonWaypoint(wpOwner->GetObjectGuid(), wpId+1, pathId, (uint32)wpOrigin); @@ -1768,9 +1768,9 @@ bool ChatHandler::HandleWpAddCommand(char* args) return false; // must exist as normal creature in mangos.sql 'creature_template' Creature* targetCreature = GetSelectedCreature(); - WaypointPathOrigin wpDestination = PATH_NO_PATH; ///< into which storage - int32 wpPathId = 0; ///< along which path - uint32 wpPointId = 0; ///< pointId if a waypoint was selected, in this case insert after + WaypointPathOrigin wpDestination = PATH_NO_PATH; // into which storage + int32 wpPathId = 0; // along which path + uint32 wpPointId = 0; // pointId if a waypoint was selected, in this case insert after Creature* wpOwner; if (targetCreature) @@ -2171,7 +2171,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) char* subCmd_str = ExtractLiteralArg(&args); if (!subCmd_str) return false; - std::string subCmd = subCmd_str; ///< info, on, off, first, last + std::string subCmd = subCmd_str; // info, on, off, first, last uint32 dbGuid = 0; int32 wpPathId = 0; @@ -2355,7 +2355,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) return false; } // HandleWpShowCommand - /// [Guid if no selected unit] [pathId [wpOrigin] ] + // [Guid if no selected unit] [pathId [wpOrigin] ] bool ChatHandler::HandleWpExportCommand(char* args) { if (!*args) diff --git a/src/game/Commands/MiscCommands.cpp b/src/game/Commands/MiscCommands.cpp index 4c0bf6c9d..d104a44be 100644 --- a/src/game/Commands/MiscCommands.cpp +++ b/src/game/Commands/MiscCommands.cpp @@ -197,10 +197,10 @@ bool ChatHandler::HandleSetViewCommand(char* /*args*/) return true; } -/// Display the list of GMs +// Display the list of GMs bool ChatHandler::HandleGMListFullCommand(char* /*args*/) { - ///- Get the accounts with GM Level >0 + // Get the accounts with GM Level >0 QueryResult* result = LoginDatabase.PQuery("SELECT `username`, `account_access`.`gmlevel` FROM `account`, `account_access` " "WHERE `account_access`.`id` = `account`.`id` AND `account_access`.`gmlevel` > 0 AND `RealmID`=%u", realmID); if (result) @@ -210,7 +210,7 @@ bool ChatHandler::HandleGMListFullCommand(char* /*args*/) SendSysMessage(LANG_GMLIST_HEADER); SendSysMessage("========================"); - ///- Circle through them. Display username and GM level + // Circle through them. Display username and GM level do { Field* fields = result->Fetch(); @@ -1025,7 +1025,7 @@ bool ChatHandler::HandleSendMassItemsCommand(char* args) bool ChatHandler::HandleSendMoneyHelper(MailDraft& draft, char* args) { - /// format: "subject text" "mail text" money + // format: "subject text" "mail text" money char* msgSubject = ExtractQuotedArg(&args); if (!msgSubject) @@ -1050,7 +1050,7 @@ bool ChatHandler::HandleSendMoneyHelper(MailDraft& draft, char* args) bool ChatHandler::HandleSendMoneyCommand(char* args) { - /// format: name "subject text" "mail text" money + // format: name "subject text" "mail text" money Player* receiver; ObjectGuid receiver_guid; @@ -1076,7 +1076,7 @@ bool ChatHandler::HandleSendMoneyCommand(char* args) bool ChatHandler::HandleSendMassMoneyCommand(char* args) { - /// format: raceMask "subject text" "mail text" money + // format: raceMask "subject text" "mail text" money uint32 raceMask = 0; char const* name = nullptr; @@ -1129,21 +1129,21 @@ bool ChatHandler::HandleSendMailCommand(char* args) return true; } -/// Send a message to a player in game +// Send a message to a player in game bool ChatHandler::HandleSendMessageCommand(char* args) { - ///- Find the player + // Find the player Player* rPlayer; if (!ExtractPlayerTarget(&args, &rPlayer)) return false; - ///- message + // message if (!*args) return false; WorldSession* rPlayerSession = rPlayer->GetSession(); - ///- Check that he is not logging out. + // Check that he is not logging out. if (rPlayerSession->IsLogingOut()) { SendSysMessage(LANG_PLAYER_NOT_FOUND); @@ -1151,8 +1151,8 @@ bool ChatHandler::HandleSendMessageCommand(char* args) return false; } - ///- Send the message - //Use SendAreaTriggerMessage for fastest delivery. + // Send the message + // Use SendAreaTriggerMessage for fastest delivery. rPlayerSession->SendAreaTriggerMessage("%s", args); rPlayerSession->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r"); diff --git a/src/game/Commands/ServerCommands.cpp b/src/game/Commands/ServerCommands.cpp index 3269468cf..f2b6dffed 100644 --- a/src/game/Commands/ServerCommands.cpp +++ b/src/game/Commands/ServerCommands.cpp @@ -390,7 +390,7 @@ bool ChatHandler::HandleServerPLimitCommand(char *args) return true; } -/// Triggering corpses expire check in world +// Triggering corpses expire check in world bool ChatHandler::HandleServerCorpsesCommand(char* /*args*/) { sObjectAccessor.RemoveOldCorpses(); @@ -490,7 +490,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(char* args) return true; } -/// Close RA connection +// Close RA connection bool ChatHandler::HandleQuitCommand(char* /*args*/) { // processed in RASocket @@ -498,7 +498,7 @@ bool ChatHandler::HandleQuitCommand(char* /*args*/) return true; } -/// Exit the realm +// Exit the realm bool ChatHandler::HandleServerExitCommand(char* /*args*/) { SendSysMessage(LANG_COMMAND_EXIT); @@ -522,7 +522,7 @@ bool ChatHandler::HandleViewLogCommand(char* args) return true; } -/// Set the filters of logging +// Set the filters of logging bool ChatHandler::HandleServerLogFilterCommand(char* args) { if (!*args) @@ -569,7 +569,7 @@ bool ChatHandler::HandleServerLogFilterCommand(char* args) return false; } -/// Set the level of logging +// Set the level of logging bool ChatHandler::HandleServerLogLevelCommand(char *args) { if (!*args) @@ -1146,7 +1146,7 @@ bool ChatHandler::HandleReloadQuestTemplateCommand(char* /*args*/) sObjectMgr.LoadQuests(); SendSysMessage("DB table `quest_template` (quest definitions) reloaded."); - /// dependent also from `gameobject` but this table not reloaded anyway + // dependent also from `gameobject` but this table not reloaded anyway sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Re-Loading GameObjects for quests..."); sObjectMgr.LoadGameObjectForQuests(); SendSysMessage("Data GameObjects for quests reloaded."); diff --git a/src/game/GMTicketMgr.h b/src/game/GMTicketMgr.h index ef82ae9b4..8a0334c43 100644 --- a/src/game/GMTicketMgr.h +++ b/src/game/GMTicketMgr.h @@ -168,7 +168,7 @@ private: bool m_completed = false; GMTicketEscalationStatus m_escalatedStatus; bool m_viewed = false; - bool m_needResponse = false; /// @todo find out the use of this, and then store it in DB + bool m_needResponse = false; // @todo find out the use of this, and then store it in DB bool m_needMoreHelp = false; uint8 m_securityNeeded = 0; TicketType m_ticketType; diff --git a/src/game/Group/Group.cpp b/src/game/Group/Group.cpp index 956c92df4..3a4135d48 100644 --- a/src/game/Group/Group.cpp +++ b/src/game/Group/Group.cpp @@ -2307,10 +2307,10 @@ void Group::RewardGroupAtKill(Unit* pVictim, Player* pPlayerTap) if (member_with_max_level) { - /// not get Xp in PvP or no not gray players in group + // not get Xp in PvP or no not gray players in group xp = (PvP || !not_gray_member_with_max_level) ? 0 : MaNGOS::XP::Gain(not_gray_member_with_max_level, static_cast(pVictim)); - /// skip in check PvP case (for speed, not used) + // skip in check PvP case (for speed, not used) bool is_raid = PvP ? false : sMapStorage.LookupEntry(pVictim->GetMapId())->IsRaid() && isRaidGroup(); bool is_dungeon = PvP ? false : sMapStorage.LookupEntry(pVictim->GetMapId())->IsDungeon(); float group_rate = MaNGOS::XP::xp_in_group_rate(count, is_raid); diff --git a/src/game/Handlers/CharacterHandler.cpp b/src/game/Handlers/CharacterHandler.cpp index 639bbab01..64c93896a 100644 --- a/src/game/Handlers/CharacterHandler.cpp +++ b/src/game/Handlers/CharacterHandler.cpp @@ -171,7 +171,7 @@ void WorldSession::HandleCharEnum(QueryResult* result) void WorldSession::HandleCharEnumOpcode(WorldPacket& /*recv_data*/) { - /// get all the data necessary for loading all characters (along with their pets) on the account + // get all the data necessary for loading all characters (along with their pets) on the account CharacterDatabase.AsyncPQuery(&chrHandler, &CharacterHandler::HandleCharEnumCallback, GetAccountId(), // 0 1 2 3 4 5 6 7 8 9 10 "SELECT `characters`.`guid`, `characters`.`name`, `characters`.`race`, `characters`.`class`, `characters`.`gender`, `characters`.`skin`, `characters`.`face`, `characters`.`hair_style`, `characters`.`hair_color`, `characters`.`facial_hair`, `characters`.`level`, " diff --git a/src/game/Handlers/MailHandler.cpp b/src/game/Handlers/MailHandler.cpp index 7ed7bf51d..e242b5157 100644 --- a/src/game/Handlers/MailHandler.cpp +++ b/src/game/Handlers/MailHandler.cpp @@ -857,7 +857,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket& recv_data) recv_data >> itemTextId >> mailId >> unk; - ///TODO: some check needed, if player has item with guid mailId, or has mail with id mailId + // TODO: some check needed, if player has item with guid mailId, or has mail with id mailId WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4 + 10)); // guess size data << itemTextId; diff --git a/src/game/Handlers/PetitionsHandler.cpp b/src/game/Handlers/PetitionsHandler.cpp index 121485c54..2013b154f 100644 --- a/src/game/Handlers/PetitionsHandler.cpp +++ b/src/game/Handlers/PetitionsHandler.cpp @@ -423,10 +423,10 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recv_data) sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "OFFER PETITION: petition %u to %s", petitionGuid, playerGuid.GetString().c_str()); - /// Get petition signs count + // Get petition signs count uint8 signs = petition->GetSignatureCount(); - /// Send response + // Send response WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8 + 8 + 4 + 1 + signs * 12)); data << ObjectGuid(itemGuid); // item guid data << ObjectGuid(_player->GetObjectGuid()); // owner guid @@ -457,7 +457,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recv_data) return; } - /// Collect petition info data + // Collect petition info data if (_player->GetGuildId()) { WorldPacket data(SMSG_TURN_IN_PETITION_RESULTS, 4); diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index 27784897c..44be6aebb 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -149,7 +149,7 @@ void WorldSession::HandleQueryTimeOpcode(WorldPacket& /*recv_data*/) SendQueryTimeResponse(); } -/// Only _static_ data send in this packet !!! +// Only _static_ data send in this packet !!! void WorldSession::HandleCreatureQueryOpcode(WorldPacket& recv_data) { uint32 entry; @@ -235,7 +235,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket& recv_data) } } -/// Only _static_ data send in this packet !!! +// Only _static_ data send in this packet !!! void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recv_data) { uint32 entryID; diff --git a/src/game/Mail/Mail.h b/src/game/Mail/Mail.h index fed85e953..d2d48d072 100644 --- a/src/game/Mail/Mail.h +++ b/src/game/Mail/Mail.h @@ -47,7 +47,7 @@ class Object; class Player; #define MAIL_BODY_ITEM_TEMPLATE 8383 // - plain letter, A Dusty Unsent Letter: 889 -/// The maximal amount of items a mail can contain. +// The maximal amount of items a mail can contain. #define MAX_MAIL_ITEMS 1 /** * The type of the mail. @@ -57,21 +57,21 @@ enum MailMessageType { MAIL_NORMAL = 0, MAIL_AUCTION = 2, - MAIL_CREATURE = 3, /// client send CMSG_CREATURE_QUERY on this mailmessagetype - MAIL_GAMEOBJECT = 4, /// client send CMSG_GAMEOBJECT_QUERY on this mailmessagetype - MAIL_ITEM = 5, /// client send CMSG_ITEM_QUERY on this mailmessagetype + MAIL_CREATURE = 3, // client send CMSG_CREATURE_QUERY on this mailmessagetype + MAIL_GAMEOBJECT = 4, // client send CMSG_GAMEOBJECT_QUERY on this mailmessagetype + MAIL_ITEM = 5, // client send CMSG_ITEM_QUERY on this mailmessagetype }; /** * A Mask representing the status of the mail. */ enum MailCheckMask { - MAIL_CHECK_MASK_NONE = 0x00, /// Nothing. - MAIL_CHECK_MASK_READ = 0x01, /// This mail was read. - MAIL_CHECK_MASK_RETURNED = 0x02, /// This mail was returned. No allow return mail. - MAIL_CHECK_MASK_COPIED = 0x04, /// This mail was copied. No allow make item copy from mail text. - MAIL_CHECK_MASK_COD_PAYMENT = 0x08, /// This mail is payable on delivery. - MAIL_CHECK_MASK_HAS_BODY = 0x10, /// This mail has body text. + MAIL_CHECK_MASK_NONE = 0x00, // Nothing. + MAIL_CHECK_MASK_READ = 0x01, // This mail was read. + MAIL_CHECK_MASK_RETURNED = 0x02, // This mail was returned. No allow return mail. + MAIL_CHECK_MASK_COPIED = 0x04, // This mail was copied. No allow make item copy from mail text. + MAIL_CHECK_MASK_COD_PAYMENT = 0x08, // This mail is payable on delivery. + MAIL_CHECK_MASK_HAS_BODY = 0x10, // This mail has body text. }; /** @@ -133,11 +133,11 @@ class MailSender MailSender(Object* sender, MailStationery stationery = MAIL_STATIONERY_DEFAULT); MailSender(AuctionEntry* sender); public: // Accessors - /// The Messagetype of this MailSender. + // The Messagetype of this MailSender. MailMessageType GetMailMessageType() const { return m_messageType; } - /// The GUID of the player represented by this MailSender, or the Entry of the non-player object. + // The GUID of the player represented by this MailSender, or the Entry of the non-player object. uint32 GetSenderId() const { return m_senderId; } - /// The stationary associated with this MailSender + // The stationary associated with this MailSender MailStationery GetStationery() const { return m_stationery; } private: // Trap for wrong used guid as low guid, no body @@ -217,15 +217,15 @@ class MailDraft */ MailDraft(std::string subject, std::string text); public: // Accessors - /// Returns the template ID used for this MailDraft. + // Returns the template ID used for this MailDraft. uint16 GetMailTemplateId() const { return m_mailTemplateId; } - /// Returns the subject of this MailDraft. + // Returns the subject of this MailDraft. std::string const& GetSubject() const { return m_subject; } - /// Returns the ID of the text of this MailDraft. + // Returns the ID of the text of this MailDraft. uint32 GetBodyId() const { return m_bodyId; } - /// Returns the ammount of money in this MailDraft. + // Returns the ammount of money in this MailDraft. uint32 GetMoney() const { return m_money; } - /// Returns the Cost of delivery of this MailDraft. + // Returns the Cost of delivery of this MailDraft. uint32 GetCOD() const { return m_COD; } public: // modifiers @@ -257,22 +257,22 @@ class MailDraft MailDraft& operator=(MailDraft const&); // trap decl, no body, ...because items clone is high price operation void deleteIncludedItems(bool inDB = false); - bool prepareItems(Player* receiver); ///< called from SendMailTo for generate mailTemplateBase items + bool prepareItems(Player* receiver); // called from SendMailTo for generate mailTemplateBase items - /// The ID of the template associated with this MailDraft. + // The ID of the template associated with this MailDraft. uint16 m_mailTemplateId; - /// Boolean specifying whether items are required or not. + // Boolean specifying whether items are required or not. bool m_mailTemplateItemsNeed; - /// The subject of the MailDraft. + // The subject of the MailDraft. std::string m_subject; - /// The ID of the body of the MailDraft. + // The ID of the body of the MailDraft. uint32 m_bodyId; - /// A map of items in this MailDraft. - MailItemMap m_items; ///< Keep the items in a map to avoid duplicate guids (which can happen), store only low part of guid + // A map of items in this MailDraft. + MailItemMap m_items; // Keep the items in a map to avoid duplicate guids (which can happen), store only low part of guid - /// The amount of money in this MailDraft. + // The amount of money in this MailDraft. uint32 m_money; - /// The cod amount of this MailDraft. + // The cod amount of this MailDraft. uint32 m_COD; }; /** @@ -280,8 +280,8 @@ class MailDraft */ struct MailItemInfo { - uint32 itemGuid; ///< the item instance GUID - uint32 itemId; ///< the item template ID + uint32 itemGuid; // the item instance GUID + uint32 itemId; // the item template ID }; typedef std::vector MailItemInfoVec; @@ -290,39 +290,39 @@ typedef std::vector MailItemInfoVec; */ struct Mail { - /// the ID of the message contained in the mail. + // the ID of the message contained in the mail. uint32 messageID; - /// the type of the message + // the type of the message uint8 messageType; - /// the stationary used in this mail. + // the stationary used in this mail. uint8 stationery; - /// the ID of the template this mail is based on. + // the ID of the template this mail is based on. uint16 mailTemplateId; - /// the LowGUID of the player that sent this mail, or creature low guid, or other id + // the LowGUID of the player that sent this mail, or creature low guid, or other id uint32 sender; - /// the GUID of the player that this mail is sent to. + // the GUID of the player that this mail is sent to. ObjectGuid receiverGuid; - /// the subject of the mail + // the subject of the mail std::string subject; - /// The ID of the itemtext. + // The ID of the itemtext. uint32 itemTextId; - /// flag mark mail that already has items, or already generate none items for template + // flag mark mail that already has items, or already generate none items for template bool has_items; - /// A vector containing Information about the items in this mail. + // A vector containing Information about the items in this mail. MailItemInfoVec items; - /// A vector containing Information about the items that where already take from this mail. + // A vector containing Information about the items that where already take from this mail. std::vector removedItems; - /// The time at which this mail will expire + // The time at which this mail will expire time_t expire_time; - /// The time at which this mail (was/will be) delivered + // The time at which this mail (was/will be) delivered time_t deliver_time; - /// The amount of money contained in this mail. + // The amount of money contained in this mail. uint32 money; - /// The amount of money the receiver has to pay to get this mail. + // The amount of money the receiver has to pay to get this mail. uint32 COD; - /// The time at which this mail was read. + // The time at which this mail was read. uint32 checked; - /// The state of this mail. + // The state of this mail. MailState state; /** @@ -380,7 +380,7 @@ struct Mail * Generate items for template if items not genereated before (receiver has been offline, has_items == false) * */ - void prepareTemplateItems(Player* receiver); ///< called from _LoadMails for generate mailTemplateBase items not generated for offline player + void prepareTemplateItems(Player* receiver); // called from _LoadMails for generate mailTemplateBase items not generated for offline player }; #endif diff --git a/src/game/Mail/MassMailMgr.h b/src/game/Mail/MassMailMgr.h index a96b0b5a1..82f0c3c1e 100644 --- a/src/game/Mail/MassMailMgr.h +++ b/src/game/Mail/MassMailMgr.h @@ -100,7 +100,7 @@ class MassMailMgr private: - /// Mass mail task store mail prototype and receivers list who not get mail yet + // Mass mail task store mail prototype and receivers list who not get mail yet struct MassMail { explicit MassMail(MailDraft* mailProto, MailSender sender); @@ -110,7 +110,7 @@ class MassMailMgr { } - /// m_protoMail is owned by MassMail, so at copy original MassMail field set to nullptr + // m_protoMail is owned by MassMail, so at copy original MassMail field set to nullptr std::unique_ptr m_protoMail; MailSender m_sender; @@ -119,7 +119,7 @@ class MassMailMgr typedef std::list MassMailList; - /// List of current queued mass mail tasks + // List of current queued mass mail tasks MassMailList m_massMails; }; diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 142a059d9..b0a37658f 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -824,7 +824,7 @@ inline void Map::UpdateCells(uint32 map_diff) return; _lastCellsUpdate = now; - /// update active cells around players and active objects + // update active cells around players and active objects if (IsContinent() && m_cellThreads->status() == ThreadPool::Status::READY) UpdateActiveCellsAsynch(now, diff); else @@ -846,7 +846,7 @@ inline void Map::UpdateCells(uint32 map_diff) void Map::ProcessSessionPackets(PacketProcessing type) { uint32 beginTime = WorldTimer::getMSTime(); - /// update worldsessions for existing players + // update worldsessions for existing players for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter) { Player* plr = m_mapRefIter->getSource(); @@ -925,7 +925,7 @@ void Map::Update(uint32 t_diff) _dynamicTree.update(t_diff); UpdateSessionsMovementAndSpellsIfNeeded(); - /// update worldsessions for existing players + // update worldsessions for existing players for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter) { Player* plr = m_mapRefIter->getSource(); @@ -939,7 +939,7 @@ void Map::Update(uint32 t_diff) } uint32 sessionsUpdateTime = WorldTimer::getMSTimeDiffToNow(updateMapTime); - /// update players at tick + // update players at tick std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now(); UpdateSessionsMovementAndSpellsIfNeeded(); UpdatePlayers(); @@ -993,7 +993,7 @@ void Map::Update(uint32 t_diff) } } - ///- Process necessary scripts + // Process necessary scripts if (m_uiScriptedEventsTimer <= t_diff) { UpdateScriptedEvents(); @@ -2450,15 +2450,15 @@ void BattleGroundMap::UnloadAll(bool pForce) Map::UnloadAll(pForce); } -/// Put scripts in the execution queue +// Put scripts in the execution queue void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, ObjectGuid sourceGuid, ObjectGuid targetGuid) { - ///- Find the script map + // Find the script map ScriptMapMap::const_iterator s = scripts.find(id); if (s == scripts.end()) return; - ///- Schedule script execution for all scripts in the script map + // Schedule script execution for all scripts in the script map ScriptMap const* s2 = &(s->second); bool immedScript = false; @@ -2565,7 +2565,7 @@ void Map::TerminateScript(ScriptAction const& step) } } -/// Process queued scripts +// Process queued scripts void Map::ScriptsProcess() { std::unique_lock lock(m_scriptSchedule_lock); @@ -2573,7 +2573,7 @@ void Map::ScriptsProcess() if (m_scriptSchedule.empty()) return; - ///- Process overdue queued scripts + // Process overdue queued scripts ScriptScheduleMap::iterator iter = m_scriptSchedule.begin(); // ok as multimap is a *sorted* associative container while (!m_scriptSchedule.empty() && (iter->first <= sWorld.GetGameTime())) @@ -3104,7 +3104,7 @@ bool Map::GetWalkHitPosition(GenericTransport* transport, float srcX, float srcY return false; } - /// Find navmesh position near source + // Find navmesh position near source float point[3] = {srcY, srcZ, srcX}; // Warning : Coord order is Y,Z,X float closestPoint[3] = {0.0f, 0.0f, 0.0f}; @@ -3128,7 +3128,7 @@ bool Map::GetWalkHitPosition(GenericTransport* transport, float srcX, float srcY } filter.setExcludeFlags(NAV_STEEP_SLOPES); - /// Walk on the surface found + // Walk on the surface found dtPolyRef visited[50] = {0}; int visitedCount = 0; float t = 0.0f; @@ -3150,7 +3150,7 @@ bool Map::GetWalkHitPosition(GenericTransport* transport, float srcX, float srcY if (dtStatusFailed(m_navMeshQuery->closestPointOnPoly(visited[visitedCount - 1], endPosition, endPosition, nullptr))) return false; - /// Compute complete path, and at each path step, check for dynamic LoS collision + // Compute complete path, and at each path step, check for dynamic LoS collision // Rq: This is non-sense on Transports, since we are using position offsets ... float pathPoints[MAX_POINT_PATH_LENGTH * VERTEX_SIZE]; int pointCount = 0; @@ -3185,7 +3185,7 @@ bool Map::GetWalkHitPosition(GenericTransport* transport, float srcX, float srcY if (!MaNGOS::IsValidMapCoord(destX, destY, destZ)) return false; - /// Finalize Z-position using vmaps (more accurate) + // Finalize Z-position using vmaps (more accurate) if (transport) destZ += 0.5f; else @@ -3359,7 +3359,7 @@ bool Map::CheckDynamicTreeLoS(float x1, float y1, float z1, float x2, float y2, void Map::CrashUnload() { sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "Map %u (instance %u) crashed. Has players: %d", GetId(), GetInstanceId(), HavePlayers()); - /// Logout players + // Logout players for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter) { Player* player = m_mapRefIter->getSource(); diff --git a/src/game/Maps/MapManager.cpp b/src/game/Maps/MapManager.cpp index 4cc6b7324..4da972cd3 100644 --- a/src/game/Maps/MapManager.cpp +++ b/src/game/Maps/MapManager.cpp @@ -486,8 +486,8 @@ uint32 MapManager::GetNumPlayersInInstances() return ret; } -///// returns a new or existing Instance -///// in case of battlegrounds it will only return an existing map, those maps are created by bg-system +// returns a new or existing Instance +// in case of battlegrounds it will only return an existing map, those maps are created by bg-system Map* MapManager::CreateInstance(uint32 id, Player* player) { Guard _guard(*this); diff --git a/src/game/Movement/WaypointManager.cpp b/src/game/Movement/WaypointManager.cpp index d2d61691d..e6a86ec2c 100644 --- a/src/game/Movement/WaypointManager.cpp +++ b/src/game/Movement/WaypointManager.cpp @@ -447,7 +447,7 @@ void WaypointManager::_clearPath(WaypointPath &path) path.clear(); } -/// - Insert at a certain point, if pointId == 0 insert last. In this case pointId will be changed to the id to which the node was added +// Insert at a certain point, if pointId == 0 insert last. In this case pointId will be changed to the id to which the node was added WaypointNode const* WaypointManager::AddNode(uint32 entry, uint32 dbGuid, uint32& pointId, WaypointPathOrigin wpDest, float x, float y, float z) { // Support only normal movement tables @@ -594,7 +594,7 @@ void WaypointManager::SetNodeOrientation(uint32 entry, uint32 dbGuid, uint32 poi find->second.orientation = orientation; } -/// return true if a valid scriptId is provided +// return true if a valid scriptId is provided bool WaypointManager::SetNodeScriptId(uint32 entry, uint32 dbGuid, uint32 point, int32 pathId, WaypointPathOrigin wpOrigin, uint32 scriptId) { // Support only normal movement tables diff --git a/src/game/Movement/WaypointManager.h b/src/game/Movement/WaypointManager.h index fe95cdca9..f3c75b317 100644 --- a/src/game/Movement/WaypointManager.h +++ b/src/game/Movement/WaypointManager.h @@ -124,7 +124,7 @@ class WaypointManager void DeletePath(uint32 id); // Toolbox for .wp add command - /// Add a node as position pointId. If pointId == 0 then as last point + // Add a node as position pointId. If pointId == 0 then as last point WaypointNode const* AddNode(uint32 entry, uint32 dbGuid, uint32& pointId, WaypointPathOrigin wpDest, float x, float y, float z); // Toolbox for .wp modify command diff --git a/src/game/Movement/spline/util.cpp b/src/game/Movement/spline/util.cpp index 88ec3fa71..45ded93bf 100644 --- a/src/game/Movement/spline/util.cpp +++ b/src/game/Movement/spline/util.cpp @@ -24,7 +24,7 @@ namespace Movement { double gravity = 19.29110527038574; -/// Velocity bounds that makes fall speed limited +// Velocity bounds that makes fall speed limited float terminalVelocity = 60.148003f; float terminalSavefallVelocity = 7.f; diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 8d426ccfc..a1d260c77 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -323,12 +323,12 @@ void ObjectAccessor::RemoveObject(MasterPlayer* player) HashMapHolder::Remove(player); playerNameToMasterPlayerPointer.erase(player->GetName()); } -/// Define the static member of HashMapHolder +// Define the static member of HashMapHolder template typename HashMapHolder::MapType HashMapHolder::m_objectMap; template std::shared_timed_mutex HashMapHolder::i_lock; -/// Global definitions for the hashmap storage +// Global definitions for the hashmap storage template class HashMapHolder; template class HashMapHolder; diff --git a/src/game/Objects/Corpse.cpp b/src/game/Objects/Corpse.cpp index 503aca4aa..6a783a9e9 100644 --- a/src/game/Objects/Corpse.cpp +++ b/src/game/Objects/Corpse.cpp @@ -54,7 +54,7 @@ Corpse::~Corpse() void Corpse::AddToWorld() { - ///- Register the corpse for guid lookup + // Register the corpse for guid lookup if (!IsInWorld()) sObjectAccessor.AddObject(this); @@ -63,7 +63,7 @@ void Corpse::AddToWorld() void Corpse::RemoveFromWorld() { - ///- Remove the corpse from the accessor + // Remove the corpse from the accessor if (IsInWorld()) sObjectAccessor.RemoveObject(this); diff --git a/src/game/Objects/Creature.cpp b/src/game/Objects/Creature.cpp index b8f12ff33..844f5c948 100644 --- a/src/game/Objects/Creature.cpp +++ b/src/game/Objects/Creature.cpp @@ -227,7 +227,7 @@ void Creature::AddToWorld() { bool bWasInWorld = IsInWorld(); - ///- Register the creature for guid lookup + // Register the creature for guid lookup if (!IsInWorld() && GetObjectGuid().GetHigh() == HIGHGUID_UNIT) GetMap()->InsertObject(GetObjectGuid(), this); @@ -250,7 +250,7 @@ void Creature::AddToWorld() void Creature::RemoveFromWorld() { - ///- Remove the creature from the accessor + // Remove the creature from the accessor if (IsInWorld()) { if (GetUInt32Value(UNIT_CREATED_BY_SPELL)) @@ -2688,7 +2688,7 @@ void Creature::LoadCreatureAddon(bool reload) } } -/// Send a message to LocalDefense channel for players opposition team in the zone +// Send a message to LocalDefense channel for players opposition team in the zone void Creature::SendZoneUnderAttackMessage(Player* attacker) { uint32 areaId = GetAreaId(); diff --git a/src/game/Objects/Creature.h b/src/game/Objects/Creature.h index 3b4688954..78e8f60df 100644 --- a/src/game/Objects/Creature.h +++ b/src/game/Objects/Creature.h @@ -238,9 +238,9 @@ class Creature : public Unit void UpdateDamagePhysical(WeaponAttackType attType) override; uint32 GetCurrentEquipmentId() const { return m_equipmentId; } - static float _GetHealthMod(int32 rank); ///< Get custom factor to scale health (default 1, CONFIG_FLOAT_RATE_CREATURE_*_HP) - static float _GetDamageMod(int32 rank); ///< Get custom factor to scale damage (default 1, CONFIG_FLOAT_RATE_*_DAMAGE) - static float _GetSpellDamageMod(int32 rank); ///< Get custom factor to scale spell damage (default 1, CONFIG_FLOAT_RATE_*_SPELLDAMAGE) + static float _GetHealthMod(int32 rank); // Get custom factor to scale health (default 1, CONFIG_FLOAT_RATE_CREATURE_*_HP) + static float _GetDamageMod(int32 rank); // Get custom factor to scale damage (default 1, CONFIG_FLOAT_RATE_*_DAMAGE) + static float _GetSpellDamageMod(int32 rank); // Get custom factor to scale spell damage (default 1, CONFIG_FLOAT_RATE_*_SPELLDAMAGE) VendorItemData const* GetVendorItems() const; VendorItemData const* GetVendorTemplateItems() const; @@ -594,7 +594,7 @@ class Creature : public Unit ObjectGuid m_lootRecipientGuid; // player who will have rights for looting if m_lootGroupRecipient==0 or group disbanded uint32 m_lootGroupRecipientId; // group who will have rights for looting if set and exist - /// Timers + // Timers uint32 m_corpseDecayTimer; // (msecs)timer for death or corpse disappearance time_t m_respawnTime; // (secs) time of next respawn uint32 m_respawnDelay; // (secs) delay between corpse disappearance and respawning diff --git a/src/game/Objects/DynamicObject.cpp b/src/game/Objects/DynamicObject.cpp index 1860c4367..b5fb1b7c5 100644 --- a/src/game/Objects/DynamicObject.cpp +++ b/src/game/Objects/DynamicObject.cpp @@ -39,7 +39,7 @@ DynamicObject::DynamicObject() : WorldObject(), m_spellId(0), m_effIndex(EFFECT_ void DynamicObject::AddToWorld() { - ///- Register the dynamicObject for guid lookup + // Register the dynamicObject for guid lookup if (!IsInWorld()) GetMap()->InsertObject(GetObjectGuid(), this); @@ -48,7 +48,7 @@ void DynamicObject::AddToWorld() void DynamicObject::RemoveFromWorld() { - ///- Remove the dynamicObject from the accessor + // Remove the dynamicObject from the accessor if (IsInWorld()) { GetMap()->EraseObject(GetObjectGuid()); diff --git a/src/game/Objects/GameObject.cpp b/src/game/Objects/GameObject.cpp index 9c2a3cc6a..dcefbbc47 100644 --- a/src/game/Objects/GameObject.cpp +++ b/src/game/Objects/GameObject.cpp @@ -118,7 +118,7 @@ GameObject* GameObject::CreateGameObject(uint32 entry) void GameObject::AddToWorld() { - ///- Register the gameobject for guid lookup + // Register the gameobject for guid lookup if (!IsInWorld()) { GetMap()->InsertObject(GetObjectGuid(), this); @@ -148,7 +148,7 @@ void GameObject::AIM_Initialize() void GameObject::RemoveFromWorld() { - ///- Remove the gameobject from the accessor + // Remove the gameobject from the accessor if (IsInWorld()) { if (AI()) @@ -334,7 +334,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) UpdatePendingProcs(update_diff); - ///- UpdateAI + // UpdateAI if (i_AI) i_AI->UpdateAI(update_diff); diff --git a/src/game/Objects/Object.cpp b/src/game/Objects/Object.cpp index 0124e67d2..671a37a6e 100644 --- a/src/game/Objects/Object.cpp +++ b/src/game/Objects/Object.cpp @@ -198,7 +198,7 @@ Object::~Object() { if (IsInWorld()) { - ///- Do NOT call RemoveFromWorld here, if the object is a player it will crash + // Do NOT call RemoveFromWorld here, if the object is a player it will crash sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "Object::~Object (GUID: %u TypeId: %u) deleted but still in world!!", GetGUIDLow(), GetTypeId()); MANGOS_ASSERT(false); } diff --git a/src/game/Objects/Pet.cpp b/src/game/Objects/Pet.cpp index bbf1b8781..308d3a6e2 100644 --- a/src/game/Objects/Pet.cpp +++ b/src/game/Objects/Pet.cpp @@ -87,7 +87,7 @@ Pet::~Pet() void Pet::AddToWorld() { - ///- Register the pet for guid lookup + // Register the pet for guid lookup if (!IsInWorld()) GetMap()->InsertObject(GetObjectGuid(), this); @@ -107,11 +107,11 @@ void Pet::AddToWorld() void Pet::RemoveFromWorld() { - ///- Remove the pet from the accessor + // Remove the pet from the accessor if (IsInWorld()) GetMap()->EraseObject(GetObjectGuid()); - ///- Don't call the function for Creature, normal mobs + totems go in a different storage + // Don't call the function for Creature, normal mobs + totems go in a different storage Unit::RemoveFromWorld(); } diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index 343258581..d32d6693a 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -1164,7 +1164,7 @@ uint32 Player::EnvironmentalDamage(EnvironmentalDamageType type, uint32 damage) return damage; } -///The player sobers by 256 every 10 seconds +// The player sobers by 256 every 10 seconds void Player::HandleSobering() { m_drunkTimer = 0; @@ -2582,9 +2582,9 @@ void Player::ProcessDelayedOperations() void Player::AddToWorld() { - ///- Do not add/remove the player from the object storage - ///- It will crash when updating the ObjectAccessor - ///- The player should only be added when logging in + // Do not add/remove the player from the object storage + // It will crash when updating the ObjectAccessor + // The player should only be added when logging in Unit::AddToWorld(); for (int i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i) @@ -2602,7 +2602,7 @@ void Player::RemoveFromWorld() if (IsInWorld()) { - ///- Release charmed creatures, unsummon totems and remove pets/guardians + // Release charmed creatures, unsummon totems and remove pets/guardians UnsummonAllTotems(); RemoveMiniPet(); sZoneScriptMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId); @@ -2622,9 +2622,9 @@ void Player::RemoveFromWorld() // otherwise there will be an existing duel flag pointer but no entry in m_gameObj DuelComplete(DUEL_INTERRUPTED); - ///- Do not add/remove the player from the object storage - ///- It will crash when updating the ObjectAccessor - ///- The player should only be removed when logging out + // Do not add/remove the player from the object storage + // It will crash when updating the ObjectAccessor + // The player should only be removed when logging out if (IsInWorld()) GetCamera().ResetView(); @@ -3293,8 +3293,8 @@ bool Player::IsInSameGroupWith(Player const* p) const GetGroup()->SameSubGroup((Player*)this, (Player*)p))); } -///- If the player is invited, remove him. If the group if then only 1 person, disband the group. -/// \todo Shouldn't we also check if there is no other invitees before disbanding the group? +// If the player is invited, remove him. If the group if then only 1 person, disband the group. +// TODO: Shouldn't we also check if there is no other invitees before disbanding the group? void Player::UninviteFromGroup() { Group* group = GetGroupInvite(); @@ -5933,17 +5933,17 @@ void Player::UpdateSkillsForLevel() uint32 max = SKILL_MAX(data); uint32 val = SKILL_VALUE(data); - /// update only level dependent max skill values + // update only level dependent max skill values if (max != 1) { - /// maximize skill always + // maximize skill always if (alwaysMaxSkill || (rcEntry->flags & SKILL_FLAG_ALWAYS_MAX_VALUE)) { SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(maxSkill, maxSkill)); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; } - else if (max != maxconfskill) /// update max skill value if current max skill not maximized + else if (max != maxconfskill) // update max skill value if current max skill not maximized { SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(val, maxSkill)); if (itr->second.uState != SKILL_NEW) @@ -14634,9 +14634,9 @@ void Player::SendQuestReward(Quest const* pQuest, uint32 XP) const GetSession()->SendPacket(&data); } -/// Sent when a quest is failed to be given off at questtaker. Specifically handled reasons: -/// INVALIDREASON_QUEST_FAILED_INVENTORY_FULL=4 (or 50) -/// INVALIDREASON_QUEST_FAILED_DUPLICATE_ITEM=17 +// Sent when a quest is failed to be given off at questtaker. Specifically handled reasons: +// INVALIDREASON_QUEST_FAILED_INVENTORY_FULL=4 (or 50) +// INVALIDREASON_QUEST_FAILED_DUPLICATE_ITEM=17 void Player::SendQuestFailedAtTaker(uint32 quest_id, uint32 reason) const { if (quest_id) @@ -16291,7 +16291,7 @@ void Player::SendSavedInstances() const #endif } -/// convert the player's binds to the group +// convert the player's binds to the group void Player::ConvertInstancesToGroup(Player* player, Group* group, ObjectGuid player_guid) { bool has_binds = false; @@ -17345,7 +17345,7 @@ void Player::SendResetFailedNotify() ChatHandler(this).SendSysMessage(LANG_LEAVE_TO_RESET_INSTANCE); } -/// Reset all solo instances and optionally send a message on success for each +// Reset all solo instances and optionally send a message on success for each void Player::ResetInstances(InstanceResetMethod method) { // method can be INSTANCE_RESET_ALL, INSTANCE_RESET_GROUP_JOIN @@ -20142,12 +20142,12 @@ uint32 Player::GetBaseWeaponSkillValue(WeaponAttackType attType) const void Player::ResurectUsingRequestData() { - /// Teleport before resurrecting by player, otherwise the player might get attacked from creatures near his corpse + // Teleport before resurrecting by player, otherwise the player might get attacked from creatures near his corpse if (m_resurrectGuid.IsPlayer()) TeleportTo(m_resurrectMap, m_resurrectX, m_resurrectY, m_resurrectZ, GetOrientation()); - //we cannot resurrect player when we triggered any kind of teleport - //player will be resurrected upon teleportation (in MSG_MOVE_TELEPORT_ACK handler) + // We cannot resurrect player when we triggered any kind of teleport + // Player will be resurrected upon teleportation (in MSG_MOVE_TELEPORT_ACK handler) if (IsBeingTeleported()) { ScheduleDelayedOperation(DELAYED_RESURRECT_PLAYER); diff --git a/src/game/Objects/Player.h b/src/game/Objects/Player.h index f86807ea9..ef768aebb 100644 --- a/src/game/Objects/Player.h +++ b/src/game/Objects/Player.h @@ -665,7 +665,7 @@ enum DuelCompleteType DUEL_FLED = 2 }; -/// Type of environmental damages +// Type of environmental damages enum EnvironmentalDamageType { DAMAGE_EXHAUSTED = 0, @@ -821,22 +821,22 @@ class PlayerTaxi std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi); -/// Holder for BattleGround data +// Holder for BattleGround data struct BGData { - uint32 bgInstanceID = 0; ///< This variable is set to bg->m_InstanceID, saved - /// when player is teleported to BG - (it is battleground's GUID) + uint32 bgInstanceID = 0; // This variable is set to bg->m_InstanceID, saved + // when player is teleported to BG - (it is battleground's GUID) BattleGroundTypeId bgTypeID = BATTLEGROUND_TYPE_NONE; std::set bgAfkReporter; uint8 bgAfkReportedCount = 0; time_t bgAfkReportedTimer = 0; - Team bgTeam = TEAM_NONE; ///< What side the player will be added to, saved + Team bgTeam = TEAM_NONE; // What side the player will be added to, saved - WorldLocation joinPos; ///< From where player entered BG, saved + WorldLocation joinPos; // From where player entered BG, saved - bool m_needSave = false; ///< true, if saved to DB fields modified after prev. save (marked as "saved" above) + bool m_needSave = false; // true, if saved to DB fields modified after prev. save (marked as "saved" above) }; struct TransactionPart; @@ -2530,7 +2530,7 @@ class Player final: public Unit bool CanSpeak() const; bool FallGround(uint8 fallMode); - /// Anticheat + // Anticheat MovementAnticheat* GetCheatData() const { return m_session->GetCheatData(); } void OnDisconnected(); void RelocateToLastClientPosition(); diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index 16b71d1bb..023b7889b 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -3934,7 +3934,7 @@ void Unit::RemoveAura(Aura* Aur, AuraRemoveMode mode) // some ShapeshiftBoosts at remove trigger removing other auras including parent Shapeshift aura // remove aura from list before to prevent deleting it before - ///m_Auras.erase(i); + // m_Auras.erase(i); DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Aura %u [spell%u] now is remove mode %d. Caster %s", Aur->GetModifier()->m_auraname, Aur->GetSpellProto()->Id, mode, GetName()); @@ -7550,7 +7550,7 @@ bool Unit::IsVisibleForInState(WorldObject const* pDetector, WorldObject const* return IsVisibleForOrDetect(pDetector, viewPoint, false, inVisibleList); } -/// returns true if creature can't be seen by alive units +// returns true if creature can't be seen by alive units bool Unit::IsInvisibleForAlive() const { // Ghost @@ -7561,7 +7561,7 @@ bool Unit::IsInvisibleForAlive() const return IsSpiritService(); } -/// returns true if creature can be seen by dead units +// returns true if creature can be seen by dead units bool Unit::IsVisibleForDead() const { if (IsCreature() && ToCreature()->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_GHOST_VISIBLE) @@ -8813,7 +8813,7 @@ Player* Unit::GetSpellModOwner() const return nullptr; } -///----------Pet responses methods----------------- +// ----------Pet responses methods----------------- void Unit::SendPetCastFail(uint32 spellid, SpellCastResult msg) { if (msg == SPELL_CAST_OK) @@ -8863,7 +8863,7 @@ void Unit::SendPetAIReaction() } } -///----------End of Pet responses methods---------- +// ----------End of Pet responses methods---------- void Unit::StopMoving(bool force) { diff --git a/src/game/Objects/UnitDefines.h b/src/game/Objects/UnitDefines.h index 59dddd4e7..1ae229f18 100644 --- a/src/game/Objects/UnitDefines.h +++ b/src/game/Objects/UnitDefines.h @@ -645,7 +645,7 @@ static char const* UnitFlagToString(uint32 flag) return "UNKNOWN"; } -/// Non Player Character flags +// Non Player Character flags enum NPCFlags { UNIT_NPC_FLAG_NONE = 0x00000000, diff --git a/src/game/PlayerBots/PlayerBotAI.cpp b/src/game/PlayerBots/PlayerBotAI.cpp index 9ba83a20e..620560bcf 100644 --- a/src/game/PlayerBots/PlayerBotAI.cpp +++ b/src/game/PlayerBots/PlayerBotAI.cpp @@ -64,7 +64,7 @@ void PlayerBotFleeingAI::OnPlayerLogin() me->SetCheatGod(true); } -/// MageOrgrimmarAttackerAI event +// MageOrgrimmarAttackerAI event enum { SPELL_FROST_NOVA = 122, @@ -142,7 +142,7 @@ void MageOrgrimmarAttackerAI::UpdateAI(uint32 const diff) PlayerBotAI::UpdateAI(diff); if (me->GetLevel() != 60) me->GiveLevel(60); - /// DEATH + // DEATH if (!me->IsAlive()) { sPlayerBotMgr.DeleteBot(me->GetGUIDLow()); @@ -162,7 +162,7 @@ void MageOrgrimmarAttackerAI::UpdateAI(uint32 const diff) */ return; } - /// COMBAT AI + // COMBAT AI if (me->IsNonMeleeSpellCasted(false) || (me->HasAura(AURA_REGEN_MANA) && me->GetPower(POWER_MANA) != me->GetMaxPower(POWER_MANA))) return; float range = me->IsInCombat() ? 30.0f : frand(15, 30); @@ -217,7 +217,7 @@ void MageOrgrimmarAttackerAI::UpdateAI(uint32 const diff) me->CastSpell(target, spellId, false); return; } - /// OUT OF COMBAT REGEN + // OUT OF COMBAT REGEN if (!me->IsInCombat() && me->GetPower(POWER_MANA) < 150) { if (!me->movespline->Finalized()) @@ -225,7 +225,7 @@ void MageOrgrimmarAttackerAI::UpdateAI(uint32 const diff) me->CastSpell(target, AURA_REGEN_MANA, false); return; } - /// MOVEMENT AI + // MOVEMENT AI float x, y, z = 0; // Where to go float r = 10; if (me->movespline->Finalized()) diff --git a/src/game/Protocol/Opcodes.cpp b/src/game/Protocol/Opcodes.cpp index 107612552..ceaaee87f 100644 --- a/src/game/Protocol/Opcodes.cpp +++ b/src/game/Protocol/Opcodes.cpp @@ -39,20 +39,20 @@ OpcodeHandler const Opcodes::emptyHandler = Opcodes::Opcodes() { - /// Build Opcodes map + // Build Opcodes map BuildOpcodeList(); } Opcodes::~Opcodes() { - /// Clear Opcodes + // Clear Opcodes mOpcodeMap.clear(); } void Opcodes::BuildOpcodeList() { - /// Correspondence between opcodes and their names + // Correspondence between opcodes and their names /*0x000*/ StoreOpcode(MSG_NULL_ACTION, "MSG_NULL_ACTION", STATUS_NEVER, PACKET_PROCESS_MAX_TYPE, &WorldSession::Handle_NULL); /*0x001*/ StoreOpcode(CMSG_BOOTME, "CMSG_BOOTME", STATUS_NEVER, PACKET_PROCESS_MAX_TYPE, &WorldSession::Handle_NULL); /*0x002*/ StoreOpcode(CMSG_DBLOOKUP, "CMSG_DBLOOKUP", STATUS_NEVER, PACKET_PROCESS_MAX_TYPE, &WorldSession::Handle_NULL); diff --git a/src/game/Protocol/Opcodes.h b/src/game/Protocol/Opcodes.h index e8ad0ef96..a9013ebcb 100644 --- a/src/game/Protocol/Opcodes.h +++ b/src/game/Protocol/Opcodes.h @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup u2w -/// @{ -/// \file +// \addtogroup u2w +// @{ +// \file #ifndef _OPCODES_H #define _OPCODES_H @@ -34,22 +34,22 @@ // table opcodeTable in source when Opcode.h included but WorldSession.h not included #include "WorldSession.h" -/// List of Opcodes +// List of Opcodes #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4 #include "Opcodes_1_12_1.h" #else #include "Opcodes_1_8_0.h" #endif -/// Player state +// Player state enum SessionStatus { - STATUS_AUTHED = 0, ///< Player authenticated (_player==nullptr, m_playerRecentlyLogout = false or will be reset before handler call) - STATUS_LOGGEDIN, ///< Player in game (_player!=nullptr, inWorld()) - STATUS_TRANSFER, ///< Player transferring to another map (_player!=nullptr, !inWorld()) - STATUS_LOGGEDIN_OR_RECENTLY_LOGGEDOUT, ///< _player!= nullptr or _player==nullptr && m_playerRecentlyLogout) - STATUS_NEVER, ///< Opcode not accepted from client (deprecated or server side only) - STATUS_UNHANDLED ///< We don' handle this opcode yet + STATUS_AUTHED = 0, // Player authenticated (_player==nullptr, m_playerRecentlyLogout = false or will be reset before handler call) + STATUS_LOGGEDIN, // Player in game (_player!=nullptr, inWorld()) + STATUS_TRANSFER, // Player transferring to another map (_player!=nullptr, !inWorld()) + STATUS_LOGGEDIN_OR_RECENTLY_LOGGEDOUT, // _player!= nullptr or _player==nullptr && m_playerRecentlyLogout) + STATUS_NEVER, // Opcode not accepted from client (deprecated or server side only) + STATUS_UNHANDLED // We don' handle this opcode yet }; class WorldPacket; @@ -80,7 +80,7 @@ class Opcodes ref.handler = handler; } - /// Lookup opcode + // Lookup opcode inline OpcodeHandler const* LookupOpcode(uint16 id) const { OpcodeMap::const_iterator itr = mOpcodeMap.find(id); @@ -89,7 +89,7 @@ class Opcodes return nullptr; } - /// compatible with other mangos branches access + // compatible with other mangos branches access inline OpcodeHandler const& operator[] (uint16 id) const { @@ -107,7 +107,7 @@ class Opcodes #define opcodeTable MaNGOS::Singleton::Instance() -/// Lookup opcode name for human understandable logging +// Lookup opcode name for human understandable logging inline char const* LookupOpcodeName(uint16 id) { if (OpcodeHandler const* op = opcodeTable.LookupOpcode(id)) @@ -116,4 +116,4 @@ inline char const* LookupOpcodeName(uint16 id) } #endif -/// @} +// @} diff --git a/src/game/Protocol/WorldSocket.h b/src/game/Protocol/WorldSocket.h index e39ab8467..0f4e5375d 100644 --- a/src/game/Protocol/WorldSocket.h +++ b/src/game/Protocol/WorldSocket.h @@ -48,13 +48,13 @@ class WorldSocket: public MangosSocket int ProcessIncoming (WorldPacket* new_pct); - /// Called by ProcessIncoming() on CMSG_AUTH_SESSION. + // Called by ProcessIncoming() on CMSG_AUTH_SESSION. int HandleAuthSession (WorldPacket& recvPacket); - /// Called by ProcessIncoming() on CMSG_PING. + // Called by ProcessIncoming() on CMSG_PING. int HandlePing (WorldPacket& recvPacket); }; #endif /* _WORLDSOCKET_H */ -/// @} +// @} diff --git a/src/game/Protocol/WorldSocketMgr.h b/src/game/Protocol/WorldSocketMgr.h index 4525112c3..b0288ea41 100644 --- a/src/game/Protocol/WorldSocketMgr.h +++ b/src/game/Protocol/WorldSocketMgr.h @@ -33,7 +33,7 @@ #include "ace/Thread_Mutex.h" class WorldSocket; -/// Manages all sockets connected to peers and network threads +// Manages all sockets connected to peers and network threads class WorldSocketMgr: public MangosSocketMgr { public: @@ -46,4 +46,4 @@ class WorldSocketMgr: public MangosSocketMgr #define sWorldSocketMgr WorldSocketMgr::Instance() #endif -/// @} +// @} diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index b34afced9..98fcbbcd2 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -1556,7 +1556,7 @@ enum ResponseCodes CHAR_NAME_SUCCESS, }; -/// Ban function modes +// Ban function modes enum BanMode { BAN_ACCOUNT, @@ -1564,7 +1564,7 @@ enum BanMode BAN_IP }; -/// Ban function return codes +// Ban function return codes enum BanReturn { BAN_SUCCESS, diff --git a/src/game/SocialMgr.h b/src/game/SocialMgr.h index e53658094..5d39895d3 100644 --- a/src/game/SocialMgr.h +++ b/src/game/SocialMgr.h @@ -78,7 +78,7 @@ struct FriendInfo typedef std::map PlayerSocialMap; typedef std::map SocialMap; -/// Results of friend related commands +// Results of friend related commands enum FriendsResult { FRIEND_DB_ERROR = 0x00, // ERR_FRIEND_NOT_FOUND diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 58e258a8c..60dfe6fd6 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -6988,8 +6988,8 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_casterUnit->IsPlayer() && m_casterUnit->GetTransport() && !static_cast(m_casterUnit)->IsOutdoorOnTransport()) return SPELL_FAILED_NO_MOUNTS_ALLOWED; - /// Specific case for Temple of Ahn'Qiraj mounts as they are usable only in AQ40 and are the only mounts allowed here - /// TBC and above handle this by using m_spellInfo->AreaId + // Specific case for Temple of Ahn'Qiraj mounts as they are usable only in AQ40 and are the only mounts allowed here + // TBC and above handle this by using m_spellInfo->AreaId bool isAQ40Mount = false; switch (m_spellInfo->Id) @@ -7548,13 +7548,13 @@ bool Spell::IgnoreItemRequirements() const { if (m_IsTriggeredSpell) { - /// Not own traded item (in trader trade slot) req. reagents including triggered spell case + // Not own traded item (in trader trade slot) req. reagents including triggered spell case if (Item* targetItem = m_targets.getItemTarget()) if (targetItem->GetOwnerGuid() != m_caster->GetObjectGuid()) return false; - /// Some triggered spells have same reagents that have master spell - /// expected in test: master spell have reagents in first slot then triggered don't must use own + // Some triggered spells have same reagents that have master spell + // expected in test: master spell have reagents in first slot then triggered don't must use own return !(m_triggeredBySpellInfo && !m_triggeredBySpellInfo->Reagent[0]); } diff --git a/src/game/Spells/SpellEntry.h b/src/game/Spells/SpellEntry.h index 218c7f522..bad3f7cd7 100644 --- a/src/game/Spells/SpellEntry.h +++ b/src/game/Spells/SpellEntry.h @@ -503,7 +503,7 @@ class SpellEntry SpellEntry() = default; ~SpellEntry() = default; - /// DBC DATA: + // DBC DATA: uint32 Id = 0; // 0 uint32 School = 0; // 1 uint32 Category = 0; // 2 @@ -597,7 +597,7 @@ class SpellEntry //uint32 MinReputation; // 174 not used //uint32 RequiredAuraVision; // 175 not used - /// CUSTOM FIELDS: + // CUSTOM FIELDS: uint32 MinTargetLevel = 0; // 162 uint32 Custom = 0; // 176 uint32 Internal = 0; // Assigned by the core. diff --git a/src/game/Spells/SpellMgr.cpp b/src/game/Spells/SpellMgr.cpp index 81c13c14d..2573fd866 100644 --- a/src/game/Spells/SpellMgr.cpp +++ b/src/game/Spells/SpellMgr.cpp @@ -2264,7 +2264,7 @@ void SpellMgr::LoadSpellPetAuras() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ">> Loaded %u spell pet auras", count); } -/// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc +// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg) { // not exist diff --git a/src/game/Transports/Transport.h b/src/game/Transports/Transport.h index bc204c327..05dd1939d 100644 --- a/src/game/Transports/Transport.h +++ b/src/game/Transports/Transport.h @@ -48,13 +48,13 @@ public: typedef std::set PlayerSet; PassengerSet& GetPassengers() { return m_passengers; } - /// This method transforms supplied transport offsets into global coordinates + // This method transforms supplied transport offsets into global coordinates void CalculatePassengerPosition(float& x, float& y, float& z, float* o = nullptr) const { CalculatePassengerPosition(x, y, z, o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); } - /// This method transforms supplied global coordinates into local offsets + // This method transforms supplied global coordinates into local offsets void CalculatePassengerOffset(float& x, float& y, float& z, float* o = nullptr) const { CalculatePassengerOffset(x, y, z, o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index 0c99fc124..bec6693da 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -250,8 +250,8 @@ SpellProcEventTriggerCheck Unit::IsTriggeredAtSpellProcEvent(Unit* pVictim, Spel if (spellProto->Id == 14076 || spellProto->Id == 14094 || spellProto->Id == 14095) return SPELL_PROC_TRIGGER_FAILED; - /// [TODO] - /// Delete all these spells, and manage it via the DB (spell_proc_event) + // [TODO] + // Delete all these spells, and manage it via the DB (spell_proc_event) if (procSpell && !(procExtra & PROC_EX_CAST_END)) { #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4 diff --git a/src/game/Weather.cpp b/src/game/Weather.cpp index e090a2764..f0455df40 100644 --- a/src/game/Weather.cpp +++ b/src/game/Weather.cpp @@ -36,7 +36,7 @@ INSTANTIATE_SINGLETON_1(WeatherMgr); -/// Weather sound defines ( only for 1.12 ) +// Weather sound defines ( only for 1.12 ) enum WeatherSounds { WEATHER_NOSOUND = 0, @@ -51,7 +51,7 @@ enum WeatherSounds WEATHER_SANDSTORMHEAVY = 8558 }; -/// Create the Weather object +// Create the Weather object Weather::Weather(uint32 zone, WeatherZoneChances const* weatherChances) : m_zone(zone), m_type(WEATHER_TYPE_FINE), @@ -63,19 +63,19 @@ Weather::Weather(uint32 zone, WeatherZoneChances const* weatherChances) : DETAIL_FILTER_LOG(LOG_FILTER_WEATHER, "WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (m_timer.GetInterval() / (MINUTE * IN_MILLISECONDS))); } -/// Launch a weather update +// Launch a weather update bool Weather::Update(uint32 diff, Map const* _map) { m_timer.Update(diff); - ///- If the timer has passed, ReGenerate the weather + // If the timer has passed, ReGenerate the weather if (m_timer.Passed()) { m_timer.Reset(); // update only if Regenerate has changed the weather if (ReGenerate()) { - ///- Weather will be removed if not updated (no players in zone anymore) + // Weather will be removed if not updated (no players in zone anymore) if (!SendWeatherForPlayersInZone(_map)) return false; } @@ -83,7 +83,7 @@ bool Weather::Update(uint32 diff, Map const* _map) return true; } -/// Calculate the new weather, returns true if and only if the weather changed +// Calculate the new weather, returns true if and only if the weather changed bool Weather::ReGenerate() { if (m_isPermanentWeather) @@ -101,11 +101,11 @@ bool Weather::ReGenerate() return old_type != m_type || old_grade != m_grade; } - /// Weather statistics: - ///- 30% - no change - ///- 30% - weather gets better (if not fine) or change weather type - ///- 30% - weather worsens (if not fine) - ///- 10% - radical change (if not fine) + // Weather statistics: + // 30% - no change + // 30% - weather gets better (if not fine) or change weather type + // 30% - weather worsens (if not fine) + // 10% - radical change (if not fine) uint32 u = urand(0, 99); if (u < 30) @@ -141,10 +141,10 @@ bool Weather::ReGenerate() if (m_type != WEATHER_TYPE_FINE) { - /// Radical change: - ///- if light -> heavy - ///- if medium -> change weather type - ///- if heavy -> 50% light, 50% change weather type + // Radical change: + // if light -> heavy + // if medium -> change weather type + // if heavy -> 50% light, 50% change weather type if (m_grade < 0.33333334f) { @@ -183,11 +183,11 @@ bool Weather::ReGenerate() else m_type = WEATHER_TYPE_FINE; - /// New weather statistics (if not fine): - ///- 85% light - ///- 7% medium - ///- 7% heavy - /// If fine 100% sun (no fog) + // New weather statistics (if not fine): + // 85% light + // 7% medium + // 7% heavy + // If fine 100% sun (no fog) if (m_type == WEATHER_TYPE_FINE) m_grade = 0.0f; @@ -233,11 +233,11 @@ bool Weather::SendWeatherForPlayersInZone(Map const* _map) data << uint32(GetSound()); // 1.12 soundid data << uint8(0); // 1 = instant change, 0 = smooth change - ///- Send the weather packet to all players in this zone + // Send the weather packet to all players in this zone if (!_map->SendToPlayersInZone(&data, m_zone)) return false; - ///- Log the event + // Log the event LogWeatherState(GetWeatherState()); return true; @@ -350,14 +350,14 @@ WeatherSystem::WeatherSystem(Map const* _map) : m_map(_map) WeatherSystem::~WeatherSystem() { - ///- Empty the WeatherMap + // Empty the WeatherMap for (const auto& weather : m_weathers) delete weather.second; m_weathers.clear(); } -/// Find or Create a Weather object by the given zoneid +// Find or Create a Weather object by the given zoneid Weather* WeatherSystem::FindOrCreateWeather(uint32 zoneId) { WeatherMap::const_iterator itr = m_weathers.find(zoneId); @@ -370,13 +370,13 @@ Weather* WeatherSystem::FindOrCreateWeather(uint32 zoneId) return w; } -/// Update Weathers for the different zones +// Update Weathers for the different zones void WeatherSystem::UpdateWeathers(uint32 diff) { - ///- Send an update signal to Weather objects + // Send an update signal to Weather objects for (WeatherMap::iterator itr = m_weathers.begin(); itr != m_weathers.end();) { - ///- and remove Weather objects for zones with no player + // and remove Weather objects for zones with no player // As interval > WorldTick if (!itr->second->Update(diff, m_map)) { @@ -388,7 +388,7 @@ void WeatherSystem::UpdateWeathers(uint32 diff) } } -/// Get the sound number associated with the current weather +// Get the sound number associated with the current weather uint32 Weather::GetSound() { uint32 sound; @@ -432,7 +432,7 @@ uint32 Weather::GetSound() return sound; } -/// Load Weather chanced from table game_weather +// Load Weather chanced from table game_weather void WeatherMgr::LoadWeatherZoneChances() { uint32 count = 0; diff --git a/src/game/Weather.h b/src/game/Weather.h index 8376372af..8b628ce1b 100644 --- a/src/game/Weather.h +++ b/src/game/Weather.h @@ -52,20 +52,20 @@ enum WeatherState struct WeatherZoneChances; -/// Weather for one zone +// Weather for one zone class Weather { public: Weather(uint32 zone, WeatherZoneChances const* weatherChances); ~Weather() {}; - /// Send Weather to one player + // Send Weather to one player void SendWeatherUpdateToPlayer(Player* player); - /// Set the weather + // Set the weather void SetWeather(WeatherType type, float grade, Map const* _map, bool isPermanent); - /// Update the weather in this zone, when the timer is expired the weather will be rolled again + // Update the weather in this zone, when the timer is expired the weather will be rolled again bool Update(uint32 diff, Map const* _map); - /// Check if a type is valid + // Check if a type is valid static bool IsValidWeatherType(uint32 type) { switch (type) @@ -82,11 +82,11 @@ class Weather private: uint32 GetSound(); - /// Send SMSG_WEATHER to all players in the zone + // Send SMSG_WEATHER to all players in the zone bool SendWeatherForPlayersInZone(Map const* _map); - /// Calculate new weather + // Calculate new weather bool ReGenerate(); - /// Calculate state based on type and grade + // Calculate state based on type and grade WeatherState GetWeatherState() const; // Helper to get the grade between 0..1 void NormalizeGrade(); @@ -105,7 +105,7 @@ class Weather // Weather information hold on one map // --------------------------------------------------------- -/// Weathers for one map +// Weathers for one map class WeatherSystem { public: diff --git a/src/game/World.cpp b/src/game/World.cpp index 4517caa94..4ec41bd0c 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -112,7 +112,7 @@ World& GetSWorld() return sWorld; } -/// World constructor +// World constructor World::World(): m_playerLimit(0), m_allowMovement(true), @@ -150,10 +150,10 @@ World::World(): m_charDbWorkerThread = nullptr; } -/// World destructor +// World destructor World::~World() { - ///- Empty the kicked session set + // Empty the kicked session set while (!m_sessions.empty()) { // not remove from queue, prevent loading new sessions @@ -199,7 +199,7 @@ void World::Shutdown() sAnticheatMgr->StopWardenUpdateThread(); } -/// Find a session by its id +// Find a session by its id WorldSession* World::FindSession(uint32 id) const { SessionMap::const_iterator itr = m_sessions.find(id); @@ -210,10 +210,10 @@ WorldSession* World::FindSession(uint32 id) const return nullptr; } -/// Remove a given session +// Remove a given session bool World::RemoveSession(uint32 id) { - ///- Find the session, kick the user, but we can't delete session at this moment to prevent iterator invalidation + // Find the session, kick the user, but we can't delete session at this moment to prevent iterator invalidation SessionMap::const_iterator itr = m_sessions.find(id); if (itr != m_sessions.end() && itr->second) @@ -241,10 +241,10 @@ void World::AddSession_(WorldSession* s) { MANGOS_ASSERT(s); - //NOTE - Still there is race condition in WorldSession* being used in the Sockets + // NOTE - Still there is race condition in WorldSession* being used in the Sockets - ///- kick already loaded player with same account (if any) and remove session - ///- if player is in loading and want to load again, return + // kick already loaded player with same account (if any) and remove session + // if player is in loading and want to load again, return if (!RemoveSession(s->GetAccountId())) { s->KickPlayer(); @@ -415,7 +415,7 @@ bool World::RemoveQueuedSession(WorldSession* sess) return found; } -/// Initialize config values +// Initialize config values void World::LoadConfigSettings(bool reload) { if (reload) @@ -427,7 +427,7 @@ void World::LoadConfigSettings(bool reload) } } - ///- Read the version of the configuration file and warn the user in case of emptiness or mismatch + // Read the version of the configuration file and warn the user in case of emptiness or mismatch uint32 confVersion = sConfig.GetIntDefault("ConfVersion", 0); if (!confVersion) { @@ -456,11 +456,11 @@ void World::LoadConfigSettings(bool reload) if (m_wowPatch > MAX_CONTENT_PATCH) m_wowPatch = MAX_CONTENT_PATCH; - ///- Read the player limit and the Message of the day from the config file + // Read the player limit and the Message of the day from the config file SetPlayerLimit(sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT), true); SetMotd(sConfig.GetStringDefault("Motd", "Welcome to the Massive Network Game Object Server.") + std::string("\n") + std::string(GetPatchName()) + std::string(" is now live!")); - ///- Read all rates from the config file + // Read all rates from the config file setConfigPos(CONFIG_FLOAT_RATE_HEALTH, "Rate.Health", 1.0f); setConfigPos(CONFIG_FLOAT_RATE_POWER_MANA, "Rate.Mana", 1.0f); setConfig(CONFIG_FLOAT_RATE_POWER_RAGE_INCOME, "Rate.Rage.Income", 1.0f); @@ -540,7 +540,7 @@ void World::LoadConfigSettings(bool reload) setConfig(CONFIG_FLOAT_MAX_PLAYERS_STEALTH_DETECT_RANGE, "MaxPlayersStealthDetectRange", 30.0f); setConfig(CONFIG_FLOAT_MAX_CREATURES_STEALTH_DETECT_RANGE, "MaxCreaturesStealthDetectRange", 30.0f); - ///- Read other configuration items from the config file + // Read other configuration items from the config file setConfig(CONFIG_UINT32_LOGIN_PER_TICK, "LoginPerTick", 0); setConfig(CONFIG_UINT32_PLAYER_HARD_LIMIT, "PlayerHardLimit", 0); setConfig(CONFIG_UINT32_LOGIN_QUEUE_GRACE_PERIOD_SECS, "LoginQueue.GracePeriodSecs", 0); @@ -855,7 +855,7 @@ void World::LoadConfigSettings(bool reload) m_MaxVisibleDistanceInFlight = MAX_VISIBILITY_DISTANCE - m_VisibleObjectGreyDistance; } - ///- Load the CharDelete related config options + // Load the CharDelete related config options setConfigMinMax(CONFIG_UINT32_CHARDELETE_METHOD, "CharDelete.Method", 0, 0, 1); setConfigMinMax(CONFIG_UINT32_CHARDELETE_MIN_LEVEL, "CharDelete.MinLevel", 0, 0, getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)); setConfigPos(CONFIG_UINT32_CHARDELETE_KEEP_DAYS, "CharDelete.KeepDays", 30); @@ -865,7 +865,7 @@ void World::LoadConfigSettings(bool reload) if (configNoReload(reload, CONFIG_UINT32_GUID_RESERVE_SIZE_GAMEOBJECT, "GuidReserveSize.GameObject", 100)) setConfigPos(CONFIG_UINT32_GUID_RESERVE_SIZE_GAMEOBJECT, "GuidReserveSize.GameObject", 100); - ///- Read the "Honor" directory from the config file (basically these are PvP ranking logs) + // Read the "Honor" directory from the config file (basically these are PvP ranking logs) std::string honorPath = sConfig.GetStringDefault("HonorDir", "./"); // for empty string use current dir as for absent case @@ -886,7 +886,7 @@ void World::LoadConfigSettings(bool reload) sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Using HonorDir %s", m_honorPath.c_str()); } - ///- Read the "Data" directory from the config file + // Read the "Data" directory from the config file std::string dataPath = sConfig.GetStringDefault("DataDir", "./"); // for empty string use current dir as for absent case @@ -1262,19 +1262,19 @@ char const* World::GetPatchName() const return "Invalid Patch!"; } -/// Initialize the World +// Initialize the World void World::SetInitialWorldSettings() { - ///- Initialize the random number generator + // Initialize the random number generator srand((unsigned int)time(nullptr)); - ///- Time server startup + // Time server startup uint32 uStartTime = WorldTimer::getMSTime(); - ///- Initialize config settings + // Initialize config settings LoadConfigSettings(); - ///- Check the existence of the map files for all races start areas. + // Check the existence of the map files for all races start areas. if (!MapManager::ExistMapAndVMap(0, -6240.32f, 331.033f) || !MapManager::ExistMapAndVMap(0, -8949.95f, -132.493f) || !MapManager::ExistMapAndVMap(1, -618.518f, -4251.67f) || @@ -1287,7 +1287,7 @@ void World::SetInitialWorldSettings() exit(1); } - ///- Loading strings. Getting no records means core load has to be canceled because no error message can be output. + // Loading strings. Getting no records means core load has to be canceled because no error message can be output. sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading MaNGOS strings..."); if (!sObjectMgr.LoadMangosStrings()) @@ -1303,13 +1303,13 @@ void World::SetInitialWorldSettings() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); sInstanceStatistics.LoadFromDB(); - ///- Chargements des variables (necessaire pour le OutdoorJcJ) + // Chargements des variables (necessaire pour le OutdoorJcJ) sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading saved variables ..."); sObjectMgr.LoadSavedVariable(); - ///- Update the realm entry in the database with the realm type from the config file - //No SQL injection as values are treated as integers + // Update the realm entry in the database with the realm type from the config file + // No SQL injection as values are treated as integers // not send custom type REALM_FFA_PVP to realm list uint32 server_type = IsFFAPvPRealm() ? REALM_TYPE_PVP : getConfig(CONFIG_UINT32_GAME_TYPE); @@ -1319,7 +1319,7 @@ void World::SetInitialWorldSettings() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading GM security access ..."); sAccountMgr.Load(); - ///- Remove the bones (they should not exist in DB though) and old corpses after a restart + // Remove the bones (they should not exist in DB though) and old corpses after a restart CharacterDatabase.PExecute("DELETE FROM `corpse` WHERE `corpse_type` = '0' OR `time` < (UNIX_TIMESTAMP()-'%u')", 3 * DAY); sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading spells ..."); @@ -1348,7 +1348,7 @@ void World::SetInitialWorldSettings() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading world safe locs facing values ..."); sObjectMgr.LoadWorldSafeLocsFacing(); - ///- Load the DBC files + // Load the DBC files sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Initialize data stores..."); #ifdef _WIN32 @@ -1380,7 +1380,7 @@ void World::SetInitialWorldSettings() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading SkillRaceClassInfoMultiMap Data..."); sSpellMgr.LoadSkillRaceClassInfoMap(); - ///- Clean up and pack instances + // Clean up and pack instances sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Cleaning up instances..."); sMapPersistentStateMgr.CleanupInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables @@ -1393,7 +1393,7 @@ void World::SetInitialWorldSettings() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Scheduling normal instance reset..."); sMapPersistentStateMgr.ScheduleInstanceResets(); // Must be after cleanup and packing - ///- Init highest guids before any guid using table loading to prevent using not initialized guids in some code. + // Init highest guids before any guid using table loading to prevent using not initialized guids in some code. sObjectMgr.SetHighestGuids(); // must be after packing instances sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); @@ -1636,7 +1636,7 @@ void World::SetInitialWorldSettings() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); sWaypointMgr.Load(); - ///- Loading localization data + // Loading localization data sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading Localization strings..."); sObjectMgr.LoadBroadcastTextLocales(); sObjectMgr.LoadCreatureLocales(); // must be after CreatureInfo loading @@ -1651,7 +1651,7 @@ void World::SetInitialWorldSettings() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ">>> Localization strings loaded"); sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); - ///- Load dynamic data tables from the database + // Load dynamic data tables from the database sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading Auctions..."); sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); sAuctionMgr.LoadAuctionHouses(); @@ -1692,11 +1692,11 @@ void World::SetInitialWorldSettings() sTicketMgr->LoadTickets(); sTicketMgr->LoadSurveys(); - ///- Handle outdated emails (delete/return) + // Handle outdated emails (delete/return) sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Returning old mails..."); sObjectMgr.ReturnOrDeleteOldMails(false); - ///- Load and initialize scripts + // Load and initialize scripts sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading Scripts..."); sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); sScriptMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate @@ -1724,7 +1724,7 @@ void World::SetInitialWorldSettings() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading aura removal on map change definitions"); sAuraRemovalMgr.LoadFromDB(); - ///- Initialize game time and timers + // Initialize game time and timers sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "DEBUG:: Initialize game time and timers"); m_gameTime = time(nullptr); m_startTime = m_gameTime; @@ -1751,7 +1751,7 @@ void World::SetInitialWorldSettings() // Update groups with offline leader after delay in seconds m_timers[WUPDATE_GROUPS].SetInterval(IN_MILLISECONDS); - ///- Initialize static helper structures + // Initialize static helper structures AIRegistry::Initialize(); sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading GameObject models ..."); @@ -1760,11 +1760,11 @@ void World::SetInitialWorldSettings() // loads GO data sTransportMgr.LoadTransportAnimationAndRotation(); - ///- Initialize MapManager + // Initialize MapManager sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Starting Map System"); sMapMgr.Initialize(); - ///- Initialize Battlegrounds + // Initialize Battlegrounds sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Starting BattleGround System"); sBattleGroundMgr.CreateInitialBattleGrounds(); CheckLootTemplates_Reference(ids_set); @@ -1909,14 +1909,14 @@ void World::DetectDBCLang() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); } -/// Update the World ! +// Update the World ! void World::Update(uint32 diff) { m_currentMSTime = WorldTimer::getMSTime(); m_currentTime = std::chrono::time_point_cast(Clock::now()); m_currentDiff = diff; - ///- Update the different timers + // Update the different timers for (auto& timer : m_timers) { if (timer.GetCurrent() >= 0) @@ -1925,32 +1925,32 @@ void World::Update(uint32 diff) timer.SetCurrent(0); } - ///- Update the game time and check for shutdown time + // Update the game time and check for shutdown time _UpdateGameTime(); GetMessager().Execute(this); - ///-Update mass mailer tasks if any + // Update mass mailer tasks if any sMassMailMgr.Update(); - ///
  • Handle auctions when the timer has passed + //
    • Handle auctions when the timer has passed if (m_timers[WUPDATE_AUCTIONS].Passed()) { m_timers[WUPDATE_AUCTIONS].Reset(); sAuctionHouseBotMgr.Update(); - ///- Handle expired auctions + // Handle expired auctions sAuctionMgr.Update(); } - ///
    • Handle session updates + //
    • Handle session updates uint32 updateSessionsTime = WorldTimer::getMSTime(); UpdateSessions(diff); updateSessionsTime = WorldTimer::getMSTimeDiffToNow(updateSessionsTime); if (getConfig(CONFIG_UINT32_PERFLOG_SLOW_SESSIONS_UPDATE) && updateSessionsTime > getConfig(CONFIG_UINT32_PERFLOG_SLOW_SESSIONS_UPDATE)) sLog.Out(LOG_PERFORMANCE, LOG_LVL_MINIMAL, "Update sessions: %ums", updateSessionsTime); - ///
    • Update uptime table + //
    • Update uptime table if (m_timers[WUPDATE_UPTIME].Passed()) { uint32 tmpDiff = uint32(m_gameTime - m_startTime); @@ -1961,10 +1961,10 @@ void World::Update(uint32 diff) LoginDatabase.PExecute("UPDATE `uptime` SET `uptime` = %u, `onlineplayers` = %u, `maxplayers` = %u WHERE `realmid` = %u AND `starttime` = " UI64FMTD, tmpDiff, onlineClientsNum, maxClientsNum, realmID, uint64(m_startTime)); } - ///- Update objects (maps, transport, creatures,...) + // Update objects (maps, transport, creatures,...) uint32 updateMapSystemTime = WorldTimer::getMSTime(); - //TODO: find a better place for this + // TODO: find a better place for this if (!m_updateThreads) { m_updateThreads = std::unique_ptr( new ThreadPool( @@ -1984,7 +1984,7 @@ void World::Update(uint32 diff) sGuardMgr.Update(diff); sZoneScriptMgr.Update(diff); - ///- Update groups with offline leaders + // Update groups with offline leaders if (m_timers[WUPDATE_GROUPS].Passed()) { m_timers[WUPDATE_GROUPS].Reset(); @@ -2004,7 +2004,7 @@ void World::Update(uint32 diff) if (getConfig(CONFIG_UINT32_PERFLOG_SLOW_MAPSYSTEM_UPDATE) && updateMapSystemTime > getConfig(CONFIG_UINT32_PERFLOG_SLOW_MAPSYSTEM_UPDATE)) sLog.Out(LOG_PERFORMANCE, LOG_LVL_MINIMAL, "Update map system: %ums [%ums for async]", updateMapSystemTime, WorldTimer::getMSTimeDiffToNow(asyncWaitBegin)); - ///- Sauvegarde des variables internes (table variables) : MaJ par rapport a la DB + // Sauvegarde des variables internes (table variables) : MaJ par rapport a la DB if (m_timers[WUPDATE_SAVE_VAR].Passed()) { m_timers[WUPDATE_SAVE_VAR].Reset(); @@ -2018,7 +2018,7 @@ void World::Update(uint32 diff) if (getConfig(CONFIG_UINT32_PERFLOG_SLOW_ASYNC_QUERIES) && asyncQueriesTime > getConfig(CONFIG_UINT32_PERFLOG_SLOW_ASYNC_QUERIES)) sLog.Out(LOG_PERFORMANCE, LOG_LVL_MINIMAL, "Update async queries: %ums", asyncQueriesTime); - ///- Erase old corpses + // Erase old corpses if (m_timers[WUPDATE_CORPSES].Passed()) { m_timers[WUPDATE_CORPSES].Reset(); @@ -2026,7 +2026,7 @@ void World::Update(uint32 diff) sObjectAccessor.RemoveOldCorpses(); } - ///- Process Game events when necessary + // Process Game events when necessary if (m_timers[WUPDATE_EVENTS].Passed()) { m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed @@ -2035,14 +2035,14 @@ void World::Update(uint32 diff) m_timers[WUPDATE_EVENTS].Reset(); } - ///
    - ///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" + //
+ // Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" sMapMgr.RemoveAllObjectsInRemoveList(); // update the instance reset times sMapPersistentStateMgr.Update(); - /// Maintenance checker + // Maintenance checker if (m_MaintenanceTimeChecker < diff) { sHonorMaintenancer.CheckMaintenanceDay(); @@ -2066,7 +2066,7 @@ void World::Update(uint32 diff) sTerrainMgr.Update(diff); } -/// Send a packet to all players (except self if mentioned) +// Send a packet to all players (except self if mentioned) void World::SendGlobalMessage(WorldPacket* packet, WorldSession* self, uint32 team) { for (const auto& itr : m_sessions) @@ -2168,7 +2168,7 @@ private: }; } // namespace MaNGOS -/// Send a System Message to all players (except self if mentioned) +// Send a System Message to all players (except self if mentioned) void World::SendWorldText(int32 string_id, ...) { va_list ap; @@ -2270,7 +2270,7 @@ void World::SendGMText(int32 string_id, ...) va_end(ap); } -/// DEPRICATED, only for debug purpose. Send a System Message to all players (except self if mentioned) +// DEPRICATED, only for debug purpose. Send a System Message to all players (except self if mentioned) void World::SendGlobalText(char const* text, WorldSession* self) { WorldPacket data; @@ -2288,7 +2288,7 @@ void World::SendGlobalText(char const* text, WorldSession* self) delete [] buf; } -/// Send a packet to all players (or players selected team) in the zone (except self if mentioned) +// Send a packet to all players (or players selected team) in the zone (except self if mentioned) void World::SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self, uint32 team) { for (const auto& itr : m_sessions) @@ -2309,7 +2309,7 @@ void World::SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self } } -/// Send a System Message to all players in the zone (except self if mentioned) +// Send a System Message to all players in the zone (except self if mentioned) void World::SendZoneText(uint32 zone, char const* text, WorldSession* self, uint32 team) { WorldPacket data; @@ -2317,7 +2317,7 @@ void World::SendZoneText(uint32 zone, char const* text, WorldSession* self, uint SendZoneMessage(zone, &data, self, team); } -/// Kick (and save) all players +// Kick (and save) all players void World::KickAll() { m_QueuedSessions.clear(); // prevent send queue update packet and login queued sessions @@ -2329,7 +2329,7 @@ void World::KickAll() (*itr).KickPlayer(); } -/// Kick (and save) all players with security level less `sec` +// Kick (and save) all players with security level less `sec` void World::KickAllLess(AccountTypes sec) { // session not removed at kick and will removed in next update tick @@ -2425,7 +2425,7 @@ public: return; } - ///- Disconnect all affected players (for IP it can be several) + // Disconnect all affected players (for IP it can be several) do { Field* fieldsAccount = result->Fetch(); @@ -2464,7 +2464,7 @@ public: } } banHandler; -/// Ban an account or ban an IP address, duration_secs if it is positive used, otherwise permban +// Ban an account or ban an IP address, duration_secs if it is positive used, otherwise permban BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_secs, std::string reason, std::string author) { LoginDatabase.escape_string(nameOrIP); @@ -2480,7 +2480,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_ holder->SetSize(1); DatabaseType* db = nullptr; - ///- Update the database with ban information + // Update the database with ban information switch (mode) { case BAN_IP: @@ -2516,7 +2516,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_ return BAN_INPROGRESS; } -/// Remove a ban from an account or IP address +// Remove a ban from an account or IP address bool World::RemoveBanAccount(BanMode mode, std::string const& source, std::string const& message, std::string nameOrIP) { if (mode == BAN_IP) @@ -2544,19 +2544,19 @@ bool World::RemoveBanAccount(BanMode mode, std::string const& source, std::strin return true; } -/// Update the game time +// Update the game time void World::_UpdateGameTime() { - ///- update the time + // update the time time_t thisTime = time(nullptr); uint32 elapsed = uint32(thisTime - m_gameTime); m_gameTime = thisTime; m_gameDay = (m_gameTime + m_timeZoneOffset) / DAY; - ///- if there is a shutdown timer + // if there is a shutdown timer if (!m_stopEvent && m_ShutdownTimer > 0 && elapsed > 0) { - ///- ... and it is overdue, stop the world (set m_stopEvent) + // ... and it is overdue, stop the world (set m_stopEvent) if (m_ShutdownTimer <= elapsed) { if (!(m_ShutdownMask & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0) @@ -2564,7 +2564,7 @@ void World::_UpdateGameTime() else m_ShutdownTimer = 1; // minimum timer value to wait idle state } - ///- ... else decrease it and if necessary display a shutdown countdown to the users + // ... else decrease it and if necessary display a shutdown countdown to the users else { m_ShutdownTimer -= elapsed; @@ -2574,7 +2574,7 @@ void World::_UpdateGameTime() } } -/// Shutdown the server +// Shutdown the server void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode) { // ignore if server shutdown at next tick @@ -2584,7 +2584,7 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode) m_ShutdownMask = options; m_ExitCode = exitcode; - ///- If the shutdown time is 0, set m_stopEvent (except if shutdown is 'idle' with remaining sessions) + // If the shutdown time is 0, set m_stopEvent (except if shutdown is 'idle' with remaining sessions) if (time == 0) { if (!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0) @@ -2592,7 +2592,7 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode) else m_ShutdownTimer = 1; //So that the session count is re-evaluated at next world tick } - ///- Else set the shutdown timer and warn users + // Else set the shutdown timer and warn users else { m_ShutdownTimer = time; @@ -2600,14 +2600,14 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode) } } -/// Display a shutdown message to the user(s) +// Display a shutdown message to the user(s) void World::ShutdownMsg(bool show, Player* player) { // not show messages for idle shutdown mode if (m_ShutdownMask & SHUTDOWN_MASK_IDLE) return; - ///- Display a message every 12 hours, hours, 5 minutes, minute, 5 seconds and finally seconds + // Display a message every 12 hours, hours, 5 minutes, minute, 5 seconds and finally seconds if (show || (m_ShutdownTimer < 10) || // < 30 sec; every 5 sec @@ -2630,7 +2630,7 @@ void World::ShutdownMsg(bool show, Player* player) } } -/// Cancel a planned server shutdown +// Cancel a planned server shutdown void World::ShutdownCancel() { // nothing cancel or too later @@ -2647,7 +2647,7 @@ void World::ShutdownCancel() sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shutdown")); } -/// Send a server message to the user(s) +// Send a server message to the user(s) void World::SendServerMessage(ServerMessageType type, char const* text, Player* player) { WorldPacket data(SMSG_SERVER_MESSAGE, 50); // guess size @@ -2662,7 +2662,7 @@ void World::SendServerMessage(ServerMessageType type, char const* text, Player* void World::UpdateSessions(uint32 diff) { - ///- Update player limit if needed + // Update player limit if needed int32 hardPlayerLimit = getConfig(CONFIG_UINT32_PLAYER_HARD_LIMIT); if (hardPlayerLimit) m_playerLimit = std::min(hardPlayerLimit, m_playerLimit); @@ -2693,18 +2693,18 @@ void World::UpdateSessions(uint32 diff) (*iter)->SendAuthWaitQue(position); } - ///- Add new sessions + // Add new sessions WorldSession* sess; while (addSessQueue.next(sess)) AddSession_(sess); - ///- Then send an update signal to remaining ones + // Then send an update signal to remaining ones time_t timeNow = time(nullptr); for (SessionMap::iterator itr = m_sessions.begin(), next; itr != m_sessions.end(); itr = next) { next = itr; ++next; - ///- and remove not active sessions from the list + // and remove not active sessions from the list WorldSession* pSession = itr->second; WorldSessionFilter updater(pSession); @@ -2722,7 +2722,7 @@ void World::UpdateSessions(uint32 diff) delete pSession; } } - ///- Update disconnected sessions + // Update disconnected sessions for (SessionSet::iterator itr = m_disconnectedSessions.begin(), next; itr != m_disconnectedSessions.end(); itr = next) { next = itr; diff --git a/src/game/World.h b/src/game/World.h index 3dddbd60e..8c49b8f7d 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup world The World -/// @{ -/// \file +// \addtogroup world The World +// @{ +// \file #ifndef __WORLD_H #define __WORLD_H @@ -77,7 +77,7 @@ enum ShutdownExitCode RESTART_EXIT_CODE = 2, }; -/// Timers for different object refresh rates +// Timers for different object refresh rates enum WorldTimers { WUPDATE_AUCTIONS = 0, @@ -89,7 +89,7 @@ enum WorldTimers WUPDATE_COUNT = 6 }; -/// Configuration elements +// Configuration elements enum eConfigUInt32Values { CONFIG_UINT32_COMPRESSION = 0, @@ -362,7 +362,7 @@ enum ANTICRASH_OPTION_FLAGS_THROW_SIGSEGV= (ANTICRASH_OPTION_CRASH_INSTANCES|ANTICRASH_OPTION_CRASH_CONTINENTS), }; -/// Configuration elements +// Configuration elements enum eConfigInt32Values { CONFIG_INT32_DEATH_SICKNESS_LEVEL = 0, @@ -372,7 +372,7 @@ enum eConfigInt32Values CONFIG_INT32_VALUE_COUNT }; -/// Server config +// Server config enum eConfigFloatValues { CONFIG_FLOAT_RATE_HEALTH = 0, @@ -451,7 +451,7 @@ enum eConfigFloatValues CONFIG_FLOAT_VALUE_COUNT }; -/// Configuration elements +// Configuration elements enum eConfigBoolValues { CONFIG_BOOL_GRID_UNLOAD = 0, @@ -608,7 +608,7 @@ enum eConfigBoolValues CONFIG_BOOL_VALUE_COUNT }; -/// Type of server +// Type of server enum RealmType { REALM_TYPE_NORMAL = 0, @@ -687,7 +687,7 @@ struct PlayerTransactionData TransactionPart parts[2]; }; -/// Storage class for commands issued for delayed execution +// Storage class for commands issued for delayed execution struct CliCommandHolder { typedef void Print(void*, char const*); @@ -719,7 +719,7 @@ struct AccountPlayHistory class ThreadPool; -/// The World +// The World class World { public: @@ -734,31 +734,31 @@ class World WorldSession* FindSession(uint32 id) const; void AddSession(WorldSession* s); bool RemoveSession(uint32 id); - /// Get the number of current active sessions + // Get the number of current active sessions void UpdateMaxSessionCounters(); uint32 GetActiveAndQueuedSessionCount() const { return m_sessions.size(); } uint32 GetActiveSessionCount() const { return m_sessions.size() - m_QueuedSessions.size(); } uint32 GetQueuedSessionCount() const { return m_QueuedSessions.size(); } - /// Get the maximum number of parallel sessions on the server since last reboot + // Get the maximum number of parallel sessions on the server since last reboot uint32 GetMaxQueuedSessionCount() const { return m_maxQueuedSessionCount; } uint32 GetMaxActiveSessionCount() const { return m_maxActiveSessionCount; } - /// Get the active session server limit (or security level limitations) + // Get the active session server limit (or security level limitations) uint32 GetPlayerAmountLimit() const { return m_playerLimit >= 0 ? m_playerLimit : 0; } AccountTypes GetPlayerSecurityLimit() const { return m_playerLimit <= 0 ? AccountTypes(-m_playerLimit) : SEC_PLAYER; } - /// Set the active session server limit (or security level limitation) + // Set the active session server limit (or security level limitation) void SetPlayerLimit(int32 limit, bool needUpdate = false); - //player Queue + // player Queue typedef std::list Queue; void AddQueuedSession(WorldSession*); bool RemoveQueuedSession(WorldSession* session); int32 GetQueuedSessionPos(WorldSession*); - /// Set a new Message of the Day + // Set a new Message of the Day void SetMotd(std::string const& motd) { m_motd = motd; } - /// Get the current Message of the Day + // Get the current Message of the Day char const* GetMotd() const { return m_motd.c_str(); } // Get current server's WoW Patch @@ -767,19 +767,19 @@ class World LocaleConstant GetDefaultDbcLocale() const { return m_defaultDbcLocale; } - /// Get the path where data (dbc, maps) are stored on disk + // Get the path where data (dbc, maps) are stored on disk std::string GetDataPath() const { return m_dataPath; } - /// Get the path where honor logs are stored on disk + // Get the path where honor logs are stored on disk std::string GetHonorPath() const { return m_honorPath; } - /// When server started? + // When server started? time_t const& GetStartTime() const { return m_startTime; } - /// What time is it? + // What time is it? time_t const& GetGameTime() const { return m_gameTime; } - /// What day is it? + // What day is it? uint32 const& GetGameDay() const { return m_gameDay; } - /// Uptime (in secs) + // Uptime (in secs) uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); } tm *GetLocalTimeByTime(time_t now) const { return localtime(&now); } @@ -792,7 +792,7 @@ class World return m_gameDay - ((date->tm_wday - mDay + 7) % 7); } - /// Get the maximum skill level a player can reach + // Get the maximum skill level a player can reach uint16 GetConfigMaxSkillValue() const { uint32 lvl = getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL); @@ -805,7 +805,7 @@ class World void SendWorldText(int32 string_id, ...); void SendBroadcastTextToWorld(uint32 textId); - // Only for GMs with ticket notification ON + // Only for GMs with ticket notification ON void SendGMTicketText(int32 string_id, ...); void SendGMTicketText(char const* text); void SendGMText(int32 string_id, ...); @@ -815,7 +815,7 @@ class World void SendZoneText(uint32 zone, char const* text, WorldSession* self = 0, uint32 team = 0); void SendServerMessage(ServerMessageType type, char const* text = "", Player* player = nullptr); - /// Are we in the middle of a shutdown? + // Are we in the middle of a shutdown? bool IsShutdowning() const { return m_ShutdownTimer > 0; } void ShutdownServ(uint32 time, uint32 options, uint8 exitcode); void ShutdownCancel(); @@ -828,27 +828,27 @@ class World void UpdateSessions(uint32 diff); - /// Get a server configuration element (see #eConfigFloatValues) + // Get a server configuration element (see #eConfigFloatValues) void setConfig(eConfigFloatValues index,float value) { m_configFloatValues[index]=value; } - /// Get a server configuration element (see #eConfigFloatValues) + // Get a server configuration element (see #eConfigFloatValues) float getConfig(eConfigFloatValues rate) const { return m_configFloatValues[rate]; } - /// Set a server configuration element (see #eConfigUInt32Values) + // Set a server configuration element (see #eConfigUInt32Values) void setConfig(eConfigUInt32Values index, uint32 value) { m_configUint32Values[index]=value; } - /// Get a server configuration element (see #eConfigUInt32Values) + // Get a server configuration element (see #eConfigUInt32Values) uint32 getConfig(eConfigUInt32Values index) const { return m_configUint32Values[index]; } - /// Set a server configuration element (see #eConfigInt32Values) + // Set a server configuration element (see #eConfigInt32Values) void setConfig(eConfigInt32Values index, int32 value) { m_configInt32Values[index]=value; } - /// Get a server configuration element (see #eConfigInt32Values) + // Get a server configuration element (see #eConfigInt32Values) int32 getConfig(eConfigInt32Values index) const { return m_configInt32Values[index]; } - /// Set a server configuration element (see #eConfigBoolValues) + // Set a server configuration element (see #eConfigBoolValues) void setConfig(eConfigBoolValues index, bool value) { m_configBoolValues[index]=value; } - /// Get a server configuration element (see #eConfigBoolValues) + // Get a server configuration element (see #eConfigBoolValues) bool getConfig(eConfigBoolValues index) const { return m_configBoolValues[index]; } - /// Are we on a "Player versus Player" server? + // Are we on a "Player versus Player" server? bool IsPvPRealm() { return (getConfig(CONFIG_UINT32_GAME_TYPE) == REALM_TYPE_PVP || getConfig(CONFIG_UINT32_GAME_TYPE) == REALM_TYPE_RPPVP || getConfig(CONFIG_UINT32_GAME_TYPE) == REALM_TYPE_FFA_PVP); } bool IsFFAPvPRealm() { return getConfig(CONFIG_UINT32_GAME_TYPE) == REALM_TYPE_FFA_PVP; } @@ -1053,4 +1053,4 @@ extern uint32 realmID; #define sWorld MaNGOS::Singleton::Instance() #endif -/// @} +// @} diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 84522a125..17e77b736 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -71,7 +71,7 @@ bool MapSessionFilter::Process(std::unique_ptr const& packet) static uint32 g_sessionCounter = 0; -/// WorldSession constructor +// WorldSession constructor WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, time_t mute_time, LocaleConstant locale) : m_guid(g_sessionCounter++), m_muteTime(mute_time), m_connected(true), m_disconnectTimer(0), m_who_recvd(false), m_ah_list_recvd(false), m_accountFlags(0), m_idleTime(WorldTimer::getMSTime()), _player(nullptr), m_socket(sock), m_security(sec), m_accountId(id), @@ -90,14 +90,14 @@ WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, time_ m_address = ""; } -/// WorldSession destructor +// WorldSession destructor WorldSession::~WorldSession() { - ///- unload player if not unloaded + // unload player if not unloaded if (_player) LogoutPlayer(!m_bot || sPlayerBotMgr.IsSavingAllowed()); - /// - If have unclosed socket, close it + // If have unclosed socket, close it if (m_socket) { m_socket->CloseSocket(); @@ -105,7 +105,7 @@ WorldSession::~WorldSession() m_socket = nullptr; } - ///- empty incoming packet queue + // empty incoming packet queue for (auto& i : m_recvQueue) i.clear(); @@ -115,13 +115,13 @@ WorldSession::~WorldSession() delete m_cheatData; } -/// Get the player name +// Get the player name char const* WorldSession::GetPlayerName() const { return GetPlayer() ? GetPlayer()->GetName() : ""; } -/// Send a packet to the client +// Send a packet to the client void WorldSession::SendPacket(WorldPacket const* packet) { // There is a maximum size packet. @@ -207,7 +207,7 @@ void WorldSession::SendPacket(WorldPacket const* packet) #endif // !_DEBUG - //sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "[%s]Send packet : %u|0x%x (%s)", GetPlayerName(), packet->GetOpcode(), packet->GetOpcode(), LookupOpcodeName(packet->GetOpcode())); + // sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "[%s]Send packet : %u|0x%x (%s)", GetPlayerName(), packet->GetOpcode(), packet->GetOpcode(), LookupOpcodeName(packet->GetOpcode())); if (m_sniffFile) m_sniffFile->WritePacket(*packet, false, time(nullptr)); @@ -215,7 +215,7 @@ void WorldSession::SendPacket(WorldPacket const* packet) m_socket->CloseSocket(); } -/// Add an incoming packet to the queue +// Add an incoming packet to the queue void WorldSession::QueuePacket(std::unique_ptr newPacket) { if (m_sniffFile) @@ -247,7 +247,7 @@ void WorldSession::QueuePacket(std::unique_ptr newPacket) m_recvQueue[processing].add(std::move(newPacket)); } -/// Logging helper for unexpected opcodes +// Logging helper for unexpected opcodes void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, char const* reason) { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "SESSION: received unexpected opcode %s (0x%.4X) %s", @@ -256,7 +256,7 @@ void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, char const* reason) reason); } -/// Logging helper for unexpected opcodes +// Logging helper for unexpected opcodes void WorldSession::LogUnprocessedTail(WorldPacket* packet) { sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at " SIZEFMTD " from " SIZEFMTD ")", @@ -342,14 +342,14 @@ bool WorldSession::ForcePlayerLogoutDelay() return false; } -/// Update the WorldSession (triggered by World update) +// Update the WorldSession (triggered by World update) bool WorldSession::Update(PacketFilter& updater) { uint32 sessionUpdateTime = WorldTimer::getMSTime(); for (uint32 & i : m_floodPacketsCount) i = 0; - ///- Retrieve packets from the receive queue and call the appropriate handlers + // Retrieve packets from the receive queue and call the appropriate handlers ProcessPackets(updater); if (CharacterScreenIdleKick(sessionUpdateTime)) @@ -370,7 +370,7 @@ bool WorldSession::Update(PacketFilter& updater) return false; } - ///- Cleanup socket pointer if need + // Cleanup socket pointer if need if (m_socket && m_socket->IsClosed()) { m_socket->RemoveReference(); @@ -386,7 +386,6 @@ bool WorldSession::Update(PacketFilter& updater) return ForcePlayerLogoutDelay(); } - time_t currTime = time(nullptr); if (sWorld.getConfig(CONFIG_BOOL_LIMIT_PLAY_TIME) && GetPlayer() && GetPlayer()->IsInWorld()) @@ -554,7 +553,7 @@ bool WorldSession::UpdateDisconnected(uint32 diff) return true; } -/// %Log the player out +// %Log the player out void WorldSession::LogoutPlayer(bool Save) { // finish pending transfers before starting the logout @@ -576,7 +575,7 @@ void WorldSession::LogoutPlayer(bool Save) if (inWorld) { - ///- If the player just died before logging out, make him appear as a ghost + // If the player just died before logging out, make him appear as a ghost if (_player->GetDeathTimer()) { _player->GetHostileRefManager().deleteReferences(); @@ -609,7 +608,7 @@ void WorldSession::LogoutPlayer(bool Save) queue->RemovePlayerFromQueue(playerGuid, PLAYER_SYSTEM_LEAVE); }); - ///- Teleport to home if the player is in an invalid instance + // Teleport to home if the player is in an invalid instance if (!_player->m_InstanceValid && !_player->IsGameMaster()) { _player->TeleportToHomebind(); @@ -652,7 +651,7 @@ void WorldSession::LogoutPlayer(bool Save) sBattleGroundMgr.PlayerLoggedOut(_player); - ///- Reset the online field in the account table + // Reset the online field in the account table // no point resetting online in character table here as Player::SaveToDB() will set it to 1 since player has not been removed from world at this stage // No SQL injection as AccountID is uint32 static SqlStatementID id; @@ -660,7 +659,7 @@ void WorldSession::LogoutPlayer(bool Save) SqlStatement stmt = LoginDatabase.CreateStatement(id, "UPDATE `account` SET `current_realm` = ?, `online` = 0 WHERE `id` = ?"); stmt.PExecute(uint32(0), GetAccountId()); - ///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members + // If the player is in a guild, update the guild roster and broadcast a logout message to other guild members if (Guild* guild = sGuildMgr.GetGuildById(_player->GetGuildId())) { if (MemberSlot* slot = guild->GetMemberSlot(_player->GetObjectGuid())) @@ -672,7 +671,7 @@ void WorldSession::LogoutPlayer(bool Save) guild->BroadcastEvent(GE_SIGNED_OFF, _player->GetObjectGuid(), _player->GetName()); } - ///- Remove pet + // Remove pet _player->RemovePet(PET_SAVE_AS_CURRENT); // Dungeon anti-exploit. Should be before save @@ -691,15 +690,15 @@ void WorldSession::LogoutPlayer(bool Save) } } - ///- empty buyback items and save the player in the database + // empty buyback items and save the player in the database // some save parts only correctly work in case player present in map/player_lists (pets, etc) if (Save) _player->SaveToDB(false, removedFromMap); - ///- Leave all channels before player delete... + // Leave all channels before player delete... _player->CleanupChannels(); - ///- If the player is in a group (or invited), remove him. If the group if then only 1 person, disband the group. + // If the player is in a group (or invited), remove him. If the group if then only 1 person, disband the group. _player->UninviteFromGroup(); // remove player from the group if he is: @@ -707,17 +706,17 @@ void WorldSession::LogoutPlayer(bool Save) if (_player->GetGroup() && !_player->GetGroup()->isRaidGroup() && m_socket) _player->RemoveFromGroup(); - ///- Send update to group + // Send update to group if (Group* group = _player->GetGroup()) group->UpdatePlayerOnlineStatus(_player, false); - ///- Update cached data at logout + // Update cached data at logout sObjectMgr.UpdatePlayerCache(_player); - ///- No need to create any new maps + // No need to create any new maps sMapMgr.CancelInstanceCreationForPlayer(_player); - ///- Remove the player from the world + // Remove the player from the world // the player may not be in the world when logging out // e.g if he got disconnected during a transfer to another map // calls to GetMap in this case may cause crashes @@ -735,7 +734,7 @@ void WorldSession::LogoutPlayer(bool Save) SetPlayer(nullptr); // deleted in Remove/DeleteFromWorld call - ///- Send the 'logout complete' packet to the client + // Send the 'logout complete' packet to the client WorldPacket data(SMSG_LOGOUT_COMPLETE, 0); SendPacket(&data); @@ -744,7 +743,7 @@ void WorldSession::LogoutPlayer(bool Save) if (m_masterPlayer) { - ///- Broadcast a logout message to the player's friends + // Broadcast a logout message to the player's friends if (m_masterPlayer->GetSocial()) { sSocialMgr.SendFriendStatus(m_masterPlayer, FRIEND_OFFLINE, m_masterPlayer->GetObjectGuid(), true); @@ -763,7 +762,7 @@ void WorldSession::LogoutPlayer(bool Save) LogoutRequest(0); } -/// Kick a player out of the World +// Kick a player out of the World void WorldSession::KickPlayer() { if (m_socket) @@ -772,7 +771,7 @@ void WorldSession::KickPlayer() m_bot->requestRemoval = true; } -/// Cancel channeling handler +// Cancel channeling handler void WorldSession::SendAreaTriggerMessage(char const* Text, ...) { diff --git a/src/mangosd/ChatSocket.cpp b/src/mangosd/ChatSocket.cpp index 916aed746..84977e422 100644 --- a/src/mangosd/ChatSocket.cpp +++ b/src/mangosd/ChatSocket.cpp @@ -54,7 +54,7 @@ protected: std::stringstream& m_buff; }; -/// OfflineChatSocket constructor +// OfflineChatSocket constructor OfflineChatSocket::OfflineChatSocket() : OfflineChatHandler(), pendingCommands(0, USYNC_THREAD, "pendingCommands"), outActive(false), @@ -65,13 +65,13 @@ OfflineChatSocket::OfflineChatSocket() : OfflineChatHandler(), reference_counting_policy ().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED); } -/// OfflineChatSocket destructor +// OfflineChatSocket destructor OfflineChatSocket::~OfflineChatSocket() { peer().close(); } -/// Accept an incoming connection +// Accept an incoming connection int OfflineChatSocket::open(void* ) { if (reactor ()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1) @@ -149,7 +149,7 @@ int OfflineChatSocket::handle_output (ACE_HANDLE) return 0; } -/// Read data from the network +// Read data from the network std::string TrimLeft(const std::string& s) { size_t startpos = s.find_first_not_of(' '); @@ -174,7 +174,7 @@ int OfflineChatSocket::handle_input(ACE_HANDLE) } DEBUG_OUT_CHAT("OfflineChatSocket::handle_input %i bytes read", readBytes); - ///- Discard data after line break or line feed + // Discard data after line break or line feed bool endofpacket = false; for (; readBytes > 0 ; --readBytes) { @@ -331,7 +331,7 @@ int OfflineChatSocket::handle_input(ACE_HANDLE) return 0; } -/// Output function +// Output function int OfflineChatSocket::sendf(const char* msg) { std::unique_lock lock (outBufferLock); diff --git a/src/mangosd/ChatSocket.h b/src/mangosd/ChatSocket.h index 2c11417ec..7c17d26d4 100644 --- a/src/mangosd/ChatSocket.h +++ b/src/mangosd/ChatSocket.h @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup mangosd -/// @{ -/// \file +// \addtogroup mangosd +// @{ +// \file #ifndef _OFFLINE_CHAT_SOCKET_H #define _OFFLINE_CHAT_SOCKET_H @@ -41,7 +41,7 @@ enum OfflineChatSpecialCommands OFFLINE_CHAT_GM_COMMAND = -1, }; -/// Remote Administration socket +// Remote Administration socket typedef ACE_Svc_Handler < ACE_SOCK_STREAM, ACE_NULL_SYNCH> OfflineChatHandler; class OfflineChatSocket: protected OfflineChatHandler { @@ -53,23 +53,23 @@ class OfflineChatSocket: protected OfflineChatHandler int sendf(const char*); protected: - /// things called by ACE framework. + // things called by ACE framework. OfflineChatSocket(void); virtual ~OfflineChatSocket(void); - /// Called on open ,the void* is the acceptor. + // Called on open ,the void* is the acceptor. virtual int open (void *); - /// Called on failures inside of the acceptor, don't call from your code. + // Called on failures inside of the acceptor, don't call from your code. virtual int close (int); - /// Called when we can read from the socket. + // Called when we can read from the socket. virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE); - /// Called when the socket can write. + // Called when the socket can write. virtual int handle_output (ACE_HANDLE = ACE_INVALID_HANDLE); - /// Called when connection is closed or error happens. + // Called when connection is closed or error happens. virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); @@ -93,4 +93,4 @@ class OfflineChatSocket: protected OfflineChatHandler }stage; }; #endif -/// @} +// @} diff --git a/src/mangosd/CliRunnable.cpp b/src/mangosd/CliRunnable.cpp index 8a9f4c512..0a83cddd5 100644 --- a/src/mangosd/CliRunnable.cpp +++ b/src/mangosd/CliRunnable.cpp @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup mangosd -/// @{ -/// \file +// \addtogroup mangosd +// @{ +// \file #include "Common.h" #include "World.h" @@ -59,7 +59,7 @@ void commandFinished(void*, bool /*sucess*/) fflush(stdout); } -/// @} +// @} #ifdef linux // Non-blocking keypress detector, when return pressed, return 1, else always return 0 @@ -76,15 +76,15 @@ int kb_hit_return() } #endif -/// %Thread start +// %Thread start void CliRunnable::operator()() { - ///- Init new SQL thread for the world database (one connection call enough) + // Init new SQL thread for the world database (one connection call enough) WorldDatabase.ThreadStart(); // let thread do safe mySQL requests char commandbuf[256]; - ///- Display the list of available CLI functions then beep + // Display the list of available CLI functions then beep if (sConfig.GetBoolDefault("BeepAtStart", true)) printf("\a"); // \a = Alert @@ -92,7 +92,7 @@ void CliRunnable::operator()() // later it will be printed after command queue updates printf("\nmangos>"); - ///- As long as the World is running (no World::m_stopEvent), get the command line and handle it + // As long as the World is running (no World::m_stopEvent), get the command line and handle it while (!World::IsStopped()) { fflush(stdout); @@ -159,6 +159,6 @@ void CliRunnable::operator()() } } - ///- End the database thread + // End the database thread WorldDatabase.ThreadEnd(); // free mySQL thread resources } diff --git a/src/mangosd/CliRunnable.h b/src/mangosd/CliRunnable.h index bc83aa45e..2f4108684 100644 --- a/src/mangosd/CliRunnable.h +++ b/src/mangosd/CliRunnable.h @@ -19,20 +19,20 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup mangosd -/// @{ -/// \file +// \addtogroup mangosd +// @{ +// \file #ifndef __CLIRUNNABLE_H #define __CLIRUNNABLE_H #include "Common.h" -/// Command Line Interface handling thread +// Command Line Interface handling thread class CliRunnable { public: void operator()(); }; #endif -/// @} +// @} diff --git a/src/mangosd/Main.cpp b/src/mangosd/Main.cpp index d65bfb3ce..4e3ac3c2c 100644 --- a/src/mangosd/Main.cpp +++ b/src/mangosd/Main.cpp @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup mangosd Mangos Daemon -/// @{ -/// \file +// \addtogroup mangosd Mangos Daemon +// @{ +// \file #include "Common.h" #include "Database/DatabaseEnv.h" @@ -52,14 +52,14 @@ int m_ServiceStatus = -1; #include "PosixDaemon.h" #endif -DatabaseType WorldDatabase; ///< Accessor to the world database -DatabaseType CharacterDatabase; ///< Accessor to the character database -DatabaseType LoginDatabase; ///< Accessor to the realm/login database -DatabaseType LogsDatabase; ///< Accessor to the logs database +DatabaseType WorldDatabase; // Accessor to the world database +DatabaseType CharacterDatabase; // Accessor to the character database +DatabaseType LoginDatabase; // Accessor to the realm/login database +DatabaseType LogsDatabase; // Accessor to the logs database -uint32 realmID; ///< Id of the realm +uint32 realmID; // Id of the realm -/// Print out the usage string for this program on the console. +// Print out the usage string for this program on the console. void usage(const char *prog) { sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Usage: \n %s []\n" @@ -80,10 +80,10 @@ void usage(const char *prog) char const* g_mainLogFileName = "Server.log"; -/// Launch the mangos server +// Launch the mangos server extern int main(int argc, char **argv) { - ///- Command line parsing + // Command line parsing char const* cfg_file = _MANGOSD_CONFIG; @@ -210,11 +210,11 @@ extern int main(int argc, char **argv) sLog.Out(LOG_BASIC, LOG_LVL_DETAIL, "Using ACE: %s", ACE_VERSION); - ///- Set progress bars show mode + // Set progress bars show mode BarGoLink::SetOutputState(sConfig.GetBoolDefault("ShowProgressBars", true)); - ///- and run the 'Master' - /// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? + // and run the 'Master' + // TODO: Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? return sMaster.Run(); // at sMaster return function exist with codes @@ -223,4 +223,4 @@ extern int main(int argc, char **argv) // 2 - restart command used, this code can be used by restarter for restart mangosd } -/// @} +// @} diff --git a/src/mangosd/Master.cpp b/src/mangosd/Master.cpp index 77c18ae15..e8afdebc6 100644 --- a/src/mangosd/Master.cpp +++ b/src/mangosd/Master.cpp @@ -203,10 +203,10 @@ Master::~Master() { } -/// Main function +// Main function int Master::Run() { - /// worldd PID file creation + // worldd PID file creation std::string pidfile = sConfig.GetStringDefault("PidFile", ""); if(!pidfile.empty()) { @@ -221,32 +221,32 @@ int Master::Run() sLog.Out(LOG_BASIC, LOG_LVL_BASIC, "Daemon PID: %u\n", pid ); } - ///- Start the databases + // Start the databases if (!_StartDB()) { Log::WaitBeforeContinueIfNeed(); return 1; } - ///- Initialize the World + // Initialize the World sWorld.SetInitialWorldSettings(); #ifndef WIN32 detachDaemon(); #endif - //server loaded successfully => enable async DB requests - //this is done to forbid any async transactions during server startup! + // server loaded successfully => enable async DB requests + // this is done to forbid any async transactions during server startup! CharacterDatabase.AllowAsyncTransactions(); WorldDatabase.AllowAsyncTransactions(); LoginDatabase.AllowAsyncTransactions(); LogsDatabase.AllowAsyncTransactions(); - ///- Catch termination signals + // Catch termination signals _HookSignals(); - ///- Launch WorldRunnable thread + // Launch WorldRunnable thread std::thread world_thread{WorldRunnable()}; - // world_thread.setPriority(ACE_Based::Highest); + // world_thread.setPriority(ACE_Based::Highest); // set realmbuilds depend on mangosd expected builds, and set server online { @@ -264,7 +264,7 @@ int Master::Run() if (sConfig.GetBoolDefault("Console.Enable", true)) #endif { - ///- Launch CliRunnable thread + // Launch CliRunnable thread cliThread = new std::thread(CliRunnable()); } @@ -275,7 +275,7 @@ int Master::Run() if (sConfig.GetBoolDefault ("OfflineChat.Enable", false)) offlinechat_thread = new std::thread(&offlineChat); - ///- Handle affinity for multiple processors and process priority on Windows + // Handle affinity for multiple processors and process priority on Windows #ifdef WIN32 { HANDLE hProcess = GetCurrentProcess(); @@ -307,7 +307,7 @@ int Master::Run() bool Prio = sConfig.GetBoolDefault("ProcessPriority", false); -// if(Prio && (m_ServiceStatus == -1)/* need set to default process priority class in service mode*/) + // if(Prio && (m_ServiceStatus == -1)/* need set to default process priority class in service mode*/) if(Prio) { if(SetPriorityClass(hProcess,HIGH_PRIORITY_CLASS)) @@ -318,7 +318,7 @@ int Master::Run() } #endif - ///- Start soap serving thread + // Start soap serving thread std::thread* soap_thread = nullptr; if(sConfig.GetBoolDefault("SOAP.Enabled", false)) @@ -330,7 +330,7 @@ int Master::Run() }); } - ///- Start up freeze catcher thread + // Start up freeze catcher thread std::thread* freeze_thread = nullptr; if(uint32 freeze_delay = sConfig.GetIntDefault("MaxCoreStuckTime", 0)) { @@ -339,7 +339,7 @@ int Master::Run() } // Wait for clients ? - ///- Launch the world listener socket + // Launch the world listener socket uint16 wsport = sWorld.getConfig(CONFIG_UINT32_PORT_WORLD); std::string bind_ip = sConfig.GetStringDefault("BindIP", "0.0.0.0"); @@ -359,24 +359,24 @@ int Master::Run() } sWorldSocketMgr->Wait(); - ///- Stop freeze protection before shutdown tasks + // Stop freeze protection before shutdown tasks if (freeze_thread) { freeze_thread->join(); delete freeze_thread; } - ///- Stop soap thread + // Stop soap thread if(soap_thread) { soap_thread->join(); delete soap_thread; } - ///- Set server offline in realmlist + // Set server offline in realmlist //LoginDatabase.DirectPExecute("UPDATE realmlist SET realmflags = realmflags | %u WHERE id = '%u'", REALM_FLAG_OFFLINE, realmID); - ///- Remove signal handling before leaving + // Remove signal handling before leaving _UnhookSignals(); // when the main thread closes the singletons get unloaded @@ -395,7 +395,7 @@ int Master::Run() delete offlinechat_thread; } - ///- Clean account database before leaving + // Clean account database before leaving sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Cleaning character database..."); clearOnlineAccounts(); @@ -403,7 +403,7 @@ int Master::Run() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Sending queued mail..."); sMassMailMgr.Update(true); - ///- Wait for DB delay threads to end + // Wait for DB delay threads to end sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Closing database connections..."); CharacterDatabase.StopServer(); WorldDatabase.StopServer(); @@ -459,13 +459,13 @@ int Master::Run() delete cliThread; } - ///- Exit the process with specified return value + // Exit the process with specified return value return World::GetExitCode(); } bool StartDB(std::string name, DatabaseType& database, const char **migrations) { - ///- Get database info from configuration file + // Get database info from configuration file std::string dbstring = sConfig.GetStringDefault((name + "Database.Info").c_str(), ""); int nConnections = sConfig.GetIntDefault((name + "Database.Connections").c_str(), 1); int nAsyncConnections = sConfig.GetIntDefault((name + "Database.WorkerThreads").c_str(), 1); @@ -510,7 +510,7 @@ bool StartDB(std::string name, DatabaseType& database, const char **migrations) sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "%s Database: %s, sync threads: %i, workers: %i", name.c_str(), dbStringLog.c_str(), nConnections, nAsyncConnections); - ///- Initialise the world database + // Initialise the world database if (!database.Initialize(dbstring.c_str(), nConnections, nAsyncConnections)) { sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "Cannot connect to world database %s", name.c_str()); @@ -519,10 +519,10 @@ bool StartDB(std::string name, DatabaseType& database, const char **migrations) return database.CheckRequiredMigrations(migrations); } -/// Initialize connection to the databases +// Initialize connection to the databases bool Master::_StartDB() { - ///- Get the realm Id from the configuration file + // Get the realm Id from the configuration file realmID = sConfig.GetIntDefault("RealmID", 0); if(!realmID) { @@ -544,18 +544,18 @@ bool Master::_StartDB() sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Realm running as realm ID %d", realmID); - ///- Clean the database before starting + // Clean the database before starting clearOnlineAccounts(); sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, ""); return true; } -/// Clear 'online' status for all accounts with characters in this realm +// Clear 'online' status for all accounts with characters in this realm void Master::clearOnlineAccounts() { // Cleanup online status for characters hosted at current realm - /// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'? + // TODO: Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'? LoginDatabase.PExecute("UPDATE `account` SET `current_realm` = 0 WHERE `current_realm` = '%u'", realmID); CharacterDatabase.Execute("UPDATE `characters` SET `online` = 0 WHERE `online`<>0"); @@ -576,7 +576,7 @@ void createdump(void) #endif } -/// Handle termination signals +// Handle termination signals void Master::SigvSignalHandler() { if (m_handleSigvSignals) @@ -648,7 +648,7 @@ void Master::ArmAnticrash() m_handleSigvSignals = true; } -/// Unhook the signals before leaving +// Unhook the signals before leaving void Master::_UnhookSignals() { signal(SIGINT, 0); diff --git a/src/mangosd/Master.h b/src/mangosd/Master.h index 43858da14..c2f29b82c 100644 --- a/src/mangosd/Master.h +++ b/src/mangosd/Master.h @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup mangosd -/// @{ -/// \file +// \addtogroup mangosd +// @{ +// \file #ifndef _MASTER_H #define _MASTER_H @@ -29,7 +29,7 @@ #include "Common.h" #include "Policies/Singleton.h" -/// Start the server +// Start the server class Master { public: @@ -53,4 +53,4 @@ class Master #define sMaster MaNGOS::Singleton::Instance() #endif -/// @} +// @} diff --git a/src/mangosd/RASocket.cpp b/src/mangosd/RASocket.cpp index bbc7bf6c4..75fe8abbd 100644 --- a/src/mangosd/RASocket.cpp +++ b/src/mangosd/RASocket.cpp @@ -34,7 +34,7 @@ #include "Language.h" #include "ObjectMgr.h" -/// RASocket constructor +// RASocket constructor RASocket::RASocket() :RAHandler(), pendingCommands(0, USYNC_THREAD, "pendingCommands"), @@ -43,21 +43,21 @@ inputBufferLen(0), outputBufferLen(0), stage(NONE) { - ///- Get the config parameters + // Get the config parameters bSecure = sConfig.GetBoolDefault( "RA.Secure", true ); bStricted = sConfig.GetBoolDefault( "RA.Stricted", false ); iMinLevel = AccountTypes(sConfig.GetIntDefault( "RA.MinLevel", SEC_ADMINISTRATOR )); reference_counting_policy ().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED); } -/// RASocket destructor +// RASocket destructor RASocket::~RASocket() { peer().close(); sLog.Out(LOG_RA, LOG_LVL_MINIMAL, "Connection was closed."); } -/// Accept an incoming connection +// Accept an incoming connection int RASocket::open(void* ) { if (reactor ()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1) @@ -77,7 +77,7 @@ int RASocket::open(void* ) sLog.Out(LOG_RA, LOG_LVL_BASIC, "Incoming connection from %s.",remote_addr.get_host_addr()); - ///- print Motd + // print Motd sendf(sWorld.GetMotd()); sendf("\r\n"); sendf(sObjectMgr.GetMangosStringForDBCLocale(LANG_RA_USER)); @@ -146,7 +146,7 @@ int RASocket::handle_output (ACE_HANDLE) return 0; } -/// Read data from the network +// Read data from the network int RASocket::handle_input(ACE_HANDLE) { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "RASocket::handle_input"); @@ -164,7 +164,7 @@ int RASocket::handle_input(ACE_HANDLE) return -1; } - ///- Discard data after line break or line feed + // Discard data after line break or line feed bool gotenter=false; for(; readBytes > 0 ; --readBytes) { @@ -183,14 +183,14 @@ int RASocket::handle_input(ACE_HANDLE) inputBufferLen=0; switch(stage) { - ///
  • If the input is '' + //
    • If the input is '' case NONE: { std::string szLogin=inputBuffer; accId = sAccountMgr.GetId(szLogin); - ///- If the user is not found, deny access + // If the user is not found, deny access if(!accId) { sendf("-No such user.\r\n"); @@ -207,7 +207,7 @@ int RASocket::handle_input(ACE_HANDLE) accAccessLevel = sAccountMgr.GetSecurity(accId); - ///- if gmlevel is too low, deny access + // - if gmlevel is too low, deny access if (accAccessLevel < iMinLevel) { sendf("-Not enough privileges.\r\n"); @@ -222,7 +222,7 @@ int RASocket::handle_input(ACE_HANDLE) break; } - ///- allow by remotely connected admin use console level commands dependent from config setting + // - allow by remotely connected admin use console level commands dependent from config setting if (accAccessLevel >= SEC_ADMINISTRATOR && !bStricted) accAccessLevel = SEC_CONSOLE; @@ -230,7 +230,7 @@ int RASocket::handle_input(ACE_HANDLE) sendf(sObjectMgr.GetMangosStringForDBCLocale(LANG_RA_PASS)); break; } - ///
    • If the input is '' (and the user already gave his username) + //
    • If the input is '' (and the user already gave his username) case LG: { //login+pass ok std::string pw = inputBuffer; @@ -245,7 +245,7 @@ int RASocket::handle_input(ACE_HANDLE) } else { - ///- Else deny access + // Else deny access sendf("-Wrong pass.\r\n"); sLog.Out(LOG_RA, LOG_LVL_BASIC, "User account %u has failed to log in.", accId); if(bSecure) @@ -258,7 +258,7 @@ int RASocket::handle_input(ACE_HANDLE) } break; } - ///
    • If user is logged, parse and execute the command + //
    • If user is logged, parse and execute the command case OK: if (strlen(inputBuffer)) { @@ -275,7 +275,7 @@ int RASocket::handle_input(ACE_HANDLE) else sendf("mangos>"); break; - ///
    + //
}; } @@ -283,7 +283,7 @@ int RASocket::handle_input(ACE_HANDLE) return 0; } -/// Output function +// Output function void RASocket::zprint(void* callbackArg, const char * szText ) { if( !szText ) diff --git a/src/mangosd/RASocket.h b/src/mangosd/RASocket.h index 34f79292b..799fb59c4 100644 --- a/src/mangosd/RASocket.h +++ b/src/mangosd/RASocket.h @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup mangosd -/// @{ -/// \file +// \addtogroup mangosd +// @{ +// \file #ifndef _RASOCKET_H #define _RASOCKET_H @@ -36,7 +36,7 @@ #define RA_BUFF_SIZE 8192 -/// Remote Administration socket +// Remote Administration socket typedef ACE_Svc_Handler < ACE_SOCK_STREAM, ACE_NULL_SYNCH> RAHandler; class RASocket: protected RAHandler { @@ -48,23 +48,23 @@ class RASocket: protected RAHandler int sendf(const char*); protected: - /// things called by ACE framework. + // things called by ACE framework. RASocket(void); virtual ~RASocket(void); - /// Called on open ,the void* is the acceptor. + // Called on open ,the void* is the acceptor. virtual int open (void *); - /// Called on failures inside of the acceptor, don't call from your code. + // Called on failures inside of the acceptor, don't call from your code. virtual int close (int); - /// Called when we can read from the socket. + // Called when we can read from the socket. virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE); - /// Called when the socket can write. + // Called when the socket can write. virtual int handle_output (ACE_HANDLE = ACE_INVALID_HANDLE); - /// Called when connection is closed or error happens. + // Called when connection is closed or error happens. virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); @@ -80,19 +80,19 @@ class RASocket: protected RAHandler uint32 accId; AccountTypes accAccessLevel; - bool bSecure; //kick on wrong pass, non exist. user OR user with no priv - //will protect from DOS, bruteforce attacks + bool bSecure; // kick on wrong pass, non exist. user OR user with no priv + // will protect from DOS, bruteforce attacks bool bStricted; // not allow execute console only commands (SEC_CONSOLE) remotly AccountTypes iMinLevel; enum { - NONE, //initial value - LG, //only login was entered - OK, //both login and pass were given, they were correct and user has enough priv. + NONE, // initial value + LG, // only login was entered + OK, // both login and pass were given, they were correct and user has enough priv. }stage; static void zprint(void* callbackArg, const char * szText ); static void commandFinished(void* callbackArg, bool success); }; #endif -/// @} +// @} diff --git a/src/mangosd/WorldRunnable.h b/src/mangosd/WorldRunnable.h index a69067d4e..48b147fb0 100644 --- a/src/mangosd/WorldRunnable.h +++ b/src/mangosd/WorldRunnable.h @@ -19,20 +19,20 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup mangosd -/// @{ -/// \file +// \addtogroup mangosd +// @{ +// \file #ifndef __WORLDRUNNABLE_H #define __WORLDRUNNABLE_H #include "Common.h" -/// Heartbeat thread for the World +// Heartbeat thread for the World class WorldRunnable { public: void operator()(); }; #endif -/// @} +// @} diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 6a4ce0aae..3d8742a4d 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -60,36 +60,36 @@ enum eAuthSrvCmd enum AuthResult { WOW_SUCCESS = 0x00, - WOW_FAIL_UNKNOWN0 = 0x01, ///< ? Unable to connect - WOW_FAIL_UNKNOWN1 = 0x02, ///< ? Unable to connect - WOW_FAIL_BANNED = 0x03, ///< This account has been closed and is no longer available for use. Please go to /banned.html for further information. - WOW_FAIL_UNKNOWN_ACCOUNT = 0x04, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see for more information - WOW_FAIL_INCORRECT_PASSWORD = 0x05, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see for more information - // client reject next login attempts after this error, so in code used WOW_FAIL_UNKNOWN_ACCOUNT for both cases - WOW_FAIL_ALREADY_ONLINE = 0x06, ///< This account is already logged into . Please check the spelling and try again. - WOW_FAIL_NO_TIME = 0x07, ///< You have used up your prepaid time for this account. Please purchase more to continue playing - WOW_FAIL_DB_BUSY = 0x08, ///< Could not log in to at this time. Please try again later. - WOW_FAIL_VERSION_INVALID = 0x09, ///< Unable to validate game version. This may be caused by file corruption or interference of another program. Please visit for more information and possible solutions to this issue. - WOW_FAIL_VERSION_UPDATE = 0x0A, ///< Downloading - WOW_FAIL_INVALID_SERVER = 0x0B, ///< Unable to connect - WOW_FAIL_SUSPENDED = 0x0C, ///< This account has been temporarily suspended. Please go to /banned.html for further information - WOW_FAIL_FAIL_NOACCESS = 0x0D, ///< Unable to connect - WOW_SUCCESS_SURVEY = 0x0E, ///< Connected. - WOW_FAIL_PARENTCONTROL = 0x0F, ///< Access to this account has been blocked by parental controls. Your settings may be changed in your account preferences at + WOW_FAIL_UNKNOWN0 = 0x01, // Unknown0 - Unable to connect + WOW_FAIL_UNKNOWN1 = 0x02, // Unknown1 - Unable to connect + WOW_FAIL_BANNED = 0x03, // This account has been closed and is no longer available for use. Please go to /banned.html for further information. + WOW_FAIL_UNKNOWN_ACCOUNT = 0x04, // The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see for more information + WOW_FAIL_INCORRECT_PASSWORD = 0x05, // The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see for more information + // Client reject next login attempts after this error, so in code used WOW_FAIL_UNKNOWN_ACCOUNT for both cases + WOW_FAIL_ALREADY_ONLINE = 0x06, // This account is already logged into . Please check the spelling and try again. + WOW_FAIL_NO_TIME = 0x07, // You have used up your prepaid time for this account. Please purchase more to continue playing + WOW_FAIL_DB_BUSY = 0x08, // Could not log in to at this time. Please try again later. + WOW_FAIL_VERSION_INVALID = 0x09, // Unable to validate game version. This may be caused by file corruption or interference of another program. Please visit for more information and possible solutions to this issue. + WOW_FAIL_VERSION_UPDATE = 0x0A, // Downloading + WOW_FAIL_INVALID_SERVER = 0x0B, // Unable to connect + WOW_FAIL_SUSPENDED = 0x0C, // This account has been temporarily suspended. Please go to /banned.html for further information + WOW_FAIL_FAIL_NOACCESS = 0x0D, // Unable to connect + WOW_SUCCESS_SURVEY = 0x0E, // Connected. + WOW_FAIL_PARENTCONTROL = 0x0F, // Access to this account has been blocked by parental controls. Your settings may be changed in your account preferences at // TBC+ - WOW_FAIL_LOCKED_ENFORCED = 0x10, ///< You have applied a lock to your account. You can change your locked status by calling your account lock phone number. + WOW_FAIL_LOCKED_ENFORCED = 0x10, // You have applied a lock to your account. You can change your locked status by calling your account lock phone number. // WOTLK+ - WOW_FAIL_TRIAL_ENDED = 0x11, ///< Your trial subscription has expired. Please visit to upgrade your account. - WOW_FAIL_USE_BATTLENET = 0x12, ///< This account is now attached to a Battle.net account. Please login with your Battle.net account email address and password. - WOW_FAIL_ANTI_INDULGENCE = 0x13, ///< Unable to connect - WOW_FAIL_EXPIRED = 0x14, ///< Unable to connect - WOW_FAIL_NO_GAME_ACCOUNT = 0x15, ///< Unable to connect - WOW_FAIL_CHARGEBACK = 0x16, ///< This World of Warcraft account has been temporary closed due to a chargeback on its subscription. Please refer to this for further information. - WOW_FAIL_IGR_WITHOUT_BNET = 0x17, ///< In order to log in to World of Warcraft using IGR time, this World of Warcraft account must first be merged with a Battle.net account. Please visit to merge this account. - WOW_FAIL_GAME_ACCOUNT_LOCKED = 0x18, ///< Access to your account has been temporarily disabled. - WOW_FAIL_UNLOCKABLE_LOCK = 0x19, ///< Your account has been locked but can be unlocked. - WOW_FAIL_CONVERSION_REQUIRED = 0x20, ///< This account needs to be converted to a Battle.net account. Please [Click Here] or go to: to begin conversion. - WOW_FAIL_DISCONNECTED = 0xFF + WOW_FAIL_TRIAL_ENDED = 0x11, // Your trial subscription has expired. Please visit to upgrade your account. + WOW_FAIL_USE_BATTLENET = 0x12, // This account is now attached to a Battle.net account. Please login with your Battle.net account email address and password. + WOW_FAIL_ANTI_INDULGENCE = 0x13, // Unable to connect + WOW_FAIL_EXPIRED = 0x14, // Unable to connect + WOW_FAIL_NO_GAME_ACCOUNT = 0x15, // Unable to connect + WOW_FAIL_CHARGEBACK = 0x16, // This World of Warcraft account has been temporary closed due to a chargeback on its subscription. Please refer to this for further information. + WOW_FAIL_IGR_WITHOUT_BNET = 0x17, // In order to log in to World of Warcraft using IGR time, this World of Warcraft account must first be merged with a Battle.net account. Please visit to merge this account. + WOW_FAIL_GAME_ACCOUNT_LOCKED = 0x18, // Access to your account has been temporarily disabled. + WOW_FAIL_UNLOCKABLE_LOCK = 0x19, // Your account has been locked but can be unlocked. + WOW_FAIL_CONVERSION_REQUIRED = 0x20, // This account needs to be converted to a Battle.net account. Please [Click Here] or go to: to begin conversion. + WOW_FAIL_DISCONNECTED = 0xFF // Disconnected }; #endif diff --git a/src/realmd/AuthSocket.cpp b/src/realmd/AuthSocket.cpp index 89105df73..92dc83dec 100644 --- a/src/realmd/AuthSocket.cpp +++ b/src/realmd/AuthSocket.cpp @@ -183,7 +183,7 @@ typedef struct AuthHandler std::array VersionChallenge = { { 0xBA, 0xA3, 0x1E, 0x99, 0xA0, 0x0B, 0x21, 0x57, 0xFC, 0x37, 0x3F, 0xB3, 0x69, 0xCD, 0xD2, 0xF1 } }; -/// Close patch file descriptor before leaving +// Close patch file descriptor before leaving AuthSocket::~AuthSocket() { if(m_patch != ACE_INVALID_HANDLE) @@ -198,13 +198,13 @@ AccountTypes AuthSocket::GetSecurityOn(uint32 realmId) const return it->second; } -/// Accept the connection and set the s random value for SRP6 +// Accept the connection and set the s random value for SRP6 void AuthSocket::OnAccept() { sLog.Out(LOG_BASIC, LOG_LVL_BASIC, "Accepting connection from '%s'", get_remote_address().c_str()); } -/// Read the packet from the client +// Read the packet from the client void AuthSocket::OnRead() { // benchmarking has demonstrated that this lookup method is faster than std::map @@ -228,7 +228,7 @@ void AuthSocket::OnRead() size_t i; - ///- Circle through known commands and call the correct command handler + // Circle through known commands and call the correct command handler for (i = 0; i < AUTH_TOTAL_COMMANDS; ++i) { if (table[i].cmd != _cmd) @@ -255,7 +255,7 @@ void AuthSocket::OnRead() break; } - ///- Report unknown commands in the debug log + // Report unknown commands in the debug log if (i == AUTH_TOTAL_COMMANDS) { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "[Auth] got unknown packet %u", (uint32)_cmd); @@ -301,14 +301,14 @@ void AuthSocket::SendProof(Sha1Hash sha) } } -/// Logon Challenge command handler +// Logon Challenge command handler bool AuthSocket::_HandleLogonChallenge() { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Entering _HandleLogonChallenge"); if (recv_len() < sizeof(sAuthLogonChallenge_C)) return false; - ///- Read the first 4 bytes (header) to get the length of the remaining of the packet + // Read the first 4 bytes (header) to get the length of the remaining of the packet std::vector buf; buf.resize(4); @@ -321,15 +321,15 @@ bool AuthSocket::_HandleLogonChallenge() if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (recv_len() < remaining)) return false; - ///- Session is closed unless overriden + // Session is closed unless overriden m_status = STATUS_CLOSED; - //No big fear of memory outage (size is int16, i.e. < 65536) + // No big fear of memory outage (size is int16, i.e. < 65536) buf.resize(remaining + buf.size() + 1); buf[buf.size() - 1] = 0; sAuthLogonChallenge_C *ch = (sAuthLogonChallenge_C*)&buf[0]; - ///- Read the remaining of the packet + // Read the remaining of the packet recv((char *)&buf[4], remaining); sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "[AuthChallenge] got full packet, %#04x bytes", ch->size); sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); @@ -356,18 +356,18 @@ bool AuthSocket::_HandleLogonChallenge() std::reverse(ch->platform, ch->platform + 3); memcpy(&m_platform, ch->platform, sizeof(m_platform)); - ///- Normalize account name - //utf8ToUpperOnlyLatin(m_login); -- client already send account in expected form + // Normalize account name + // utf8ToUpperOnlyLatin(m_login); -- client already send account in expected form - //Escape the user login to avoid further SQL injection - //Memory will be freed on AuthSocket object destruction + // Escape the user login to avoid further SQL injection + // Memory will be freed on AuthSocket object destruction m_safelogin = m_login; LoginDatabase.escape_string(m_safelogin); pkt << (uint8) CMD_AUTH_LOGON_CHALLENGE; pkt << (uint8) 0x00; - ///- Verify that this IP is not in the ip_banned table + // Verify that this IP is not in the ip_banned table // No SQL injection possible (paste the IP address as passed by the socket) std::string address = get_remote_address(); LoginDatabase.escape_string(address); @@ -382,7 +382,7 @@ bool AuthSocket::_HandleLogonChallenge() } else { - ///- Get the account details from the account table + // Get the account details from the account table // No SQL injection (escaped user name) // 0 1 2 3 4 5 6 7 8 9 result = LoginDatabase.PQuery("SELECT `id`, `locked`, `last_ip`, `v`, `s`, `security`, `email_verif`, `geolock_pin`, `email`, UNIX_TIMESTAMP(`joindate`) FROM `account` WHERE `username` = '%s'",m_safelogin.c_str ()); @@ -410,7 +410,7 @@ bool AuthSocket::_HandleLogonChallenge() return true; } - ///- If the IP is 'locked', check that the player comes indeed from the correct IP address + // If the IP is 'locked', check that the player comes indeed from the correct IP address bool locked = false; m_lockFlags = (LockFlag)(*result)[1].GetUInt32(); m_securityInfo = (*result)[5].GetCppString(); @@ -457,7 +457,7 @@ bool AuthSocket::_HandleLogonChallenge() if ((!locked || (locked && (m_lockFlags & FIXED_PIN || m_lockFlags & TOTP))) && !broken) { uint32 account_id = fields[0].GetUInt32(); - ///- If the account is banned, reject the logon attempt + // If the account is banned, reject the logon attempt QueryResult *banresult = LoginDatabase.PQuery("SELECT `bandate`, `unbandate` FROM `account_banned` WHERE " "`id` = %u AND `active` = 1 AND (`unbandate` > UNIX_TIMESTAMP() OR `unbandate` = `bandate`) LIMIT 1", account_id); if (banresult) @@ -484,7 +484,7 @@ bool AuthSocket::_HandleLogonChallenge() srp.CalculateHostPublicEphemeral(); - ///- Fill the response packet with the result + // Fill the response packet with the result pkt << uint8(WOW_SUCCESS); // B may be calculated < 32B so we force minimal length to 32B @@ -531,7 +531,7 @@ bool AuthSocket::_HandleLogonChallenge() m_accountId = account_id; - ///- All good, await client's proof + // All good, await client's proof m_status = STATUS_LOGON_PROOF; } } @@ -546,14 +546,14 @@ bool AuthSocket::_HandleLogonChallenge() return true; } -/// Logon Proof command handler +// Logon Proof command handler bool AuthSocket::_HandleLogonProof() { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Entering _HandleLogonProof"); sAuthLogonProof_C_1_11 lp; - ///- Read the packet + // Read the packet if (m_build < 5428) // before version 1.11.0 (exclusive) { if (!recv((char *)&lp, sizeof(sAuthLogonProof_C_Base))) @@ -574,19 +574,19 @@ bool AuthSocket::_HandleLogonProof() return false; } - ///- Check if the client has one of the expected version numbers + // Check if the client has one of the expected version numbers bool valid_version = FindBuildInfo(m_build) != nullptr; - ///- Session is closed unless overriden + // Session is closed unless overriden m_status = STATUS_CLOSED; - ///
  • If the client has no valid version + //
    • If the client has no valid version if(!valid_version) { if (this->m_patch != ACE_INVALID_HANDLE) return false; - ///- Check if we have the apropriate patch on the disk + // Check if we have the apropriate patch on the disk // file looks like: 65535enGB.mpq char tmp[256]; @@ -642,16 +642,16 @@ bool AuthSocket::_HandleLogonProof() return true; } - ///
    + //
- ///- Continue the SRP6 calculation based on data received from the client + // Continue the SRP6 calculation based on data received from the client if (!srp.CalculateSessionKey(lp.A, 32)) return false; srp.HashSessionKey(); srp.CalculateProof(m_login); - ///- Check PIN data is correct + // Check PIN data is correct bool pinResult = true; if (m_promptPin && !lp.securityFlags) @@ -688,7 +688,7 @@ bool AuthSocket::_HandleLogonProof() } } - ///- Check if SRP6 results match (password is correct), else send an error + // Check if SRP6 results match (password is correct), else send an error if (!srp.Proof(lp.M1, 20) && pinResult) { if (!VerifyVersion(lp.A, sizeof(lp.A), lp.crc_hash, false)) @@ -758,7 +758,7 @@ bool AuthSocket::_HandleLogonProof() sLog.Out(LOG_BASIC, LOG_LVL_BASIC, "[AuthChallenge] Account '%s' using IP '%s' successfully authenticated", m_login.c_str(), get_remote_address().c_str()); - ///- Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account + // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account // No SQL injection (escaped user name) and IP address as received by socket const char* K_hex = srp.GetStrongSessionKey().AsHexStr(); const char *os = reinterpret_cast(&m_os); // no injection as there are only two possible values @@ -768,7 +768,7 @@ bool AuthSocket::_HandleLogonProof() delete result; OPENSSL_free((void*)K_hex); - ///- Finish SRP6 and send the final result to the client + // Finish SRP6 and send the final result to the client Sha1Hash sha; srp.Finalize(sha); @@ -832,14 +832,14 @@ bool AuthSocket::_HandleLogonProof() return true; } -/// Reconnect Challenge command handler +// Reconnect Challenge command handler bool AuthSocket::_HandleReconnectChallenge() { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Entering _HandleReconnectChallenge"); if (recv_len() < sizeof(sAuthLogonChallenge_C)) return false; - ///- Read the first 4 bytes (header) to get the length of the remaining of the packet + // Read the first 4 bytes (header) to get the length of the remaining of the packet std::vector buf; buf.resize(4); @@ -852,7 +852,7 @@ bool AuthSocket::_HandleReconnectChallenge() if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (recv_len() < remaining)) return false; - ///- Session is closed unless overriden + // Session is closed unless overriden m_status = STATUS_CLOSED; //No big fear of memory outage (size is int16, i.e. < 65536) @@ -860,7 +860,7 @@ bool AuthSocket::_HandleReconnectChallenge() buf[buf.size() - 1] = 0; sAuthLogonChallenge_C *ch = (sAuthLogonChallenge_C*)&buf[0]; - ///- Read the remaining of the packet + // Read the remaining of the packet recv((char *)&buf[4], remaining); sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "[ReconnectChallenge] got full packet, %#04x bytes", ch->size); sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I); @@ -895,10 +895,10 @@ bool AuthSocket::_HandleReconnectChallenge() m_accountId = fields[1].GetUInt32(); delete result; - ///- All good, await client's proof + // All good, await client's proof m_status = STATUS_RECON_PROOF; - ///- Sending response + // Sending response ByteBuffer pkt; pkt << (uint8) CMD_AUTH_RECONNECT_CHALLENGE; pkt << (uint8) 0x00; @@ -909,16 +909,16 @@ bool AuthSocket::_HandleReconnectChallenge() return true; } -/// Reconnect Proof command handler +// Reconnect Proof command handler bool AuthSocket::_HandleReconnectProof() { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Entering _HandleReconnectProof"); - ///- Read the packet + // Read the packet sAuthReconnectProof_C lp; if(!recv((char *)&lp, sizeof(sAuthReconnectProof_C))) return false; - ///- Session is closed unless overriden + // Session is closed unless overriden m_status = STATUS_CLOSED; BigNumber K = srp.GetStrongSessionKey(); @@ -945,7 +945,7 @@ bool AuthSocket::_HandleReconnectProof() return true; } - ///- Sending response + // Sending response ByteBuffer pkt; pkt << uint8(CMD_AUTH_RECONNECT_PROOF); pkt << uint8(WOW_SUCCESS); @@ -962,7 +962,7 @@ bool AuthSocket::_HandleReconnectProof() } } -/// %Realm List command handler +// %Realm List command handler bool AuthSocket::_HandleRealmList() { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Entering _HandleRealmList"); @@ -988,10 +988,10 @@ bool AuthSocket::_HandleRealmList() return false; } - ///- Update realm list if need + // Update realm list if need sRealmList.UpdateIfNeed(); - ///- Circle through realms in the RealmList and construct the return packet (including # of user characters in each realm) + // Circle through realms in the RealmList and construct the return packet (including # of user characters in each realm) ByteBuffer pkt; LoadRealmlist(pkt); @@ -1120,7 +1120,7 @@ void AuthSocket::LoadRealmlist(ByteBuffer &pkt) } } -/// Resume patch transfer +// Resume patch transfer bool AuthSocket::_HandleXferResume() { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Entering _HandleXferResume"); @@ -1158,7 +1158,7 @@ bool AuthSocket::_HandleXferResume() return true; } -/// Cancel patch transfer +// Cancel patch transfer bool AuthSocket::_HandleXferCancel() { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Entering _HandleXferCancel"); @@ -1169,7 +1169,7 @@ bool AuthSocket::_HandleXferCancel() return true; } -/// Accept patch transfer +// Accept patch transfer bool AuthSocket::_HandleXferAccept() { sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "Entering _HandleXferAccept"); @@ -1181,7 +1181,7 @@ bool AuthSocket::_HandleXferAccept() return true; } -/// Verify PIN entry data +// Verify PIN entry data bool AuthSocket::VerifyPinData(uint32 pin, const PINData& clientData) { // remap the grid to match the client's layout diff --git a/src/realmd/AuthSocket.h b/src/realmd/AuthSocket.h index cc3acf072..9bae00e4e 100644 --- a/src/realmd/AuthSocket.h +++ b/src/realmd/AuthSocket.h @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup realmd -/// @{ -/// \file +// \addtogroup realmd +// @{ +// \file #ifndef _AUTHSOCKET_H #define _AUTHSOCKET_H @@ -51,7 +51,7 @@ enum LockFlag GEO_CITY = 0x20 }; -/// Handle login commands +// Handle login commands class AuthSocket: public BufferedSocket { public: @@ -138,4 +138,4 @@ class AuthSocket: public BufferedSocket void InitPatch(); }; #endif -/// @} +// @} diff --git a/src/realmd/Main.cpp b/src/realmd/Main.cpp index 4a6254ba3..4582a6f91 100644 --- a/src/realmd/Main.cpp +++ b/src/realmd/Main.cpp @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup realmd Realm Daemon -/// @{ -/// \file +// \addtogroup realmd Realm Daemon +// @{ +// \file #include "Common.h" #include "Database/DatabaseEnv.h" @@ -69,11 +69,11 @@ bool StartDB(); void UnhookSignals(); void HookSignals(); -bool stopEvent = false; ///< Setting it to true stops the server +bool stopEvent = false; // Setting it to true stops the server -DatabaseType LoginDatabase; ///< Accessor to the realm server database +DatabaseType LoginDatabase; // Accessor to the realm server database -/// Print out the usage string for this program on the console. +// Print out the usage string for this program on the console. void usage(const char *prog) { sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Usage: \n %s []\n" @@ -94,10 +94,10 @@ void usage(const char *prog) char const* g_mainLogFileName = "Realmd.log"; -/// Launch the realm server +// Launch the realm server extern int main(int argc, char **argv) { - ///- Command line parsing + // Command line parsing char const* cfg_file = _REALMD_CONFIG; char const *options = ":c:s:"; @@ -196,7 +196,7 @@ extern int main(int argc, char **argv) sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, " to stop.\n" ); sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Using configuration file %s.", cfg_file); - ///- Check the version of the configuration file + // Check the version of the configuration file uint32 confVersion = sConfig.GetIntDefault("ConfVersion", 0); if (confVersion < _REALMDCONFVERSION) { @@ -233,7 +233,7 @@ extern int main(int argc, char **argv) sLog.Out(LOG_BASIC, LOG_LVL_BASIC, "Max allowed open files is %d", ACE::max_handles()); - /// realmd PID file creation + // realmd PID file creation std::string pidfile = sConfig.GetStringDefault("PidFile", ""); if(!pidfile.empty()) { @@ -248,7 +248,7 @@ extern int main(int argc, char **argv) sLog.Out(LOG_BASIC, LOG_LVL_BASIC, "Daemon PID: %u\n", pid ); } - ///- Initialize the database connection + // Initialize the database connection if(!StartDB()) { Log::WaitBeforeContinueIfNeed(); @@ -267,7 +267,7 @@ extern int main(int argc, char **argv) } } - ///- Get the list of realms for the server + // Get the list of realms for the server sRealmList.Initialize(sConfig.GetIntDefault("RealmsStateUpdateDelay", 20)); if (sRealmList.size() == 0) { @@ -289,7 +289,7 @@ extern int main(int argc, char **argv) LoginDatabase.Execute("DELETE FROM `ip_banned` WHERE `unbandate`<=UNIX_TIMESTAMP() AND `unbandate`<>`bandate`"); LoginDatabase.CommitTransaction(); - ///- Launch the listening network socket + // Launch the listening network socket ACE_Acceptor acceptor; uint16 rmport = sConfig.GetIntDefault("RealmServerPort", DEFAULT_REALMSERVER_PORT); @@ -304,10 +304,10 @@ extern int main(int argc, char **argv) return 1; } - ///- Catch termination signals + // Catch termination signals HookSignals(); - ///- Handle affinity for multiple processors and process priority on Windows + // Handle affinity for multiple processors and process priority on Windows #ifdef WIN32 { HANDLE hProcess = GetCurrentProcess(); @@ -360,7 +360,7 @@ extern int main(int argc, char **argv) #ifndef WIN32 detachDaemon(); #endif - ///- Wait for termination signal + // Wait for termination signal while (!stopEvent) { // dont move this outside the loop, the reactor will modify it @@ -381,17 +381,17 @@ extern int main(int argc, char **argv) #endif } - ///- Wait for the delay thread to exit + // Wait for the delay thread to exit LoginDatabase.HaltDelayThread(); - ///- Remove signal handling before leaving + // Remove signal handling before leaving UnhookSignals(); sLog.Out(LOG_BASIC, LOG_LVL_BASIC, "Halting process..." ); return 0; } -/// Handle termination signals +// Handle termination signals /** Put the global variable stopEvent to 'true' if a termination signal is caught **/ void OnSignal(int s) { @@ -411,7 +411,7 @@ void OnSignal(int s) signal(s, OnSignal); } -/// Initialize connection to the database +// Initialize connection to the database bool StartDB() { std::string dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", ""); @@ -463,7 +463,7 @@ bool StartDB() if (!LoginDatabase.CheckRequiredMigrations(MIGRATIONS_LOGON)) { - ///- Wait for already started DB delay threads to end + // Wait for already started DB delay threads to end LoginDatabase.HaltDelayThread(); return false; } @@ -471,7 +471,7 @@ bool StartDB() return true; } -/// Define hook 'OnSignal' for all termination signals +// Define hook 'OnSignal' for all termination signals void HookSignals() { signal(SIGINT, OnSignal); @@ -481,7 +481,7 @@ void HookSignals() #endif } -/// Unhook the signals before leaving +// Unhook the signals before leaving void UnhookSignals() { signal(SIGINT, 0); @@ -491,4 +491,4 @@ void UnhookSignals() #endif } -/// @} +// @} diff --git a/src/realmd/RealmList.cpp b/src/realmd/RealmList.cpp index f8f479035..6cf25d09a 100644 --- a/src/realmd/RealmList.cpp +++ b/src/realmd/RealmList.cpp @@ -74,20 +74,20 @@ RealmList& sRealmList return realmlist; } -/// Load the realm list from the database +// Load the realm list from the database void RealmList::Initialize(uint32 updateInterval) { m_UpdateInterval = updateInterval; LoadAllowedClients(); - ///- Get the content of the realmlist table in the database + // Get the content of the realmlist table in the database UpdateRealms(true); } void RealmList::UpdateRealm( uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags realmflags, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, const std::string& builds) { - ///- Create new if not exist or update existed + // Create new if not exist or update existed Realm& realm = m_realms[name]; realm.m_ID = ID; @@ -119,7 +119,7 @@ void RealmList::UpdateRealm( uint32 ID, const std::string& name, const std::stri if (bInfo->build == first_build) realm.realmBuildInfo = *bInfo; - ///- Append port to IP address. + // Append port to IP address. std::ostringstream ss; ss << address << ":" << port; realm.address = ss.str(); @@ -151,7 +151,7 @@ void RealmList::UpdateRealms(bool init) "`allowedSecurityLevel`, `population`, `realmbuilds` FROM `realmlist` " "WHERE (`realmflags` & 1) = 0 ORDER BY `name`"); - ///- Circle through results and add them to the realm map + // Circle through results and add them to the realm map if(result) { do diff --git a/src/realmd/RealmList.h b/src/realmd/RealmList.h index 65c7c0fcd..73d177a94 100644 --- a/src/realmd/RealmList.h +++ b/src/realmd/RealmList.h @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/// \addtogroup realmd -/// @{ -/// \file +// \addtogroup realmd +// @{ +// \file #ifndef _REALMLIST_H #define _REALMLIST_H @@ -48,7 +48,7 @@ extern std::vector ExpectedRealmdClientBuilds; typedef std::set RealmBuilds; -/// Storage object for a realm +// Storage object for a realm struct Realm { std::string address; @@ -62,7 +62,7 @@ struct Realm RealmBuildInfo realmBuildInfo; // build info for show version in list }; -/// Storage object for the list of realms on the server +// Storage object for the list of realms on the server class RealmList { public: @@ -85,7 +85,7 @@ class RealmList void UpdateRealm( uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags realmflags, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, const std::string& builds); void LoadAllowedClients(); private: - RealmMap m_realms; ///< Internal map of realms + RealmMap m_realms; // Internal map of realms uint32 m_UpdateInterval; time_t m_NextUpdateTime; }; @@ -93,4 +93,4 @@ class RealmList #define sRealmList RealmList::Instance() #endif -/// @} +// @} diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp index c866d3068..c77b11cee 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp @@ -23,7 +23,7 @@ enum void DefineGoChallenge(Creature * crea, uint64 gobjGUID); -/// Script du GameObject de challenge (GO_CHALLENGE_UROK) +// Challenge GameObject Script (GO_CHALLENGE_UROK) struct go_urok_challengeAI: public GameObjectAI { go_urok_challengeAI(GameObject* go) : GameObjectAI(go), _actived(true), _step(0), _timer(0), _spellTimer(0) diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_kelthuzad.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_kelthuzad.cpp index ed42ae03f..83767904d 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_kelthuzad.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_kelthuzad.cpp @@ -963,7 +963,7 @@ struct mob_guardian_icecrownAI : public ScriptedAI void JustReachedHome() override { m_creature->DeleteLater(); - ///m_creature->ForcedDespawn(1); + // m_creature->ForcedDespawn(1); } void DispellShackle(Creature* pC) diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp index 642c5ead3..cd02b6896 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp @@ -517,7 +517,7 @@ void instance_naxxramas::OnObjectCreate(GameObject* pGo) case 533196: case 533198: m_alHeiganTrapGuids[2].push_back(pGo->GetObjectGuid()); - ///case 533186: + // case 533186: } } diff --git a/src/scripts/eastern_kingdoms/searing_gorge/searing_gorge.cpp b/src/scripts/eastern_kingdoms/searing_gorge/searing_gorge.cpp index 0b9c22583..61a9c72b4 100644 --- a/src/scripts/eastern_kingdoms/searing_gorge/searing_gorge.cpp +++ b/src/scripts/eastern_kingdoms/searing_gorge/searing_gorge.cpp @@ -189,7 +189,7 @@ struct npc_obsidionAI : public ScriptedAI bool GossipHello_npc_dying_archaeologist(Player* pPlayer, Creature* pCreature) { if (Creature* Obsidion = GetClosestCreatureWithEntry(pCreature, NPC_OBSIDION, VISIBLE_RANGE)) - return false; /// everything is ok + return false; // everything is ok pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid(), QUEST_RISE_OBSIDION); pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetObjectGuid()); diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp index e565433d0..63417d591 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp @@ -196,7 +196,7 @@ struct boss_venoxisAI : public ScriptedAI if (!m_bPhaseTwo) { - /// Phase 1 + // Phase 1 if (m_uiHolyNova_Timer < uiDiff) { DoCastSpellIfCan(m_creature, SPELL_HOLY_NOVA); diff --git a/src/scripts/kalimdor/silithus/silithus.cpp b/src/scripts/kalimdor/silithus/silithus.cpp index dc61f9f18..0b786f72e 100644 --- a/src/scripts/kalimdor/silithus/silithus.cpp +++ b/src/scripts/kalimdor/silithus/silithus.cpp @@ -150,7 +150,7 @@ struct go_pierre_ventsAI: public GameObjectAI bool playerHasAura = true; - ///- Check if allowed to use the stone ? + // Check if allowed to use the stone ? switch (GetStoneType()) { // Pierre SUP @@ -211,7 +211,7 @@ struct go_pierre_ventsAI: public GameObjectAI uint32 summonEntry = 0; uint32 textId = 0; - ///- Let's find out which mob we have to summon. + // Let's find out which mob we have to summon. switch (stoneType) { case GO_TYPE_PIERRE_SUP: @@ -249,7 +249,7 @@ struct go_pierre_ventsAI: public GameObjectAI if (!summonEntry) return true; - ///- Destroy required items. + // Destroy required items. if (!player->ToPlayer()->IsGameMaster()) { switch (stoneType) @@ -268,7 +268,7 @@ struct go_pierre_ventsAI: public GameObjectAI } } - ///- Summon the creature + // Summon the creature if (Creature* pInvoc = me->SummonCreature(summonEntry, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), me->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 3600000, false, 5000)) { player->CastSpell(player, SPELL_RED_LIGHTNING, true); @@ -278,7 +278,7 @@ struct go_pierre_ventsAI: public GameObjectAI pInvoc->MonsterSay(textId, 0, player); } - ///- Mark stone as used. + // Mark stone as used. me->UseDoorOrButton(); if (stoneType == GO_TYPE_PIERRE_SUP) me->SetRespawnTime(3600); diff --git a/src/shared/Database/DBCFileLoader.h b/src/shared/Database/DBCFileLoader.h index f7fb12a15..ab024d235 100644 --- a/src/shared/Database/DBCFileLoader.h +++ b/src/shared/Database/DBCFileLoader.h @@ -91,7 +91,7 @@ class DBCFileLoader // Get record by id Record getRecord(size_t id); - /// Get begin iterator over records + // Get begin iterator over records uint32 GetNumRows() const { return recordCount;} uint32 GetCols() const { return fieldCount; } diff --git a/src/shared/Database/Database.h b/src/shared/Database/Database.h index ed46644cb..80052b095 100644 --- a/src/shared/Database/Database.h +++ b/src/shared/Database/Database.h @@ -126,7 +126,7 @@ class Database //stop worker thread virtual void HaltDelayThread(); - /// Synchronous DB queries + // Synchronous DB queries inline QueryResult* Query(char const* sql) { SqlConnection::Lock guard(getQueryConnection()); @@ -153,7 +153,7 @@ class Database bool DirectPExecute(char const* format,...) ATTR_PRINTF(2,3); - /// Async queries and query holders, implemented in DatabaseImpl.h + // Async queries and query holders, implemented in DatabaseImpl.h // Query / member template @@ -309,7 +309,7 @@ class Database typedef ACE_TSS DBTransHelperTSS; Database::DBTransHelperTSS m_TransStorage; - ///< DB connections + // DB connections //round-robin connection selection SqlConnection* getQueryConnection(); @@ -323,8 +323,8 @@ class Database bool DirectExecuteStmt(SqlStatementID const& id, SqlStmtParameters* params); //connection helper counters - int m_nQueryConnPoolSize; //current size of query connection pool - std::atomic m_nQueryCounter; //counter for connection selection + int m_nQueryConnPoolSize; // Current size of query connection pool + std::atomic m_nQueryCounter; // Counter for connection selection //lets use pool of connections for sync queries typedef std::vector< SqlConnection* > SqlConnectionContainer; @@ -334,12 +334,12 @@ class Database SqlConnection* m_pAsyncConn; - SqlResultQueue* m_pResultQueue; ///< Transaction queues from diff. threads + SqlResultQueue* m_pResultQueue; // Transaction queues from diff. threads uint32 m_numAsyncWorkers; - std::vector> m_threadsBodies; ///< Pointer to delay sql executer (owned by m_delayThread) - std::vector m_delayThreads; ///< Pointer to executer thread + std::vector> m_threadsBodies; // Pointer to delay sql executer (owned by m_delayThread) + std::vector m_delayThreads; // Pointer to executer thread - bool m_bAllowAsyncTransactions; ///< flag which specifies if async transactions are enabled + bool m_bAllowAsyncTransactions; // Flag which specifies if async transactions are enabled //PREPARED STATEMENT REGISTRY using LOCK_TYPE = std::mutex; @@ -348,7 +348,7 @@ class Database mutable LOCK_TYPE m_stmtGuard; typedef std::unordered_map PreparedStmtRegistry; - PreparedStmtRegistry m_stmtRegistry; ///< + PreparedStmtRegistry m_stmtRegistry; int m_iStmtIndex; diff --git a/src/shared/Database/DatabaseImpl.h b/src/shared/Database/DatabaseImpl.h index ba28453b3..04563d0b3 100644 --- a/src/shared/Database/DatabaseImpl.h +++ b/src/shared/Database/DatabaseImpl.h @@ -23,7 +23,7 @@ #include "Database/SqlOperations.h" #include "Log.h" -/// Function body definitions for the template function members of the Database class +// Function body definitions for the template function members of the Database class #define ASYNC_QUERY_BODY(sql) if (!sql || !m_pResultQueue) return false; #define ASYNC_DELAYHOLDER_BODY(holder) if (!holder || !m_pResultQueue) return false; diff --git a/src/shared/Database/SqlDelayThread.h b/src/shared/Database/SqlDelayThread.h index e921803aa..fb89b580a 100644 --- a/src/shared/Database/SqlDelayThread.h +++ b/src/shared/Database/SqlDelayThread.h @@ -34,10 +34,10 @@ class SqlDelayThread typedef LockedQueue SqlQueue; private: - SqlQueue m_sqlQueue; ///< Queue of SQL statements - Database *m_dbEngine; ///< Pointer to used Database engine + SqlQueue m_sqlQueue; // Queue of SQL statements + Database *m_dbEngine; // Pointer to used Database engine SqlQueue m_serialDelayQueue; - SqlConnection *m_dbConnection; ///< Pointer to DB connection + SqlConnection *m_dbConnection; // Pointer to DB connection volatile bool m_running; @@ -48,12 +48,12 @@ class SqlDelayThread SqlDelayThread(Database* db, SqlConnection* conn); ~SqlDelayThread(); - ///< Put sql statement to delay queue + // Put sql statement to delay queue bool Delay(SqlOperation* sql) { m_sqlQueue.add(sql); return true; } void addSerialOperation(SqlOperation *op); bool HasAsyncQuery(); - virtual void Stop(); ///< Stop event - void run(); ///< Main Thread loop + virtual void Stop(); // Stop event + void run(); // Main Thread loop }; #endif //__SQLDELAYTHREAD_H diff --git a/src/shared/Database/SqlOperations.cpp b/src/shared/Database/SqlOperations.cpp index 223fa53e8..66a3963e3 100644 --- a/src/shared/Database/SqlOperations.cpp +++ b/src/shared/Database/SqlOperations.cpp @@ -28,11 +28,11 @@ #define LOCK_DB_CONN(conn) SqlConnection::Lock guard(conn) -/// ---- ASYNC STATEMENTS / TRANSACTIONS ---- +// ---- ASYNC STATEMENTS / TRANSACTIONS ---- bool SqlPlainRequest::Execute(SqlConnection* conn) { - /// just do it + // just do it LOCK_DB_CONN(conn); return conn->Execute(m_sql); } @@ -85,7 +85,7 @@ bool SqlPreparedRequest::Execute(SqlConnection* conn) return conn->ExecuteStmt(m_nIndex, *m_param); } -/// ---- ASYNC QUERIES ---- +// ---- ASYNC QUERIES ---- bool SqlQuery::Execute(SqlConnection* conn) { @@ -93,9 +93,9 @@ bool SqlQuery::Execute(SqlConnection* conn) return false; LOCK_DB_CONN(conn); - /// execute the query and store the result in the callback + // execute the query and store the result in the callback m_callback->SetResult(conn->Query(m_sql)); - /// add the callback to the sql result queue of the thread it originated from + // add the callback to the sql result queue of the thread it originated from m_queue->add(m_callback); return true; @@ -104,7 +104,7 @@ bool SqlQuery::Execute(SqlConnection* conn) void SqlResultQueue::Update(uint32 timeout) { uint32 begin = WorldTimer::getMSTime(); - /// execute the callbacks waiting in the synchronization queue + // execute the callbacks waiting in the synchronization queue MaNGOS::IQueryCallback* callback = NULL; int n = 0; while (next(callback)) @@ -173,8 +173,8 @@ bool SqlQueryHolder::Execute(MaNGOS::IQueryCallback* callback, Database* databas if(!callback || !database || !queue) return false; - /// delay the execution of the queries, sync them with the delay thread - /// which will in turn resync on execution (via the queue) and call back + // delay the execution of the queries, sync them with the delay thread + // which will in turn resync on execution (via the queue) and call back SqlQueryHolderEx *holderEx = new SqlQueryHolderEx(this, callback, queue, serialId); database->AddToSerialDelayQueue(holderEx); @@ -196,7 +196,7 @@ bool SqlQueryHolder::SetQuery(size_t index, char const* sql) return false; } - /// not executed yet, just stored (it's not called a holder for nothing) + // not executed yet, just stored (it's not called a holder for nothing) m_queries[index] = SqlResultPair(mangos_strdup(sql), (QueryResult*)nullptr); return true; } @@ -228,13 +228,13 @@ QueryResult* SqlQueryHolder::GetResult(size_t index) { if(index < m_queries.size()) { - /// the query strings are freed on the first GetResult or in the destructor + // the query strings are freed on the first GetResult or in the destructor if(m_queries[index].first != nullptr) { delete [] (const_cast(m_queries[index].first)); m_queries[index].first = nullptr; } - /// when you get a result aways remember to delete it! + // when you get a result aways remember to delete it! return m_queries[index].second; } else @@ -243,7 +243,7 @@ QueryResult* SqlQueryHolder::GetResult(size_t index) void SqlQueryHolder::SetResult(size_t index, QueryResult* result) { - /// store the result in the holder + // store the result in the holder if(index < m_queries.size()) m_queries[index].second = result; } @@ -252,8 +252,8 @@ SqlQueryHolder::~SqlQueryHolder() { for(size_t i = 0; i < m_queries.size(); i++) { - /// if the result was never used, free the resources - /// results used already (getresult called) are expected to be deleted + // if the result was never used, free the resources + // results used already (getresult called) are expected to be deleted if(m_queries[i].first != nullptr) { delete [] (const_cast(m_queries[i].first)); @@ -270,8 +270,8 @@ void SqlQueryHolder::DeleteAllResults() { for(size_t i = 0; i < m_queries.size(); i++) { - /// if the result was never used, free the resources - /// results used already (getresult called) are expected to be deleted + // if the result was never used, free the resources + // results used already (getresult called) are expected to be deleted if (m_queries[i].second != nullptr) { delete m_queries[i].second; @@ -282,7 +282,7 @@ void SqlQueryHolder::DeleteAllResults() void SqlQueryHolder::SetSize(size_t size) { - /// to optimize push_back, reserve the number of queries about to be executed + // to optimize push_back, reserve the number of queries about to be executed m_queries.resize(size); } @@ -292,17 +292,17 @@ bool SqlQueryHolderEx::Execute(SqlConnection* conn) return false; LOCK_DB_CONN(conn); - /// we can do this, we are friends + // we can do this, we are friends std::vector &queries = m_holder->m_queries; for(size_t i = 0; i < queries.size(); i++) { - /// execute all queries in the holder and pass the results + // execute all queries in the holder and pass the results char const *sql = queries[i].first; if (sql) m_holder->SetResult(i, conn->Query(sql)); } - /// sync with the caller thread + // sync with the caller thread m_queue->add(m_callback); return true; diff --git a/src/shared/Database/SqlOperations.h b/src/shared/Database/SqlOperations.h index abe0b7af7..57120c58f 100644 --- a/src/shared/Database/SqlOperations.h +++ b/src/shared/Database/SqlOperations.h @@ -29,7 +29,7 @@ #include "Utilities/Callback.h" #include -/// ---- BASE --- +// ---- BASE --- class Database; class SqlConnection; @@ -50,7 +50,7 @@ class SqlOperation uint32 serialId; }; -/// ---- ASYNC STATEMENTS / TRANSACTIONS ---- +// ---- ASYNC STATEMENTS / TRANSACTIONS ---- class SqlPlainRequest : public SqlOperation { @@ -89,13 +89,13 @@ class SqlPreparedRequest : public SqlOperation SqlStmtParameters* m_param; }; -/// ---- ASYNC QUERIES ---- +// ---- ASYNC QUERIES ---- -class SqlQuery; /// contains a single async query -class QueryResult; /// the result of one -class SqlResultQueue; /// queue for thread sync -class SqlQueryHolder; /// groups several async quries -class SqlQueryHolderEx; /// points to a holder, added to the delay thread +class SqlQuery; // contains a single async query +class QueryResult; // the result of one +class SqlResultQueue; // queue for thread sync +class SqlQueryHolder; // groups several async quries +class SqlQueryHolderEx; // points to a holder, added to the delay thread class ThreadPool; diff --git a/src/shared/Duration.h b/src/shared/Duration.h index 70180fbe7..4b48a3abe 100644 --- a/src/shared/Duration.h +++ b/src/shared/Duration.h @@ -20,19 +20,19 @@ #include -/// Milliseconds shorthand typedef. +// Milliseconds shorthand typedef. typedef std::chrono::milliseconds Milliseconds; -/// Seconds shorthand typedef. +// Seconds shorthand typedef. typedef std::chrono::seconds Seconds; -/// Minutes shorthand typedef. +// Minutes shorthand typedef. typedef std::chrono::minutes Minutes; -/// Hours shorthand typedef. +// Hours shorthand typedef. typedef std::chrono::hours Hours; -/// Makes std::chrono_literals globally available. +// Makes std::chrono_literals globally available. // ToDo: Enable this when TC supports C++14. // using namespace std::chrono_literals; diff --git a/src/shared/LockedQueue.h b/src/shared/LockedQueue.h index 7bc334976..aca88bee5 100644 --- a/src/shared/LockedQueue.h +++ b/src/shared/LockedQueue.h @@ -142,7 +142,7 @@ template > { return _queue.empty(); } - ///! Checks if we're empty or not with locks held + // Checks if we're empty or not with locks held bool empty() { std::unique_lock g(this->_lock); diff --git a/src/shared/Log.cpp b/src/shared/Log.cpp index c164f3282..1db96028c 100644 --- a/src/shared/Log.cpp +++ b/src/shared/Log.cpp @@ -65,7 +65,7 @@ Log::Log() : logFiles[i] = nullptr; } - /// Common log files data + // Common log files data m_logsDir = sConfig.GetStringDefault("LogsDir", ""); if (!m_logsDir.empty()) { @@ -75,7 +75,7 @@ Log::Log() : auto const log_file_timestamp = sConfig.GetBoolDefault("LogFile.TimeStamp", false); - /// Open specific log files + // Open specific log files // GM log settings for per account case m_gmlog_filename_format = sConfig.GetStringDefault("GMLogFile", ""); diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp index abb51ecdc..8eb0c076b 100644 --- a/src/shared/Util.cpp +++ b/src/shared/Util.cpp @@ -357,7 +357,7 @@ std::string TimeToTimestampStr(time_t t) return std::string(buf); } -/// Check if the string is a valid ip address representation +// Check if the string is a valid ip address representation bool IsIPAddress(char const* ipaddress) { if(!ipaddress) @@ -368,7 +368,7 @@ bool IsIPAddress(char const* ipaddress) return ACE_OS::inet_addr(ipaddress) != INADDR_NONE; } -/// create PID file +// create PID file uint32 CreatePIDFile(std::string const& filename) { FILE* pid_file = fopen (filename.c_str(), "w");