Commit Graph
100 Commits
Author SHA1 Message Date
Carbenium 9bee960880 Scripts/Commands: Convert argument parsing of instance commands to new system
(cherry picked from commit b90a4f1798bb948ce8203bd70d9367e6936b866a)
2022-03-13 00:15:35 +01:00
Peter Keresztes Schmidt 92a89ab6f3 Dep/fmt: Upgrade to 7.1.3 (#26816)
Printing enum values as integers was broken before 7.1.0.
Upgrade the library so we include commits

https://github.com/fmtlib/fmt/commit/20d4f2e83677be035a15693127e404c4a5d68ac9
https://github.com/fmtlib/fmt/commit/86287b8d5625ef390da6ef10fc77a872b8ad41ac

which fix the issue.

(cherry picked from commit 8a4844e029a12cb4dcaf361a3177559e19f94f12)
2022-03-12 23:52:29 +01:00
Carbenium b1847b1fd9 Scripts/Commands: Convert title commands to new system
(cherry picked from commit cd1ef2de0646349c4e0f23e8fb063c99a48c5cbf)
2022-03-12 23:06:24 +01:00
Carbenium b3b6e2715e Scripts/Commands: Convert rbac commands to new system
Note: To enable rbac commands for administrators permissions 202-206 have to be linked to permission 196.

Sample SQL for auth DB:
INSERT INTO `rbac_linked_permissions` VALUES (196, 202), (196, 203), (196, 204), (196, 205), (196, 206);

(cherry picked from commit f620befc37fd8a4aed917e1ebba6f268c44a0a99)
2022-03-12 23:00:17 +01:00
Carbenium 3c37dddeec Core/ChatCommands: AccountIdentifier from current target
(cherry picked from commit 8ee92147a5435600992d7269b98edd5d36cd8924)
2022-03-12 22:47:34 +01:00
Peter Keresztes Schmidt 28a7ca9183 Scripts/SholazarBasin: Fix a possible nullptr dereference issue found by coverity (#26648)
(cherry picked from commit 3bcda5acf4564b662db4dfde0af7279f99a93b79)
2022-03-11 14:33:57 +01:00
Carbenium 7b2ff1c1fc Scripts/Commands: Convert misc command table to new system
(cherry picked from commit 6b9afac82f18f88a7a981f16e970f1b65647f25b)
2022-03-11 14:08:17 +01:00
Carbenium e3730b7847 Scripts/Commands: Convert honor command table to new system
(cherry picked from commit 5a5b232a44b4bd7cdec7e23999d5edbba1891761)
2022-03-11 13:53:58 +01:00
Carbenium 548e5bf0c3 Build: Remove fine-grained CXX feature checks
With C++17 enabled these don't serve an purpose anymore.
See https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html

(cherry picked from commit 0ea73a29050493f53efa2101dc94c2bab302ac06)
2022-03-11 13:53:43 +01:00
Carbenium 169c6a522b Scripts/SholazarBasin: Make quest "Engineering a Disaster" more retail-like
* Use correct spells and add the appropriate spell scripts
* Use correct flame GOs
* Fix emotes of the escortee

(cherry picked from commit c08f086a02729f3b7e4c99f4741063e45301ebf8)
2022-03-11 12:54:22 +01:00
Peter Keresztes Schmidt bdd4ccbd78 Core/ChatCommands: Drop PlayerIdentifier's cast operators which could return nullptr (PR #25431)
(cherry picked from commit 8985fc4046e9a9b43d873e4d7b89a71afb910517)
2022-02-05 21:25:23 +01:00
Peter Keresztes Schmidt fd41de7ce3 Scripts/Commands: Convert argument parsing of lfg commands to new system (PR #25430)
(cherry picked from commit 0769d7726975a2fc848972a53f71efc4b6463e72)
2022-02-05 20:59:38 +01:00
Peter Keresztes Schmidt 26f3c25dae Scripts/Commands: Convert remaining debug commands (PR #25429)
(cherry picked from commit 062c55f1ab9c84396ce5b054945f5a908e3a354f)
2022-02-05 20:50:33 +01:00
Peter Keresztes Schmidt cb2a284359 Core/ChatCommands: Move ostream operator into Variant class so we don't pollute std:: (PR #25413)
(cherry picked from commit 68a4085427a898046b4afb73f6c369640418b848)
2022-02-05 13:58:04 +01:00
Peter Keresztes Schmidt 0257cdc8ca Core/ChatCommands: Do not try to consume integral types if the token is empty (PR #25320)
(cherry picked from commit 6079bc7f34250e65efa3dcbe5471382b217ebf24)
2022-02-04 00:27:12 +01:00
Peter Keresztes Schmidt 1a6564f42f Scripts/Commands: Convert argument parsing of some misc commands to new system (#25308)
* Core/Shared: Make WeatherType smart

* Scripts/Commands: Convert argument parsing of some misc commands to new system

(cherry picked from commit 5bab0e43c627c949bb5fb1d7fd014855c6c02b8e)
2022-02-04 00:27:12 +01:00
Peter Keresztes Schmidt 53b28572bf Scripts/Commands: Convert argument parsing of cast commands to new system (#25309)
(cherry picked from commit cefac75a7d17ea3263f24b6e0fb63c11f92a04ac)
2022-02-04 00:27:12 +01:00
Peter Keresztes Schmidt 582b8458ea Scripts/Commands: Fix two unreachable code issues found by PVS-studio (#25311)
(cherry picked from commit 3262ef447a9c41bef9a9a3d11f5a89a63137c4df)
2022-02-04 00:27:12 +01:00
Peter Keresztes Schmidt 5675d62159 Scripts/Commands: Convert argument parsing of message commands to new system (#25305)
(cherry picked from commit f17b9b20f10ed8e14cdddef395ff467053068d35)
2022-02-04 00:27:11 +01:00
Peter Keresztes Schmidt b527a031b9 Core/ChatCommands: Add std::wstring argument type (#25302)
(cherry picked from commit 617a769d6f8dc51d049296fbccca724713916ed4)
2022-02-04 00:27:11 +01:00
Peter Keresztes Schmidt e9209c3131 Scripts/Commands: Convert argument parsing of most list commands to new system (#25303)
(cherry picked from commit 522a4cb1a66539a656c44342d7652c3065a90588)
2022-02-04 00:27:11 +01:00
Peter Keresztes Schmidt 86bfde389a Scripts/Commands: Convert argument parsing of event commands to new system (PR #25275)
(cherry picked from commit 7bfeb03c136f18fda73474054c837f4fe8f11136)
2022-02-03 00:19:14 +01:00
Peter Keresztes Schmidt 3c82863c52 Core/ChatCommands: Check whether a passed numeric enum value is valid (#25285)
(cherry picked from commit 4286e7aa02e777268b25d8a5bcc1ee87f7b16c4d)
2022-02-03 00:18:48 +01:00
Peter Keresztes Schmidt 3ba767c438 Scripts/Commands: Convert argument parsing of gm commands to new system (#25279)
(cherry picked from commit 9c9e8c7d58cd0e939330089cfb555945ebbf73eb)
2022-02-03 00:10:31 +01:00
Peter Keresztes Schmidt 888d217c16 Scripts/Commands: Convert argument parsing of remaining go command to new system (#25284)
(cherry picked from commit 1aadf6c6d173e593eef0e9976e51a7189a54a8ce)
2022-02-03 00:08:21 +01:00
Carbenium a773039211 Scripts/Commands: Convert argument parsing of honor commands to new system
(cherry picked from commit 515a34f64f200ea0fb9722914b76ab8abd358891)
2022-02-02 23:02:41 +01:00
Peter Keresztes Schmidt dc5f7ee5fc Scripts/Commands: Convert argument parsing of deserter commands to new system (PR #25276)
(cherry picked from commit c952cb7f710f0aa558b1c94474be8d188967d019)
2022-02-02 22:32:46 +01:00
Peter Keresztes Schmidt 4aa1c74232 Scripts/Commands: Convert argument parsing of cheat commands to new system (PR #25277)
(cherry picked from commit 4707e059386333b6ceec419d0d2e684d9106aef6)
2022-02-02 22:21:51 +01:00
Peter Keresztes Schmidt ec26736e30 Scripts/Commands: Convert argument parsing of most debug commands to new system (PR #25260)
(cherry picked from commit 76f309b4e899d4f450a8448d49c1aa05f9d4e785)
2022-02-02 22:13:50 +01:00
Peter Keresztes Schmidt 37777ac6e8 Scripts/Commands: Convert argument parsing of ahbot commands (PR #25264)
(cherry picked from commit 426513ec8e154df7c13ba98371513dd9f6d2cb9d)
2022-02-02 21:17:51 +01:00
Peter Keresztes Schmidt 1c246cc980 Core/ChatCommands: Parse SpellInfo also from enchant, glyph, talent and trade links (PR #25270)
(cherry picked from commit 9df61fd111a39983d751ac0bed767137b330c547)
2022-02-02 21:08:29 +01:00
Carbenium c8b0d4e6d8 Scripts/Commands: Convert argument parsing of bf commands to new system
(cherry picked from commit fa6a8e8f647705c4631b7ed5d2dbd41e3b1d6b6b)
2022-02-02 20:50:49 +01:00
Peter Keresztes Schmidt fed56790ca Core/ChatCommands: Add Variant.get<typename> overload (PR #25267)
Co-authored-by: Treeston <[email protected]>
(cherry picked from commit dfeaa2e81f777fb40066d8a330e6ce6da4a6a66f)
2022-02-02 20:50:36 +01:00
Peter Keresztes Schmidt 477618bd1f Core/ChatCommands: Add support for std::array-type arguments (#25261)
(cherry picked from commit 30a825e2ac4d903329e3285e36b032c5533132d4)
2022-02-02 20:32:24 +01:00
Peter Keresztes Schmidt d33214c50a Core/ChatCommands: Do not parse partial strings for numeric paramters (PR #25259)
Check if integral/floating point type arguments were parsed successfully.

std::stoull will happily parse floating point strings until the decimal separator and return the value.
Make sure for all parsing methods that we actually parsed the whole token.

This allows to use handler arguments like Variant<uint32, float> which will be populated with the right type
depending on the token value (e.g "10" vs "10.0").

(cherry picked from commit 7edad0d601a7ae925cba850c5a23019f99be2a1e)
2022-01-26 22:30:13 +01:00
Peter Keresztes Schmidt 2d1a1d8ac3 Core/ChatCommands: Honor exact matches during enum arg parsing (PR #25255)
(cherry picked from commit df29f605959aa449a3962199ee1cac3e09e05e38)
2022-01-26 22:16:24 +01:00
Peter Keresztes Schmidt ec44c8296d Scripts/Commands: Use enum type arg for HandleDebugAnimCommand (PR #25256)
* Core/Shared: Make Emote enum smart
* Scripts/Commands: Use enum type arg for HandleDebugAnimCommand

(cherry picked from commit 86dc58974a46b554042f33df674e3e40ef0cec1e)
2022-01-26 22:16:05 +01:00
Peter Keresztes Schmidt 3923650aeb Core/ChatCommands: Add support for enum type arguments (PR #25242)
(cherry picked from commit 5e40eb20e2789b86d4786d86b4bbb8ae83de5e1e)
2022-01-26 22:13:06 +01:00
Peter Keresztes Schmidt 2e3c612c80 Core/Unit: Make HandleEmoteCommand typesafe (#25249)
* Scripts/ScarletMonastery: Fix wrong emote during Headless Horseman encounter

* Scripts/HoR: Fix wrong emote during escape event

* Core/Unit: Make improve type safety of HandleEmoteCommand

Change argument type to the expected enum type Emote

* Scripts/CoS: Use SetUInt32Value to set UNIT_NPC_EMOTESTATE

UNIT_NPC_EMOTESTATE is no flag field

(cherry picked from commit 6c7837f947ff4eb5110a116a371daa6f9e2b3bbe)
2022-01-26 21:46:51 +01:00
Peter Keresztes Schmidt 595e89e02b Core/Spells: Mark constructors of Spell/AuraScript handlers as explicit (#25248)
Mostly to make clang-tidy happier

(cherry picked from commit 34d403e83f42304332f89ffc73549f6f2c695ccd)
2022-01-26 20:57:27 +01:00
Carbenium d6c998a1a8 Core/Updater: Fix detection of the mysql binary when a directory is given as path
This ensures that we never pass a directory path StartProcess which results in a crash.

Closes #25216

(cherry picked from commit 98b1b20d6beea5e2fdea7e404e8d880953d4b2fb)
2022-01-26 18:41:14 +01:00
Carbenium c302ace100 Scripts/AzjolNerub: Fix potential error in pound spell script
Cast damage spell in AfterEffectApply instead OnEffectHitTarget. This avoids the scenario where we try to apply an aura to a potential dead target.

Ref #21856

(cherry picked from commit 0dd4b685df53d9b61a53aaf3a577c2a9ed8cdd47)
2022-01-26 14:37:05 +01:00
Peter Keresztes Schmidt 43591bb4d5 Scripts/AzjolNerub: Update Anub'Arak encounter to current coding standards (#25192)
* Scripts/AzjolNerub: Update Anub'Arak to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Darter to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Assassin to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Guardian to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Venomancer to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Impale Target to current coding standards

* Scripts/AzjolNerub: Update Anub'Arak Pound spell to current coding standards

* Scripts/AzjolNerub: Update Anub'Arak carrion beetles aura script to current coding standards

(cherry picked from commit dab8768c183dc43f970187a65961fc8fce647c29)
2022-01-24 22:32:11 +01:00
Peter Keresztes Schmidt 5b1ba7b503 Scripts/Gundrak: Update Slad'ran encounter to current coding standards (#25180)
* Scripts/Gundrak: Update Slad'Ran's script to use TaskScheduler

* No functional changes

* Scripts/Gundrak: Update Slad'Ran's adds to use TaskScheduler

* No functional changes

(cherry picked from commit 7abe9d66d049204240060f1976c51ff2297bf266)
2022-01-24 21:58:00 +01:00
Peter Keresztes Schmidt 35a348dfdb Scripts/Gundrak: Update Drakkari Colossus encounter to current coding standards (#25182)
* Scripts/Gundrak: Update Drakkari Colossus to current coding standards

* no functional changes

* Scripts/Gundrak: Update Drakkari Elemental to current coding standards

* no functional changes

* Scripts/Gundrak: Update Living Mojo to current coding standards

* no functional changes

(cherry picked from commit dd8666f38d6aad6401e8e303c57c62255856f5a4)
2022-01-24 21:55:10 +01:00
Peter Keresztes Schmidt 0c65abe7a0 Scripts/MoltenCore: Update Golemagg encounter to current coding standards (#25183)
* Scripts/MoltenCore: Update Golemagg to current coding standards

* no functional changes

* Scripts/MoltenCore: Update Core Ranger to current coding standards

* no functional changes

(cherry picked from commit c88234727b47c037557eba6db8ae8ef1dee4eed7)
2022-01-24 21:54:10 +01:00
Carbenium 7e0fb710ad Scripts/AhnKahet: Update Herald Volazj to current coding standards
* convert to BossAI
* no functional changes

(cherry picked from commit 90543fd41db309d924a3d45939bd23cffb9f5b67)
2022-01-24 21:53:52 +01:00
Carbenium 18e5e1ef43 Scripts/AV: Update Vanndar's script to use TaskScheduler
* No functional changes

(cherry picked from commit 799d5376d8d7e2c9c0fc1e27cfadf2669a8724d0)
2022-01-24 21:35:52 +01:00
Carbenium 8809d54ca2 Core/Common: Merge TimeTrackerSmall with TimeTracker
(cherry picked from commit 228696bf80bcd55d35445cd24ae119020c310f88)
2022-01-24 21:34:36 +01:00
Carbenium 35e0002df3 Core/Common: Add a std::chrono interface to TimeTrackerSmall
New methods:
TimeTrackerSmall(Milliseconds expiry);
void Update(Milliseconds diff);
void Reset(Milliseconds expiry)
Milliseconds GetExpiry() const

Removed methods:
int32 GetExpiry() const

Also add basic unit tests.

Core/Scripts: Use std::chrono interface of TimeTrackerSmall

(cherry picked from commit e55516348dbabaa8c9d559426315f3f70967acaa)
2022-01-24 21:25:47 +01:00
Carbenium b3f2ff97ff Core/CreatureAI: std::chrono-ify DoSummon* methods
(cherry picked from commit 1245833cdd9988a2ac9c3a9374b40e76a53d889a)
2022-01-24 13:11:13 +01:00
Carbenium 82fce41852 Core/WorldObject: Replace non-std::chrono SummonGameObject overloads
Also fix intended despawn time of GOs used by the "Engineering a Disaster" quest

(cherry picked from commit 8642aaaf9268364454b409db7eb62f31210e6d6c)
2022-01-24 12:55:43 +01:00
Carbenium 217c2d9ef3 Core/WorldObject: Replace non-std::chrono SummonTrigger overloads
(cherry picked from commit 3620b47c412d88cc2e0ab10e2654913e5487c8ac)
2022-01-24 12:47:56 +01:00
Carbenium 3bba8d50b1 Core/WorldObject: Remove non-std::chrono SummonCreature overload
Remove
TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0);

(cherry picked from commit a41f599be72ccc88b13c1cf725f20cee4a5335d7)
2022-01-24 12:39:59 +01:00
Carbenium 03e4c0d7bf Core/Creature: Remove non-std::chrono overload of DespawnOrUnsummon
(cherry picked from commit 480dee3125929181b7004810516ea673c61f5811)
2022-01-24 12:21:26 +01:00
Carbenium a7cbb16229 Core/EventProcessor: std::chrono-ify the remaining public API
(cherry picked from commit 1d8782e3566393f71fbc091de57c96a9a15972cb)
2022-01-24 12:06:56 +01:00
Carbenium eeffb310de Core/EventProcessor: std::chrono-ify CalculateTime
uint64 CalculateTime(uint64 t_offset) has been replaced with Milliseconds CalculateTime(Milliseconds t_offset).
Also add the std::chrono-ified overload void AddEvent(BasicEvent*, Milliseconds, bool)

(cherry picked from commit 92a02a5c8750913f596d7e3b58bf8439cb770c28)
2022-01-24 12:00:35 +01:00
Carbenium 310f996b1d Core/WorldObject: Partially std::chrono-ify SummonCreature overloads
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0);
to
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime = 0s);

(cherry picked from commit 1131229ee9c43704b11187f0b11c327db92018b6)
2022-01-24 11:55:32 +01:00
Carbenium 906a47b161 tests/EventMap: Add tests for Repeat
(cherry picked from commit e6f36f83b8af4d973a96f01c6095b075dd12f5d5)
2022-01-24 00:01:48 +01:00
Carbenium da17942af9 Core/EventMap: Clarify documentation of ScheduleEvent
(cherry picked from commit 7865c1c197f4eb9165ef3ab26eb4f750a5b58960)
2022-01-24 00:01:38 +01:00
Carbenium a5d85deced Core/EventMap: Unify semantics of DelayEvents
DelayEvents(Milliseconds delay) had different semantics than
DelayEvents(Milliseconds delay, uint32 group).
The first method delayed the events only in the case the internal timer
already ticked at least for the amount of delay. In contrast the latter method
delayed events regardless of the internal timer value.

Use the latter semantics for DelayEvents(Milliseconds delay) as well which makes
the outcome more predictable. Adapt tests accordingly.

(cherry picked from commit 4470b9122379dc846b322a441951a03913912b71)
2022-01-24 00:01:25 +01:00
Carbenium 5512eb2f8f tests/EventMap: Test for event past it's execution time
With the switch to std::chrono return type of GetTimeUntilEvent
we don't run into an overflow condition which happend with the previous
uint32 return value if the events scheduled execution time is in the past.
Test for this case.

(cherry picked from commit e877f988d1c4e1361612f3d5c4ebe915f746aee5)
2022-01-24 00:00:47 +01:00
Carbenium 27c1f47598 EventMap: Change GetTimeUntilEvent to return std::chrono types
(cherry picked from commit 8cb35b0d5f1462387033e6bd2f99d0ea829fdcd8)
2022-01-23 23:59:46 +01:00
Carbenium 7847589d9c EventMap: Switch internal timer over to std::chrono type
Adds the EventMap::Update(Milliseconds time) overload

(cherry picked from commit b9795e44824c7cab58445e4a72d2113ddb451caa)
2022-01-23 23:59:32 +01:00
Carbenium a28bc7faaa Scripts/Kalimdor: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 40efda9726dce4fc6f432852f8d41bee606872b7)
2022-01-23 23:59:11 +01:00
Carbenium 38695b0943 Scripts/World+Outland+Spells: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 5832790428b124876ba48eacaf47806fd10a3c47)
2022-01-23 23:58:48 +01:00
Carbenium 271462ceec Scripts/Northrend: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit fc9e7226c0785fd12b01b724ed3666e6c08dd017)
2022-01-23 23:57:56 +01:00
Carbenium b8a3ab880f Core/Misc: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit c39eb9b5041950ce3af89f82848bd3e1f3a6e0af)
2022-01-23 23:56:25 +01:00
Carbenium 58e1c091a2 Scripts/EasternKingdoms: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit d1a39a2ebf3bb55998696c424cd58f3fcdedd66a)
2022-01-23 23:53:20 +01:00
Carbenium 5f5d32888a Core/EscortAI: std::chrono-ify SetPauseTimer
(cherry picked from commit cdaf890af4b5bb7ce256752b49bba2c0f3ed9264)
2022-01-23 23:34:52 +01:00
Carbenium 14e9513cea Core/EscortAI: std::chrono-ify AddWaypoint
(cherry picked from commit 4b9fdc5d3d1278269aaf218cea94f23688e4bca1)
2022-01-23 23:34:40 +01:00
Carbenium e660b870e9 Core/ScriptedAI: std::chrono-ify DoSpawnCreature
(cherry picked from commit f5076112cb25bff877a450a14fe20172e9044081)
2022-01-23 23:33:04 +01:00
Carbenium da438c73e2 Core/BossAI: Remove _DespawnAtEvade(uint32, Creature*) overload
Use _DespawnAtEvade(Seconds,  Creature*) instead

(cherry picked from commit 27229c10cd6813e69ea6db69384312b1854b2b57)
2022-01-23 23:28:47 +01:00
Carbenium 5f296fb7c7 Core/InstanceScript: std::chrono-ify DoRespawnGameObject
(cherry picked from commit d7ff8c272ad016296e1eed5aae325e4e5058ddd8)
2022-01-23 23:09:27 +01:00
Carbenium 7c43afa471 Core/Utilities: Add custom _days chrono literal
(cherry picked from commit d5de96e46bf52ccb2fffe01c0709f9238977a80e)
2022-01-23 23:08:21 +01:00
Carbenium b336ed8996 Build: Add WITH_LD_GOLD option to use gold linker on unix
gold is an ELF-only linker which has a better performance
than the default ld.

(cherry picked from commit 796e2b32e03e7b1a56e44bd4b8988f9156bbb026)
2022-01-23 23:07:56 +01:00
Peter Keresztes Schmidt 10f835b058 Common/Crypto: #ifdef out unnecessary locking code for OpenSSL 1.1+ (PR #25110)
(cherry picked from commit 7ea33120a03d70aaa856c2c66f183d684131746e)
2022-01-23 23:07:33 +01:00
Carbenium ddeae5e7d2 tests: Add some basic tests for EventMap
(cherry picked from commit 7950275697c9d48781ad61cf3749e0392ee660bc)
2022-01-23 22:48:58 +01:00
Carbenium f837f28171 dep: Add catch2 unit test framework and wire it up
To enable the test suite, make sure to configure CMake with -DBUILD_TESTING=1 , since it is disabled by default. The catch2 dependency will be downloaded during configure time.

Also add a new target "tests-common", which includes unit tests for the "common" project. To finally run the tests use the "test" target.

CircleCI: Run unit tests
(cherry picked from commit 6a28ee7b2a4269aa7e43265d1cd0067537e3e883)
2022-01-23 22:48:35 +01:00
Peter Keresztes Schmidt 3499f518b5 EventMap: Remove GetNextEventTime and GetTimer methods (PR #25092)
(cherry picked from commit 6ab9922171cf6e2877c39f503bcf987dd9faa898)
2022-01-23 22:20:20 +01:00
Carbenium 330e7100cb Core/Scripts: Fix timing issue of EVENT_FLY_TO_RANDOM_PILLAR during Illidan encounter
The intention here is to add additional 30 seconds of delay to the current delay of EVENT_FLY_TO_RANDOM_PILLAR.
Instead of EventMap::GetNextEventTime, EventMap::GetTimeUntilEvent has to be used which returns the currently
scheduled delay until the event occurs.
EventMap::GetNextEventTime instead exposes the timer value internal to EventMap at which the event should occur.

(cherry picked from commit f1f251eb381bccc9164e29a81da9e013090543a4)
2022-01-23 22:19:24 +01:00
Carbenium c8a4cc8068 TaskScheduler: use randtime instead of custom implementation
(cherry picked from commit f773bf68e0f96a97b706f366da4071ba28060b04)
2022-01-23 22:18:14 +01:00
Peter Keresztes Schmidt 44ea32ace4 Build: Enable -Wimplicit-fallthrough on clang (#25056)
* Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs

Related: #25006

* Misc: Add some missing breaks (no-ops) to satisfy clang

Related: #25006
Closes #25055

* Build: Enable -Wimplicit-fallthrough on clang

Closes #25006
2022-01-23 22:16:15 +01:00
Peter Keresztes Schmidt ad340466d0 Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs (#25054)
Related: #25006
(cherry picked from commit 85b5b842ca6c05d4e51081e6c3282940a80f3761)
2022-01-23 22:02:03 +01:00
Peter Keresztes Schmidt dfc1f08bd8 Misc: Remove some unneeded/duplicated includes (#25051)
(cherry picked from commit ddf16ae4d9eff6e849618bb6c5a00603f26daa93)
2022-01-23 20:48:12 +01:00
Peter Keresztes Schmidt 770fbcca0c Core/Misc: Replace boost::optional with std::optional (#25047)
C++17 is already mandatory, so it's a safe thing to do

(cherry picked from commit 202fd41389973322f63186fd8e5a368fce3e1b04)
2022-01-23 18:05:59 +01:00
Peter Keresztes Schmidt cd86a015c4 Core/Util: Remove EventMap's non-std::chrono::duration based interface (#25049)
Closes #25012

(cherry picked from commit ce1e2c0f9b4f80e1fa5c448ee12fec43204a3634)
2022-01-23 16:39:31 +01:00
Peter Keresztes Schmidt 54d3110ca7 Scripts/World+Pet: Use std::chrono::duration overloads of EventMap (#25017)
Contributes to #25012

(cherry picked from commit 0072fa922db1642d720c545ccc2ac095c140f0ca)
2022-01-23 16:02:35 +01:00
Peter Keresztes Schmidt ce8c0da4fe Scripts/Icecrown Citadel: Use std::chrono::duration overloads of EventMap (Part 2) (#25041)
Part 2: gunship battle and Sindragosa

Contributes to https://github.com/TrinityCore/TrinityCore/issues/25012

(cherry picked from commit 6968e7a1a1d638cc43409e7ab5e96f2e4854fe69)
2022-01-23 16:02:25 +01:00
Peter Keresztes Schmidt 0195ec8945 Scripts/Icecrown Citadel: Use std::chrono::duration overloads of EventMap (#25036)
Part 1: without gunship battle and Sindragosa

Contributes to #25012

(cherry picked from commit 5eaff8a3bcc4a81ca27e19418f0c508966ad3c7f)
2022-01-23 16:02:00 +01:00
Peter Keresztes Schmidt 253cbf5678 Scripts/Tempest Keep: Use std::chrono::duration overloads of EventMap (#25040)
Contributes to #25012

(cherry picked from commit 2d9c5979a6a6d9244f557ff5653694ce5b8f19a4)
2022-01-23 16:01:09 +01:00
Peter Keresztes Schmidt c3228cc252 Scripts/Utgarde Keep: Use std::chrono::duration overloads of EventMap (#25039)
Contributes to #25012

(cherry picked from commit f00ab389d60cd5c8ba44ec8c6a49369c70a95d8b)
2022-01-23 16:00:59 +01:00
Peter Keresztes Schmidt 8e7c368220 Scripts/Magisters Terrace: Use std::chrono::duration overloads of EventMap (#25038)
Contributes to #25012

(cherry picked from commit 88314660b66637982d629b786630af0dc0323eab)
2022-01-23 16:00:43 +01:00
Peter Keresztes Schmidt d62b7c1e35 Core/CombatAI: Use std::chrono::duration overloads of EventMap (#25037)
Contributes to #25012

(cherry picked from commit bd837d4c3dc61e7817ccb14071108e97db86f1f5)
2022-01-23 16:00:27 +01:00
Peter Keresztes Schmidt b27c70aff2 Scripts/Ulduar: Use std::chrono::duration overloads of EventMap (#25035)
Contributes to #25012

(cherry picked from commit d4bce9f4d2d6059740e5bcc146ffa8d98f715d6f)
2022-01-23 15:49:50 +01:00
Peter Keresztes Schmidt b7d5a1653d Scripts/Nexus: Use std::chrono::duration overloads of EventMap (#25033)
Contributes to #25012

(cherry picked from commit 2f538258d9e2e1162766efaee8cb61eeae4f921e)
2022-01-23 15:49:27 +01:00
Peter Keresztes Schmidt ef5f874cea Scripts/Naxxramas: Use std::chrono::duration overloads of EventMap (#25032)
Contributes to #25012

(cherry picked from commit 6eec0bc50f40892275934ae91d410b63ecbe2dfd)
2022-01-23 15:49:09 +01:00
Peter Keresztes Schmidt 65e1b79547 Scripts/Isle of Conquest: Use std::chrono::duration overloads of EventMap (#25031)
Contributes to #25012

(cherry picked from commit 1a32b0f5b3c64bad4f379a45e5e7b07f00fe774e)
2022-01-23 15:49:01 +01:00
Peter Keresztes Schmidt 3d9885a302 Scripts/Gundrak: Use std::chrono::duration overloads of EventMap (#25030)
Contributes to #25012

(cherry picked from commit 3a9b3259b8eb2f35af29135fd9c9c0c44e3e47d2)
2022-01-23 15:48:52 +01:00
Peter Keresztes Schmidt e6e4edd768 Scripts/Frozen Halls: Use std::chrono::duration overloads of EventMap (#25029)
Contributes to #25012

(cherry picked from commit 19ee4d6254370de3f174718a72e5055aa28b6102)
2022-01-23 15:48:41 +01:00