Commit Graph

342 Commits

Author SHA1 Message Date
Treeston
0b61c3b7b1 [3.3.5] Core/Authserver: TOTP rewrite: (PR #23633)
- Proper management commands (.account 2fa)
- Secrets can now be encrypted (set TOTPTokenSecret in .conf)
- Secret now stored in binary
- Argon2 and AES primitives
- Base32/64 support

(cherry picked from commit 4211645834)
2021-12-18 20:24:50 +01:00
Treeston
28942db431 Common/Util: Sorry about that unexpected downtime at 3AM last night, everyone. (We call them happy little features.)
(cherry picked from commit a4d5b24874)
2021-12-18 15:33:44 +01:00
Treeston
51fbda4223 Core/Pooling: Quest pooling rewrite: (PR#23627)
- Split quest pooling from PoolMgr (into QuestPoolMgr)
- Proper saving/restoring on server restart
- No more hacking into sObjectMgr to insert/remove available quests

(cherry picked from commit a5e73e41c0)
2021-12-18 15:28:45 +01:00
Treeston
87c2d247d9 Core/Misc: Rewrite some old name handling functions that use raw buffers to no longer be old name handling functions that use raw buffers.
(cherry picked from commit 309851ea24)
2021-12-18 11:25:59 +01:00
Treeston
3388cea685 Core/Misc: Remove Trinity::Containers::Size (duplicate of advstd::size)
(cherry picked from commit f1d9a36c5f)
2021-12-17 21:57:41 +01:00
Treeston
3269c42789 Core/AI: No longer do strange things when told to enter evade mode while there's no need to do so, typically by terrible legacy code.
(cherry picked from commit 163f44c1b0)
2021-12-17 21:50:47 +01:00
Giacomo Pozzoni
493fe066f6 Core/Misc: Handle timezones for hour-specific events specifieds in worldserver.conf (#23540)
* Core/Misc: Handle timezones for hour-specific events specifieds in worldserver.conf

* Handle Respawn.RestartQuietTime too

* Handle XP.Boost.Daymask too

* Core/Misc: Code cleanup

* Core/Misc: Code cleanup

* Update Util.cpp

* Update boosted_xp.cpp

(cherry picked from commit aeddd417c4)
2021-12-16 22:35:44 +01:00
Treeston
611ddfee3c build fix after d1dc0e2
(cherry picked from commit c0f8e8535a)
2021-12-16 22:16:07 +01:00
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 25bcb1a0b2)
(cherry picked from commit 37478c5ac1)
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 0d1ff7446d)
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 b33934f6ce)
2021-12-01 00:46:05 +01:00
Chaouki Dhib
c19a4db1c1 Core/Movement: Add time synchronisation (#18189)
(cherry picked from commit 975f1e364a)
2021-11-30 22:11:36 +01:00
jackpoz
43a41caafb Core/Misc: Fix GCC 8 warnings
(cherry picked from commit 1d04a3b216)
2021-11-24 23:40:15 +01:00
Shauren
c14cf5a892 Core/Misc: Added lambda support to EventProcessor
Closes #22909

(cherry picked from commit 813f693768)
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 c79811de4f)
2021-11-23 22:48:28 +01:00
jackpoz
cb8b637061 Dep/Recast: Update recastnavigation to 14b2631527
Rebuilding mmaps IS required

(cherry picked from commit 5ff88ea04a)
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 bdb7e6e5e8)
2021-11-21 14:38:29 +01:00
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