Commit Graph
334 Commits
Author SHA1 Message Date
Shauren a937767289 Core/Misc: Exclude boost 1.78 and newer from boost_1_73_process_windows_nopch hack 2021-12-08 19:02:59 +01:00
jackpoz 49414acaef Core/CrashHandler: Remove sensitive data from crashlogs
(cherry picked from commit 25bcb1a0b2d9326519d9226dfe968caf26bb4e2d)
(cherry picked from commit 37478c5ac1efb8e4f19ffc94f444e160600c7b27)
2021-12-02 00:39:28 +01:00
jackpoz dc2fed13c8 Shared/Metric: Fix a rare memory leak
Fix a memory leak in Metric happening only when enabling/disabling Metric from configs at runtime, leaking the metric added between last SendBatch() call and the ScheduleSend() call in the same function. The only way to reproduce this is to actually freeze the thread calling SendBatch(), disable metric, reload config, unfreeze the thread.

(cherry picked from commit 0d1ff7446dce7b0641f49ac55a008669838612cd)
2021-12-02 00:39:20 +01:00
jackpoz 5600316c9f Core/Calendar: Improve calendar timezone handling
Improve calendar timezone handling by at least creating events with the correct time if both client and server are in the same timezone. There is currently no information received from the client about in which timezone it is.

(cherry picked from commit b33934f6ce9b0227597c712dd6a76b7ed49deea3)
2021-12-01 00:46:05 +01:00
Chaouki Dhib c19a4db1c1 Core/Movement: Add time synchronisation (#18189)
(cherry picked from commit 975f1e364a6a68be2beca261a64ea8aecc16f6f6)
2021-11-30 22:11:36 +01:00
jackpoz 43a41caafb Core/Misc: Fix GCC 8 warnings
(cherry picked from commit 1d04a3b216901671eae0104547715a570b1ff3ab)
2021-11-24 23:40:15 +01:00
Shauren c14cf5a892 Core/Misc: Added lambda support to EventProcessor
Closes #22909

(cherry picked from commit 813f693768ee94864b0d24423b9265bde2c9903d)
2021-11-23 23:01:47 +01:00
Giacomo Pozzoni 24f9b41622 Shared/Utilities: Handle string format exceptions
Handle StringFormat() exceptions in case of malformed string format to avoid causing unhandled exception crashes

(cherry picked from commit c79811de4fbf2b22cd74f55853516c7fc307055f)
2021-11-23 22:48:28 +01:00
jackpoz cb8b637061 Dep/Recast: Update recastnavigation to https://github.com/recastnavigation/recastnavigation/commit/14b2631527c4792e95b2c78ebfa8ac4cd3413363
Rebuilding mmaps IS required

(cherry picked from commit 5ff88ea04aec4677f1c1d669674e5442288a25e3)
2021-11-22 00:17:11 +01:00
jackpoz e9e3d2d69d Core/Utils: Handle UTF-8 conversion errors
Replace the output string when a UTF-8 conversion error happen with an error message instead of using an empty string, swallowing any message that the caller wanted to log.

(cherry picked from commit bdb7e6e5e81e0d9376c9c803bae9da470b02d8cd)
2021-11-21 14:38:29 +01:00
Treeston 549d5fea31 Core/Utils: some code style adjustments, 6d6077e follow-up
(cherry picked from commit 4c3af3b636d5e9279fb694c9d9a5a4422ad773d0)
2021-11-16 21:05:35 +01:00
Treeston 4f8fd56903 Core/Utils: Fix Unicode handling
(cherry picked from commit 6d6077e36fe9c5cb8ea8e4f981d637e72ee87037)
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 eee1f2cadf8174caca4849c22ba1fb8f12fc9e08)
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 9a924fb9d557434c5a2e4020c80db6e6bfe466ad)
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 9bf69b3849a9d78f3e8d174ed6367a259aaf876f)
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 338e8ba0fea8b4b15120c96fff15a6c4b1a52593)
(cherry picked from commit f7ca0877a3736000a6e3b4ed09ac5f08b4d8e3f0)
(cherry picked from commit 207093475a177e9fd29696e80fdd06a11324782d)
(cherry picked from commit ee68cf33921944fd3f8c188044906998cf10ff2a)
(cherry picked from commit c16d461e16f0704bb11040faff30953d33ba2188)
(cherry picked from commit f6b0d99e2c0bc22b44d6f3cfdae50cbba7d51de8)
(cherry picked from commit bc1f456125c1b6c90617a514152d69c40ce64886)
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 1dc675f0a17d9c7d1b6e9a07d5c25cdd79bb8788)
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 f27284594b18000a1c098262728fb19fdc63fc6c)
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 66a87c4642d25f27ca24254cfeb0a0c4b21036b1)
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 62db1fb683c13b8dde0cc359564e090e0594658f)
2021-10-23 16:02:44 +02:00
Keader c2666bd255 Utilities/EventProcessor: Added a overload to AddEventAtOffset accept rand time
(cherry picked from commit 4d9c36c8c3bc59afb74ffe336ff121c06812d645)
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 64a61e03ab0799b5437ddb9fe702c4912f3f9dd9)
2021-10-15 00:10:10 +02:00
Treeston 3418a33a87 Misc: Pass std::chrono types by value everywhere.
(cherry picked from commit 2ef9d301f0869b443122e2ba543af054c5b0e53c)
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 643b9209f8f1bc90fa4e26fc06e95f89b2b04899)
2021-10-06 11:45:54 +02:00
ccrs 4793b073ee Core/Misc: movement header cleanup
(cherry picked from commit f9914caefc59f36ab7583432442a26b29124b7f1)
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 b9c6bbb51df0ed10f74617482740fedb91ff5366)
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 2a84562dc85516f432bb1e5de9add23c28b26ce4)
2021-09-24 23:37:43 +02:00
Shauren 6ec73a7659 Core/Misc: Fix windows nopch build
Closes #25363

(cherry picked from commit 6ad58d604a63bacc13ee92c525189931d41d1e91)
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 db5c9867e2ffde3657f53bc155b474c5d46884dd)
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 d02f481d9ac8e1d1a7716368f609d53a5add0960)
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 4c0c4ab271ddc2d200cd9ccda98e16553dcaf391)
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 e42903ec16f4849b71bc8736e3151a1e11d3cd25)
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 45b2bcfaf266cac74806ed71f32b8dc02cd2321e)
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