From eae18d8ed0db62ff74bc30bc6a260e4aa9e5fcbc Mon Sep 17 00:00:00 2001 From: Trisjdc Date: Fri, 6 Jun 2014 11:14:32 +0100 Subject: Core/Utils: Move EventMap to Util.h --- src/server/shared/Utilities/Util.h | 349 +++++++++++++++++++++++++++++++++++++ 1 file changed, 349 insertions(+) (limited to 'src/server/shared') diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index b086a28134c..96d5a2abfea 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -565,4 +565,353 @@ bool CompareValues(ComparisionType type, T val1, T val2) } } +class EventMap +{ + /** + * Internal storage type. + * Key: Time as uint32 when the event should occur. + * Value: The event data as uint32. + * + * Structure of event data: + * - Bit 0 - 15: Event Id. + * - Bit 16 - 23: Group + * - Bit 24 - 31: Phase + * - Pattern: 0xPPGGEEEE + */ + typedef std::multimap EventStore; + + public: + EventMap() : _time(0), _phase(0), _lastEvent(0) { } + + /** + * @name Reset + * @brief Removes all scheduled events and resets time and phase. + */ + void Reset() + { + _eventMap.clear(); + _time = 0; + _phase = 0; + } + + /** + * @name Update + * @brief Updates the timer of the event map. + * @param time Value to be added to time. + */ + void Update(uint32 time) + { + _time += time; + } + + /** + * @name GetTimer + * @return Current timer value. + */ + uint32 GetTimer() const + { + return _time; + } + + /** + * @name GetPhaseMask + * @return Active phases as mask. + */ + uint8 GetPhaseMask() const + { + return _phase; + } + + /** + * @name Empty + * @return True, if there are no events scheduled. + */ + bool Empty() const + { + return _eventMap.empty(); + } + + /** + * @name SetPhase + * @brief Sets the phase of the map (absolute). + * @param phase Phase which should be set. Values: 1 - 8. 0 resets phase. + */ + void SetPhase(uint8 phase) + { + if (!phase) + _phase = 0; + else if (phase <= 8) + _phase = (1 << (phase - 1)); + } + + /** + * @name AddPhase + * @brief Activates the given phase (bitwise). + * @param phase Phase which should be activated. Values: 1 - 8 + */ + void AddPhase(uint8 phase) + { + if (phase && phase <= 8) + _phase |= (1 << (phase - 1)); + } + + /** + * @name RemovePhase + * @brief Deactivates the given phase (bitwise). + * @param phase Phase which should be deactivated. Values: 1 - 8. + */ + void RemovePhase(uint8 phase) + { + if (phase && phase <= 8) + _phase &= ~(1 << (phase - 1)); + } + + /** + * @name ScheduleEvent + * @brief Creates new event entry in map. + * @param eventId The id of the new event. + * @param time The time in milliseconds until the event occurs. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void ScheduleEvent(uint32 eventId, uint32 time, uint32 group = 0, uint8 phase = 0) + { + if (group && group <= 8) + eventId |= (1 << (group + 15)); + + if (phase && phase <= 8) + eventId |= (1 << (phase + 23)); + + _eventMap.insert(EventStore::value_type(_time + time, eventId)); + } + + /** + * @name RescheduleEvent + * @brief Cancels the given event and reschedules it. + * @param eventId The id of the event. + * @param time The time in milliseconds until the event occurs. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void RescheduleEvent(uint32 eventId, uint32 time, uint32 group = 0, uint8 phase = 0) + { + CancelEvent(eventId); + ScheduleEvent(eventId, time, group, phase); + } + + /** + * @name RepeatEvent + * @brief Repeats the mostly recently executed event. + * @param time Time until the event occurs. + */ + void Repeat(uint32 time) + { + _eventMap.insert(EventStore::value_type(_time + time, _lastEvent)); + } + + /** + * @name RepeatEvent + * @brief Repeats the mostly recently executed event. + * @param time Time until the event occurs. Equivalent to Repeat(urand(minTime, maxTime). + */ + void Repeat(uint32 minTime, uint32 maxTime) + { + Repeat(urand(minTime, maxTime)); + } + + /** + * @name ExecuteEvent + * @brief Returns the next event to execute and removes it from map. + * @return Id of the event to execute. + */ + uint32 ExecuteEvent() + { + while (!Empty()) + { + EventStore::iterator itr = _eventMap.begin(); + + if (itr->first > _time) + return 0; + else if (_phase && (itr->second & 0xFF000000) && !((itr->second >> 24) & _phase)) + _eventMap.erase(itr); + else + { + uint32 eventId = (itr->second & 0x0000FFFF); + _lastEvent = itr->second; // include phase/group + _eventMap.erase(itr); + return eventId; + } + } + + return 0; + } + + /** + * @name DelayEvents + * @brief Delays all events in the map. If delay is greater than or equal internal timer, delay will be 0. + * @param delay Amount of delay. + */ + void DelayEvents(uint32 delay) + { + _time = delay < _time ? _time - delay : 0; + } + + /** + * @name DelayEvents + * @brief Delay all events of the same group. + * @param delay Amount of delay. + * @param group Group of the events. + */ + void DelayEvents(uint32 delay, uint32 group) + { + if (!group || group > 8 || Empty()) + return; + + EventStore delayed; + + for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) + { + if (itr->second & (1 << (group + 15))) + { + delayed.insert(EventStore::value_type(itr->first + delay, itr->second)); + _eventMap.erase(itr++); + } + else + ++itr; + } + + _eventMap.insert(delayed.begin(), delayed.end()); + } + + /** + * @name CancelEvent + * @brief Cancels all events of the specified id. + * @param eventId Event id to cancel. + */ + void CancelEvent(uint32 eventId) + { + if (Empty()) + return; + + for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) + { + if (eventId == (itr->second & 0x0000FFFF)) + _eventMap.erase(itr++); + else + ++itr; + } + } + + /** + * @name CancelEventGroup + * @brief Cancel events belonging to specified group. + * @param group Group to cancel. + */ + void CancelEventGroup(uint32 group) + { + if (!group || group > 8 || Empty()) + return; + + for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) + { + if (itr->second & (1 << (group + 15))) + _eventMap.erase(itr++); + else + ++itr; + } + } + + /** + * @name GetNextEventTime + * @brief Returns closest occurence of specified event. + * @param eventId Wanted event id. + * @return Time of found event. + */ + uint32 GetNextEventTime(uint32 eventId) const + { + if (Empty()) + return 0; + + for (EventStore::const_iterator itr = _eventMap.begin(); itr != _eventMap.end(); ++itr) + if (eventId == (itr->second & 0x0000FFFF)) + return itr->first; + + return 0; + } + + /** + * @name GetNextEventTime + * @return Time of next event. + */ + uint32 GetNextEventTime() const + { + return Empty() ? 0 : _eventMap.begin()->first; + } + + /** + * @name IsInPhase + * @brief Returns wether event map is in specified phase or not. + * @param phase Wanted phase. + * @return True, if phase of event map contains specified phase. + */ + bool IsInPhase(uint8 phase) + { + return phase <= 8 && (!phase || _phase & (1 << (phase - 1))); + } + + /** + * @name GetTimeUntilEvent + * @brief Returns time in milliseconds until next event. + * @param Id of the event. + * @return Time of next event. + */ + uint32 GetTimeUntilEvent(uint32 eventId) const + { + for (EventStore::const_iterator itr = _eventMap.begin(); itr != _eventMap.end(); ++itr) + if (eventId == (itr->second & 0x0000FFFF)) + return itr->first - _time; + + return std::numeric_limits::max(); + } + + private: + /** + * @name _time + * @brief Internal timer. + * + * This does not represent the real date/time value. + * It's more like a stopwatch: It can run, it can be stopped, + * it can be resetted and so on. Events occur when this timer + * has reached their time value. Its value is changed in the + * Update method. + */ + uint32 _time; + + /** + * @name _phase + * @brief Phase mask of the event map. + * + * Contains the phases the event map is in. Multiple + * phases from 1 to 8 can be set with SetPhase or + * AddPhase. RemovePhase deactives a phase. + */ + uint8 _phase; + + /** + * @name _eventMap + * @brief Internal event storage map. Contains the scheduled events. + * + * See typedef at the beginning of the class for more + * details. + */ + EventStore _eventMap; + + + /** + * @name _lastEvent + * @brief Stores information on the most recently executed event + */ + uint32 _lastEvent; +}; + #endif -- cgit v1.2.3 From 2cd0dce366878d995669865a36c99ad834204cd4 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 7 Jun 2014 00:30:08 +0200 Subject: Core: Fix non pch build --- src/server/shared/Utilities/Util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server/shared') diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 96d5a2abfea..d6ead607c55 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -26,6 +26,7 @@ #include #include #include +#include #include // Searcher for map of structs -- cgit v1.2.3 From 4ec84fd1ec77f19aa6b81e052caab6e9b16e2e91 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 7 Jun 2014 22:13:42 +0200 Subject: Core/Database: Update log for incorrect db structure --- src/server/shared/Database/DatabaseWorkerPool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/shared') diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index 3665a388854..9c56c75bf71 100644 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -99,7 +99,7 @@ class DatabaseWorkerPool (_connectionCount[IDX_SYNCH] + _connectionCount[IDX_ASYNC])); else TC_LOG_ERROR("sql.driver", "DatabasePool %s NOT opened. There were errors opening the MySQL connections. Check your SQLDriverLogFile " - "for specific errors.", GetDatabaseName()); + "for specific errors. Read wiki at http://collab.kpsn.org/display/tc/TrinityCore+Home", GetDatabaseName()); return res; } -- cgit v1.2.3 From 1d39db16b9e5250033eda16da3dabbb61d61e83a Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 7 Jun 2014 23:56:13 +0200 Subject: Core/Misc: Kill Whitespace ... --- src/server/authserver/Main.cpp | 16 ++++++++-------- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Player/Player.h | 4 ++-- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Server/WorldSession.cpp | 2 +- src/server/game/Spells/SpellMgr.cpp | 12 ++++++------ .../BlackrockDepths/boss_anubshiah.cpp | 2 +- .../BlackrockDepths/boss_general_angerforge.cpp | 2 +- .../BlackrockMountain/BlackrockDepths/boss_grizzle.cpp | 2 +- .../boss_high_interrogator_gerstahn.cpp | 2 +- .../BlackrockMountain/BlackrockDepths/boss_magmus.cpp | 2 +- .../BlackrockDepths/boss_moira_bronzebeard.cpp | 2 +- .../HallsOfReflection/halls_of_reflection.cpp | 8 ++++---- src/server/shared/Debugging/WheatyExceptionReport.cpp | 2 +- src/server/shared/Debugging/WheatyExceptionReport.h | 2 +- src/server/shared/Packets/ByteBuffer.h | 12 ++++++------ src/server/worldserver/Master.cpp | 18 +++++++++--------- 18 files changed, 47 insertions(+), 47 deletions(-) (limited to 'src/server/shared') diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index d1b2b614037..be6623c7fa3 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -179,24 +179,24 @@ extern int main(int argc, char** argv) Handler.register_handler(SIGTERM, &SignalTERM); #if defined(_WIN32) || defined(__linux__) - + ///- Handle affinity for multiple processors and process priority uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0); bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false); #ifdef _WIN32 // Windows - + HANDLE hProcess = GetCurrentProcess(); if (affinity > 0) { ULONG_PTR appAff; ULONG_PTR sysAff; - + if (GetProcessAffinityMask(hProcess, &appAff, &sysAff)) { // remove non accessible processors ULONG_PTR currentAffinity = affinity & appAff; - + if (!currentAffinity) TC_LOG_ERROR("server.authserver", "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the authserver. Accessible processors bitmask (hex): %x", affinity, appAff); else if (SetProcessAffinityMask(hProcess, currentAffinity)) @@ -205,7 +205,7 @@ extern int main(int argc, char** argv) TC_LOG_ERROR("server.authserver", "Can't set used processors (hex): %x", currentAffinity); } } - + if (highPriority) { if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS)) @@ -213,9 +213,9 @@ extern int main(int argc, char** argv) else TC_LOG_ERROR("server.authserver", "Can't set authserver process priority class."); } - + #else // Linux - + if (affinity > 0) { cpu_set_t mask; @@ -242,7 +242,7 @@ extern int main(int argc, char** argv) else TC_LOG_INFO("server.authserver", "authserver process priority class set to %i", getpriority(PRIO_PROCESS, 0)); } - + #endif #endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f1adae8f337..b73a542a92b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -689,7 +689,7 @@ Player::Player(WorldSession* session): Unit(true) m_areaUpdateId = 0; m_team = 0; - + m_needsZoneUpdate = false; m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 94175834969..aeac9db98aa 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1676,7 +1676,7 @@ class Player : public Unit, public GridObject void UpdateZone(uint32 newZone, uint32 newArea); void UpdateArea(uint32 newArea); void SetNeedsZoneUpdate(bool needsUpdate) { m_needsZoneUpdate = needsUpdate; } - + void UpdateZoneDependentAuras(uint32 zone_id); // zones void UpdateAreaDependentAuras(uint32 area_id); // subzones @@ -2564,7 +2564,7 @@ class Player : public Unit, public GridObject bool IsAlwaysDetectableFor(WorldObject const* seer) const; uint8 m_grantableLevels; - + bool m_needsZoneUpdate; private: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7721aec151b..5f05cf65739 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10260,7 +10260,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui int32 TakenTotal = 0; float TakenTotalMod = 1.0f; float TakenTotalCasterMod = 0.0f; - + // Mod damage from spell mechanic if (uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask()) { diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 11fa89d9d6b..c4ff2581e75 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -502,7 +502,7 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket& recvData) // use server side data, but only after update the player position. See Player::UpdatePosition(). GetPlayer()->SetNeedsZoneUpdate(true); - + //GetPlayer()->SendInitWorldStates(true, newZone); } diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index a0ff8b98e43..f8df683d90c 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -1264,7 +1264,7 @@ bool WorldSession::DosProtection::EvaluateOpcode(WorldPacket& p, time_t time) co Session->GetAccountId(), Session->GetRemoteAddress().c_str(), Session->GetLatency(), Session->GetPlayerName().c_str(), opcodeTable[p.GetOpcode()].name, p.GetOpcode(), packetCounter.amountCounter); } - + // Then check if player is sending packets not allowed if (!IsOpcodeAllowed(p.GetOpcode())) { diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9eadd178eb3..b94d0def3dd 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -784,14 +784,14 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, Spell bool hasFamilyMask = false; - /** - + /** + * @brief Check auras procced by periodics *Only damaging Dots can proc auras with PROC_FLAG_TAKEN_DAMAGE *Only Dots can proc if ONLY has PROC_FLAG_DONE_PERIODIC or PROC_FLAG_TAKEN_PERIODIC. - + *Hots can proc if ONLY has PROC_FLAG_DONE_PERIODIC and spellfamily != 0 *Only Dots can proc auras with PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG or PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG @@ -806,7 +806,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, Spell * @param procFlags proc_flags of spellProc * @param procExtra proc_EX of procSpell * @param EventProcFlag proc_flags of aura to be procced - * @param spellProto SpellInfo of aura to be procced + * @param spellProto SpellInfo of aura to be procced */ @@ -815,7 +815,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, Spell return true; if (procFlags & PROC_FLAG_DONE_PERIODIC && EventProcFlag & PROC_FLAG_DONE_PERIODIC) - { + { if (procExtra & PROC_EX_INTERNAL_HOT) { if (EventProcFlag == PROC_FLAG_DONE_PERIODIC) @@ -835,7 +835,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, Spell } if (procFlags & PROC_FLAG_TAKEN_PERIODIC && EventProcFlag & PROC_FLAG_TAKEN_PERIODIC) - { + { if (procExtra & PROC_EX_INTERNAL_HOT) { /// No aura that only has PROC_FLAG_TAKEN_PERIODIC can proc from a HOT. diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp index 1a2e8bba805..894b528c03c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp @@ -50,7 +50,7 @@ class boss_anubshiah : public CreatureScript _events.Reset(); } - void EnterCombat(Unit* /*who*/) override + void EnterCombat(Unit* /*who*/) override { _events.ScheduleEvent(EVENT_SHADOWBOLT, 7000); _events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 24000); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp index 79ffedc8c17..d5b8d1deadd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp @@ -54,7 +54,7 @@ class boss_general_angerforge : public CreatureScript _events.Reset(); } - void EnterCombat(Unit* /*who*/) override + void EnterCombat(Unit* /*who*/) override { _events.SetPhase(PHASE_ONE); _events.ScheduleEvent(EVENT_MIGHTYBLOW, 8000); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp index f46c0c118b1..f53fd0f65b3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp @@ -51,7 +51,7 @@ class boss_grizzle : public CreatureScript _events.Reset(); } - void EnterCombat(Unit* /*who*/) override + void EnterCombat(Unit* /*who*/) override { _events.SetPhase(PHASE_ONE); _events.ScheduleEvent(EVENT_GROUNDTREMOR, 12000); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp index 7105d78f2ee..c41ddf9d98b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp @@ -48,7 +48,7 @@ class boss_high_interrogator_gerstahn : public CreatureScript _events.Reset(); } - void EnterCombat(Unit* /*who*/) override + void EnterCombat(Unit* /*who*/) override { _events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 4000); _events.ScheduleEvent(EVENT_MANABURN, 14000); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp index efc9a6e793b..e6bbbaa73a9 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp @@ -51,7 +51,7 @@ class boss_magmus : public CreatureScript _events.Reset(); } - void EnterCombat(Unit* /*who*/) override + void EnterCombat(Unit* /*who*/) override { _events.SetPhase(PHASE_ONE); _events.ScheduleEvent(EVENT_FIERY_BURST, 5000); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp index 0c36fe9696d..8342bef682b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp @@ -50,7 +50,7 @@ class boss_moira_bronzebeard : public CreatureScript _events.Reset(); } - void EnterCombat(Unit* /*who*/) override + void EnterCombat(Unit* /*who*/) override { //_events.ScheduleEvent(EVENT_HEAL, 12000); // not used atm // These times are probably wrong _events.ScheduleEvent(EVENT_MINDBLAST, 16000); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index ccdd92ae4ba..4303026ba64 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -1100,7 +1100,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript Talk(SAY_JAINA_ESCAPE_9); if (Transport* gunship = ObjectAccessor::GetTransport(*me, _instance->GetData64(DATA_GUNSHIP))) gunship->EnableMovement(true); - _instance->SetBossState(DATA_THE_LICH_KING_ESCAPE, DONE); + _instance->SetBossState(DATA_THE_LICH_KING_ESCAPE, DONE); break; case EVENT_ESCAPE_17: if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE) @@ -1139,7 +1139,7 @@ class npc_the_lich_king_escape_hor : public CreatureScript struct npc_the_lich_king_escape_horAI : public ScriptedAI { - npc_the_lich_king_escape_horAI(Creature* creature) : ScriptedAI(creature) + npc_the_lich_king_escape_horAI(Creature* creature) : ScriptedAI(creature) { _instance = me->GetInstanceScript(); _instance->SetBossState(DATA_THE_LICH_KING_ESCAPE, NOT_STARTED); @@ -1248,12 +1248,12 @@ class npc_the_lich_king_escape_hor : public CreatureScript _events.ScheduleEvent(EVENT_ESCAPE_SUMMON_WITCH_DOCTOR, 66000); _events.ScheduleEvent(EVENT_ESCAPE_SUMMON_LUMBERING_ABOMINATION, 14000); Talk(SAY_LK_ESCAPE_ICEWALL_SUMMONED_4); - break; + break; default: break; } } - + void EnterEvadeMode() override { if (_despawn) diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp index 3b6bd3d2cc8..81825c9055b 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.cpp +++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp @@ -45,7 +45,7 @@ inline LPTSTR ErrorMessage(DWORD dw) sprintf(msgBuf, "Unknown error: %u", dw); return msgBuf; } - + } //============================== Global Variables ============================= diff --git a/src/server/shared/Debugging/WheatyExceptionReport.h b/src/server/shared/Debugging/WheatyExceptionReport.h index f6d6b7f4b9e..e1cc3050929 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.h +++ b/src/server/shared/Debugging/WheatyExceptionReport.h @@ -83,7 +83,7 @@ struct SymbolPair bool operator<(const SymbolPair& other) const { - return _offset < other._offset || + return _offset < other._offset || (_offset == other._offset && _type < other._type); } diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 9f766a72d19..11e835566e9 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -382,18 +382,18 @@ class ByteBuffer return *this; } - uint8 * contents() - { + uint8 * contents() + { if (_storage.empty()) throw ByteBufferException(); - return &_storage[0]; + return &_storage[0]; } - const uint8 *contents() const - { + const uint8 *contents() const + { if (_storage.empty()) throw ByteBufferException(); - return &_storage[0]; + return &_storage[0]; } size_t size() const { return _storage.size(); } diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index c5424374f5a..6e4214603cb 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -201,24 +201,24 @@ int Master::Run() ACE_Based::Thread rarThread(new RARunnable); #if defined(_WIN32) || defined(__linux__) - + ///- Handle affinity for multiple processors and process priority uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0); bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false); #ifdef _WIN32 // Windows - + HANDLE hProcess = GetCurrentProcess(); - + if (affinity > 0) { ULONG_PTR appAff; ULONG_PTR sysAff; - + if (GetProcessAffinityMask(hProcess, &appAff, &sysAff)) { ULONG_PTR currentAffinity = affinity & appAff; // remove non accessible processors - + if (!currentAffinity) TC_LOG_ERROR("server.worldserver", "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", affinity, appAff); else if (SetProcessAffinityMask(hProcess, currentAffinity)) @@ -227,7 +227,7 @@ int Master::Run() TC_LOG_ERROR("server.worldserver", "Can't set used processors (hex): %x", currentAffinity); } } - + if (highPriority) { if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS)) @@ -235,9 +235,9 @@ int Master::Run() else TC_LOG_ERROR("server.worldserver", "Can't set worldserver process priority class."); } - + #else // Linux - + if (affinity > 0) { cpu_set_t mask; @@ -264,7 +264,7 @@ int Master::Run() else TC_LOG_INFO("server.worldserver", "worldserver process priority class set to %i", getpriority(PRIO_PROCESS, 0)); } - + #endif #endif -- cgit v1.2.3