Commit Graph

324 Commits

Author SHA1 Message Date
Treeston
549d5fea31 Core/Utils: some code style adjustments, 6d6077e follow-up
(cherry picked from commit 4c3af3b636)
2021-11-16 21:05:35 +01:00
Treeston
4f8fd56903 Core/Utils: Fix Unicode handling
(cherry picked from commit 6d6077e36f)
2021-11-16 21:04:53 +01:00
jackpoz
9dcbccce26 Core/Misc: Fix vsnprintf usage in ASSERT()
Fix vsnprintf to follow standard definition and not some old VC++ behavior, not requiring to include the '\0' character in the count parameter

(cherry picked from commit eee1f2cadf)
2021-11-16 20:37:27 +01:00
Giacomo Pozzoni
d5c41d23e6 Core/Misc: Log more information in asserts (#22783)
* Core/Misc: Log more information in asserts

Add a new function GetDebugInfos() to types that could trigger an ASSERT() to easily include more useful information in crashlogs.
This is an initial commit that requires many more commits to implement the new GetDebugInfos() function in all required types.
If the type doesn't have the function, the global default one is picked which doesn't log anything.

* Core/Misc: Fix dynamic build

Add missing attribute for dynamic build

* Core/Misc: Fix gcc/clang build

* Core/Misc: Rename GetDebugInfos() to GetDebugInfo()

* Core/Misc: Fix FormatAssertionMessage() adding an extra '\0'

* Core/Misc: Add GetDebugInfo support to Unit

* Core/Misc: Add GetDebugInfo support to Creature

* Core/Misc: Add more info to GetDebugInfo for Creature

* Core/Misc: Add GetDebugInfo support to GameObject

* Core/Misc: Add GetDebugInfo support to Player

* Core/Misc: Add more GetDebugInfo info

* Core/Misc: Add GetDebugInfo support to Item

* Core/Misc: Add GetDebugInfo support to Bag

* Core/Misc: Add GetDebugInfo support to Transport

* Core/Misc: Add GetDebugInfo support to TempSummon, Minion, Guardian, Pet

* Core/Misc: Add GetDebugInfo support to Map, InstanceMap

* Core/Misc: Add GetDebugInfo support to Spell

* Core/Misc: Fix build warning

* Core/Misc: Add GetDebugInfo support to Aura

* Core/Misc: Add GetDebugInfo support to UnitAI

(cherry picked from commit 9a924fb9d5)
2021-11-16 20:36:58 +01:00
Warpten
1d4efe2986 Fix invalid arguments to string format in Trinity::Fatal
Isn't whatever is used nowadays to make this stuff safe supposed to prevent this sort of stuff?

(cherry picked from commit 9bf69b3849)
2021-11-15 21:34:44 +01:00
Treeston
c977087d58 Core/Misc: Partial merge of 3.3.5-dbedit:
- Added SmartEnum.h for enum iteration, stringification, and more, courtesy of krabicezpapundeklu/smart_enum
- Moved a bunch of enums in SharedDefines.h to the new system
- Miscellaneous utility methods ported

Core/Util: Redesign SmartEnum to properly work for large
 enums (>64 entries) and play nice with IDEs (PR #22768)

(cherry picked from commit 338e8ba0fe)
(cherry picked from commit f7ca0877a3)
(cherry picked from commit 207093475a)
(cherry picked from commit ee68cf3392)
(cherry picked from commit c16d461e16)
(cherry picked from commit f6b0d99e2c)
(cherry picked from commit bc1f456125)
2021-11-15 21:34:03 +01:00
Treeston
12e76f085f Core/Misc: Add a missing include of Windows.h to Errors.cpp
(that last one wasn't me!)

(cherry picked from commit 1dc675f0a1)
2021-11-12 00:16:29 +01:00
Shauren
270db9a352 Core/DataStores: Add a bit more info to db2 file loader sign check assertions 2021-11-04 22:27:28 +01:00
Shauren
8866065117 Core/Misc: FIx a GCC warning 2021-10-31 01:39:10 +02:00
Treeston
e506c80a64 Core/Chat: Unify chat hyperlink parsing (PR #22417)
- Validate most link properties all the time
- If enabled, also validate link text (needs locale)
- Instead of blocking the entire message, sanitize it
- Apply filtering to DND/AFK messages. Closes #22399

(cherry picked from commit f27284594b)
2021-10-31 01:39:04 +02:00
ModoX
94b14e4f63 Core/Conversations: Dropped time fields and calculate them using db2 data (#27151) 2021-10-26 22:49:12 +02:00
Treeston
0c681b6509 Scripts/Commands: New argument parsing methodology (PR #22363)
- Detect the arguments accepted by the command handler
- Tokenize out those arguments automatically and feed them to the handler
- Unmatched rest of the string can be accepted by trailing char const* or CommandArgs*

(cherry picked from commit 66a87c4642)
2021-10-25 00:03:23 +02:00
Shauren
23ec4b4075 Core/DataStores: Hackfix broken db2 files that have invalid id tables 2021-10-24 01:28:40 +02:00
Shauren
d181c1da75 Core/CrashHandler: Include assertion messages in crash reports
(cherry picked from commit 62db1fb683)
2021-10-23 16:02:44 +02:00
Keader
c2666bd255 Utilities/EventProcessor: Added a overload to AddEventAtOffset accept rand time
(cherry picked from commit 4d9c36c8c3)
2021-10-23 00:23:22 +02:00
Treeston
839d30e93b Common/Containers: Eliminate a edge case that could potentially lead to object invalidation.
(cherry picked from commit 64a61e03ab)
2021-10-15 00:10:10 +02:00
Treeston
3418a33a87 Misc: Pass std::chrono types by value everywhere.
(cherry picked from commit 2ef9d301f0)
2021-10-14 19:39:42 +02:00
Shauren
73e6cf4d27 Core/Misc: Fix another gcc warning 2021-10-06 12:19:05 +02:00
Treeston
ad7ed86aad Common/Misc: Clean-up a GCC sign comparison warning
(cherry picked from commit 643b9209f8)
2021-10-06 11:45:54 +02:00
ccrs
4793b073ee Core/Misc: movement header cleanup
(cherry picked from commit f9914caefc)
2021-09-26 01:22:17 +02:00
Shauren
453b59de57 Core/Maps: Adjusted logic in GetFullTerrainStatusForPosition to closer match what the client does regarding being inside WMOs
Closes #21625
Closes #21624
Closes #21516

(cherry picked from commit b9c6bbb51d)
2021-09-25 01:04:21 +02:00
Treeston
1493920495 Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
- Chase to angle is now functional. Pets use this to chase behind the target. Closes #19925.
- Chase to arbitrary range interval works. Not used anywhere, but you can technically make hunter-like mobs.
- Pets now follow the hunter cleanly and without stutter stepping. Also fix some other things. Closes #8924.

(cherry picked from commit 2a84562dc8)
2021-09-24 23:37:43 +02:00
Shauren
6ec73a7659 Core/Misc: Fix windows nopch build
Closes #25363

(cherry picked from commit 6ad58d604a)
2021-08-31 13:48:40 +02:00
jackpoz
89a232de3a Core/Misc: Add PERFORMANCE_PROFILING CMake option
Add a new CMake option called PERFORMANCE_PROFILING that should be used only when profiling the performance.
This option is unsupported, do not report any issue happening when enabling this option.

(cherry picked from commit db5c9867e2)
2021-08-08 21:21:34 +02:00
Treeston
88c1739e3e Core/Movement: Creatures' idle movement generator can no longer override player mover control.
Tagging #20310, partial fix.

(cherry picked from commit d02f481d9a)
2021-06-19 23:33:38 +02:00
Shauren
31ef525ecd Core/Misc: Add container utility function Trinity::Containers::EnsureWritableVectorIndex to replace if (i >= vec.size()) vec.resize(i + 1) copypaste everywhere 2021-06-13 00:59:15 +02:00
Shauren
b29cc8f31a Fix build 2021-05-29 22:04:49 +02:00
Shauren
6ecfe58cae Core/Maps & Extractors: Move copypasted map file headers into a single shared file and replace #defines with enums 2021-05-29 21:21:37 +02:00
Shauren
2de6e56d29 Core/Misc: Rename MapDefines.h to MMapDefines.h as it contains mmap defines exclusively 2021-05-29 14:48:18 +02:00
Shauren
480039f913 Core/Logging: Add functions that allow creating loggers and appenders from other sources than config files 2021-05-27 11:47:51 +02:00
Shauren
3c08eb190f Core/Misc: Add another boost hack. Fixes bnetserver/worldserver -c command line parameter when path contains spaces 2021-05-24 00:08:03 +02:00
Shauren
622cec8a8f Core/Vmaps: Fixed crash in unloading vmaps
Closes #26536
2021-05-21 12:31:21 +02:00
Shauren
67e16888ac Core/Chat: Chat translation improvements
* Remove hyperlinks from translated chat messages
* Implement case preservation rules depending on receiver client locale
2021-05-03 23:53:24 +02:00
Shauren
20aeb63026 Core/Vmaps: Extract more doodad sets 2021-04-25 00:11:42 +02:00
Shauren
e821693c16 Core/Vmaps: Reduce memory used by vmaps, part 2 2021-04-25 00:11:42 +02:00
Shauren
bb8f22ed20 Core/Vmaps: Reduce memory used by vmaps (and their size, slightly) 2021-04-25 00:11:36 +02:00
jackpoz
5b4f61d915 Core/Crash reporting: Add support to char* arrays
Add support to char* array showing the string value instead of the pointer address

(cherry picked from commit 4c0c4ab271)
2021-04-16 21:03:23 +02:00
Jeremy
446fc391f0 Core/Entities: Fix some weird movement due to los issues (#21125)
* Core/Entities: Fix some weird movement due to los issues
- Made LoS check use collisionHeight instead of midsection. Value was too low.
- Gnomes will now have a breath bar more quickly than for example a tauren.
- Changes have been made to checking for ground z as well, some tweeking might be needed but removed most of the scattered +2.0f/+0.5f/we
* Add 0.05f to isInAir check in Creature::UpdateMovementFlags

(cherry picked from commit e42903ec16)
2021-04-15 05:53:27 +02:00
jackpoz
8313053a3b Shared/Metric: Fix crash on shutdown
Fix crash on shutdown with metrics enabled but InfluxDB stopping before worldserver

(cherry picked from commit 45b2bcfaf2)
2021-03-15 20:17:31 +01:00
Traesh
56e9560661 Core/Spells Handle auras 328 & 396 (SPELL_AURA_TRIGGER_SPELL_ON_POWER_*) 2021-03-05 23:25:51 +01:00
Shauren
55eef73c48 Core/PacketIO: Increase max allowed incoming packet size for CMSG_HOTFIX_REQUEST 2021-03-02 01:06:28 +01:00
jackpoz
246871e3d5 Shared/Metric: Stop metrics on shutdown
Properly stop metric information gathering and sending on shutdown.
Issue reported by AddressSanitizer.

(cherry picked from commit e9c475d45f)
2021-02-25 18:50:55 +01:00
jackpoz
96406e3408 Core/Crash reporting: Fix buffer overflow
(cherry picked from commit c7043b25f6)
2021-02-25 18:50:55 +01:00
Treeston
2c0b94a000 Some misc streamlining/cleanup:
- std::chrono overloads for SummonCreature
- Removed misleading const qualifier from SummonCreature (it wasn't being honored)
- Rename parameters of SummonCreature to follow convention
- EventProcessor has a new method (AddEventAtOffset) that adds an event...at an offset. Genius.

PS: Hi there Keader.
(cherry picked from commit 76a4c7d974)
2021-02-25 18:50:55 +01:00
jackpoz
159aa97d72 Dep/Recast: Update recastnavigation to 2c85309280
(cherry picked from commit 7ef22e4305)
2021-02-15 19:13:25 +01:00
jackpoz
1c24819741 Core/Misc: Fix static analysis issues
(cherry picked from commit 97f33dc779)
2021-02-06 21:41:51 +01:00
Shauren
5a0e348a95 Dep/Boost: Support for boost 1.74 - heap
Closes #25470

(cherry picked from commit 868c82aa6c)
2020-12-12 18:50:19 +01:00
Shauren
98939d258a Dep/Boost: Partial support for boost 1.74 - asio
Ref #25470

(cherry picked from commit 155e37831e)
2020-12-12 18:50:13 +01:00
Shauren
7a406db506 Core/Collision: Fixed false positive errors in console about vmap loading 2020-12-08 18:16:47 +01:00
Shauren
c5d2299365 Core/Misc: Added another overload to MakeIteratorPair (and constexpr IteratorPair) 2020-12-08 18:16:47 +01:00