Commit Graph

23 Commits

Author SHA1 Message Date
Peter Keresztes Schmidt
b527a031b9 Core/ChatCommands: Add std::wstring argument type (#25302)
(cherry picked from commit 617a769d6f)
2022-02-04 00:27:11 +01:00
Shauren
348acb105c Core/Commands: Exclude ambigious cast operator overloads from command Variant
Closes #25618

(cherry picked from commit b57530ebb1)
2022-02-03 00:22:24 +01:00
Peter Keresztes Schmidt
86bfde389a Scripts/Commands: Convert argument parsing of event commands to new system (PR #25275)
(cherry picked from commit 7bfeb03c13)
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 4286e7aa02)
2022-02-03 00:18:48 +01:00
Peter Keresztes Schmidt
1c246cc980 Core/ChatCommands: Parse SpellInfo also from enchant, glyph, talent and trade links (PR #25270)
(cherry picked from commit 9df61fd111)
2022-02-02 21:08:29 +01:00
Peter Keresztes Schmidt
fed56790ca Core/ChatCommands: Add Variant.get<typename> overload (PR #25267)
Co-authored-by: Treeston <treeston.mmoc@gmail.com>
(cherry picked from commit dfeaa2e81f)
2022-02-02 20:50:36 +01:00
Treeston
673521bc87 Core/ChatCommands: Move Trinity::ChatCommands::Variant from boost::variant to std::variant (for real this time)
(cherry picked from commit ffc3e355fe)
2022-02-02 20:49:42 +01:00
Peter Keresztes Schmidt
477618bd1f Core/ChatCommands: Add support for std::array-type arguments (#25261)
(cherry picked from commit 30a825e2ac)
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 7edad0d601)
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 df29f60595)
2022-01-26 22:16:24 +01:00
Peter Keresztes Schmidt
3923650aeb Core/ChatCommands: Add support for enum type arguments (PR #25242)
(cherry picked from commit 5e40eb20e2)
2022-01-26 22:13:06 +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 202fd41389)
2022-01-23 18:05:59 +01:00
Shauren
ff9816ef38 Core/Misc: Fixed outdated cherry-picked file headers 2021-12-26 22:05:54 +01:00
Treeston
a6332f5dec Core/Misc: C++17 cleanups, commit 3, the header commit
(cherry picked from commit ca0c50bc45)
2021-12-24 00:37:25 +01:00
Treeston
ea0aa63d96 Core/Misc: C++17 cleanups, commit 2, the advstd commit
(cherry picked from commit 857f8d9231)
2021-12-24 00:37:21 +01:00
Treeston
632609b897 Core/Misc: C++17 cleanups, commit 1
(cherry picked from commit ac9004a2f9)
2021-12-24 00:34:10 +01:00
Treeston
fdcef115e0 Core/Chat: Add SpellInfo const* handler for command args. Use it to update .cast <spellId/link> <triggered>.
(cherry picked from commit 7ac6ccb36b)
2021-12-24 00:34:08 +01:00
Shauren
8423382fb0 Core/Chat: Implement hyperlink validation for new link types 2021-10-31 23:07:56 +01: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
Shauren
fa7e46a4f3 Core/Commands: Parse character guid in achievement hyperlinks to ObjectGuid 2021-10-30 19:09:29 +02:00
Treeston
f91faa161c Core/ChatCommands: Implement achievement link parsing
(cherry picked from commit a4c666dc3d)
2021-10-25 15:06:41 +02:00
Treeston
6dc35e7beb Core/ChatCommands: Properly handle single-argument handlers (argument string discarded). Add special handling for on/off booleans.
(cherry picked from commit 37489eda93)
2021-10-25 00:05:36 +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