EverWrath/src/server/game/Handlers
Kitzunu ebf5f6710a
feat(Core/Chat): Provide a fully-formed protocol for addons to intera… (#19305)
* feat(Core/Chat): Provide a fully-formed protocol for addons to interact with GM commands

* Send success/fail state, allow interleaving, and indicate end of output. Add framework for supporting non-human-readable output in commands.

* cherry-pick commit (508c9d2fc1)

This PR implements a well-formed protocol for addons to communicate with the server, outlined below:

- All communication happens over the addon channel (`LANG_ADDON` in terms of the core, `CHAT_MSG_ADDON`/`SendAddonMessage` for the client). The prefix used for all messages is `AzerothCore` (in client terms - in core terms, every message starts with `AzerothCore\t`).
- In each message, the first character is the opcode. The following four characters are a unique identifier for the invocation in question, and will be echoed back by the server in every message related to that invocation. Following is the message body, if any.
- The following opcodes are supported:
    - Client to server:
        - `p` - Ping request. The core will always respond by ACKing with the passed identifier. No body.
        - `i` or `h` - Command invocation. The message body is the command text without prefix. `i` requests machine-readable output, `h` requests human-readable.
    - Server to client:
        - `a` - ACK. The first message sent in response to any invocation (before any output). No body.
        - `m` - Message. Sent once per line of output the server generates. Body = output line.
        - `o` - OK. Indicates that the command finished processing with no errors. No body.
        - `f` - Failed. Indicates that command processing is done, but there was an error. No body.

Expected overhead is minimal, and this integrates seamlessly with existing command scripts (no changes necessary).

PS: There's also a client-side addon library that exposes this protocol in a developer-friendly way over at https://github.com/azerothcore/LibAzerothCore-1.0

---------

Co-authored-by: Treeston <14020072+Treeston@users.noreply.github.com>
2024-07-06 19:13:24 +02:00
..
AddonHandler.cpp refactor(Core/Logging): switch to fmt style for LOG_ (#10366) 2022-01-27 16:44:41 +01:00
AddonHandler.h feat(License): add new headers information about license (#7941) 2021-09-30 13:40:52 +07:00
ArenaTeamHandler.cpp refactor(Core/Network): remove redundant logging calls from some message handlers (#17565) 2023-11-08 21:53:43 +01:00
AuctionHouseHandler.cpp fix(Core): Fix item disappearing on selling item on auction (#18090) 2024-01-01 08:01:22 -03:00
AuthHandler.cpp feat(License): add new headers information about license (#7941) 2021-09-30 13:40:52 +07:00
BankHandler.cpp refactor(Core/Network): remove redundant logging calls from some message handlers (#17565) 2023-11-08 21:53:43 +01:00
BattleGroundHandler.cpp feat(Core/Unit): New helper IsClass and script hook OnPlayerIsClass (#18243) 2024-02-10 12:25:00 -03:00
CalendarHandler.cpp chore(Core/Misc): Change all TODO to doxygen comment (#14966) 2023-02-12 10:05:34 -03:00
ChannelHandler.cpp refactor(Core/Logging): switch to fmt style for LOG_ (#10366) 2022-01-27 16:44:41 +01:00
CharacterHandler.cpp fix(Core/Character): TeleportTo() in HandlePlayerLoginFromDB() causes… (#19237) 2024-07-04 14:30:25 -03:00
ChatHandler.cpp feat(Core/Chat): Provide a fully-formed protocol for addons to intera… (#19305) 2024-07-06 19:13:24 +02:00
CombatHandler.cpp fix(Core/Handlers): Adjust start swing handler. (#19267) 2024-07-05 07:45:26 -03:00
DuelHandler.cpp refactor(Core/Network): remove redundant logging calls from some message handlers (#17565) 2023-11-08 21:53:43 +01:00
GroupHandler.cpp feat(Core/Scripting): move all script objects to separated files (#17860) 2023-12-02 21:13:20 +01:00
GuildHandler.cpp fix(Core): Fix guild bank update broadcasts (#13520) 2022-11-11 16:25:24 -03:00
ItemHandler.cpp fix(Core): Prevent gift wrapping of limited duration items (#18334) 2024-02-19 21:23:13 +01:00
LFGHandler.cpp fix(Core/LFG): Hide XP from max players (#18103) 2024-01-03 19:47:26 +01:00
LootHandler.cpp feat(Core/Unit): New helper IsClass and script hook OnPlayerIsClass (#18243) 2024-02-10 12:25:00 -03:00
MailHandler.cpp feat(Core/Mail): call CanSendMail() when returning to sender (#15553) 2023-03-23 18:56:48 -03:00
MiscHandler.cpp Revert "Add (core\db): Support for Homebind Orientation (#13389)" (#19257) 2024-07-02 22:02:15 +02:00
MovementHandler.cpp Revert "Add (core\db): Support for Homebind Orientation (#13389)" (#19257) 2024-07-02 22:02:15 +02:00
NPCHandler.cpp refactor(Core/Network): remove redundant logging calls from some message handlers (#17565) 2023-11-08 21:53:43 +01:00
NPCHandler.h feat(License): add new headers information about license (#7941) 2021-09-30 13:40:52 +07:00
PetHandler.cpp refactor(Core/ObjectMgr): Handle Profanity & Reserved Names in load (#19259) 2024-07-03 00:23:32 +02:00
PetitionsHandler.cpp refactor(Core/ObjectMgr): Handle Profanity & Reserved Names in load (#19259) 2024-07-03 00:23:32 +02:00
QueryHandler.cpp refactor(Core/ObjectMgr): Implement display probabilities. (#19068) 2024-06-16 18:12:16 +02:00
QuestHandler.cpp refactor(Core/Network): remove redundant logging calls from some message handlers (#17565) 2023-11-08 21:53:43 +01:00
ReferAFriendHandler.cpp refactor(Core/Object): getLevel() -> GetLevel() (#14122) 2022-12-31 17:39:23 +01:00
SkillHandler.cpp refactor(Core/Logging): switch to fmt style for LOG_ (#10366) 2022-01-27 16:44:41 +01:00
Socialhandler.cpp chore(Core/Account): move AccountMgr::IsGMAccount() to class WorldSession (#17845) 2023-11-28 21:44:48 +01:00
SpellHandler.cpp fix(Core/PacketIO): Prevent HandleGameobjectReportUse when Gob is not… (#16707) 2023-07-30 13:04:46 +02:00
TaxiHandler.cpp chore(Core/Player): remove unused AnticheatSetSkipOnePacketForASH() function (#17947) 2023-12-09 01:09:52 +01:00
TicketHandler.cpp refactor(Core/Object): getLevel() -> GetLevel() (#14122) 2022-12-31 17:39:23 +01:00
TradeHandler.cpp chore(PlayerScript/Hook) : Add CanSetTradeItem Hook in PlayerScript (#18583) 2024-03-26 21:28:37 -03:00
VehicleHandler.cpp refactor(Core/Logging): switch to fmt style for LOG_ (#10366) 2022-01-27 16:44:41 +01:00
VoiceChatHandler.cpp feat(License): add new headers information about license (#7941) 2021-09-30 13:40:52 +07:00