From 67874d66949609dacec32c60981db200569e1832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20M=2E=20C=2E=20Hluchan?= Date: Fri, 14 Aug 2026 20:07:54 -0300 Subject: [PATCH] fix(protocol): parse missing client events & warn on unknown event (#1804) New Features: - Added notifications for bounty tasks, weekly tasks, and spell unlocks. - Added support for displaying these new event types in the game client. Bug Fixes: - Unknown event types are now safely ignored and logged instead of interrupting event processing. --- .../controllers/infobanner.lua | 5 ++++- src/client/const.h | 3 +++ src/client/protocolgameparse.cpp | 18 +++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/game_notifications/controllers/infobanner.lua b/modules/game_notifications/controllers/infobanner.lua index 8ac50b33a..f089165d1 100644 --- a/modules/game_notifications/controllers/infobanner.lua +++ b/modules/game_notifications/controllers/infobanner.lua @@ -42,7 +42,10 @@ local eventCategory = { CLIENT_EVENT_TYPE_QUEST = 8, CLIENT_EVENT_TYPE_COSMETIC = 9, CLIENT_EVENT_TYPE_PROFICIENCY = 10, - CLIENT_EVENT_TYPE_LAST = 11 + CLIENT_EVENT_TYPE_BOUNTY_TASK = 11, + CLIENT_EVENT_TYPE_WEEKLY_TASK = 12, + CLIENT_EVENT_TYPE_SPELL_UNLOCKED = 13, + CLIENT_EVENT_TYPE_LAST = 14 } local eventType = { diff --git a/src/client/const.h b/src/client/const.h index 62eb2fe16..fa6f96490 100644 --- a/src/client/const.h +++ b/src/client/const.h @@ -998,6 +998,9 @@ namespace Otc CLIENT_EVENT_TYPE_QUEST = 8, CLIENT_EVENT_TYPE_COSMETIC = 9, CLIENT_EVENT_TYPE_PROFICIENCY = 10, + CLIENT_EVENT_TYPE_BOUNTY_TASK = 11, + CLIENT_EVENT_TYPE_WEEKLY_TASK = 12, + CLIENT_EVENT_TYPE_SPELL_UNLOCKED = 13, CLIENT_EVENT_TYPE_LAST }; diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 0853fbc98..4d81f4f28 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -7141,8 +7141,24 @@ void ProtocolGame::parseClientEvent(const InputMessagePtr& msg) g_lua.callGlobalField("g_game", "onClientEvent", type, itemId, message); break; } + case Otc::CLIENT_EVENT_TYPE_BOUNTY_TASK: { + const auto taskId = msg->getU16(); + g_lua.callGlobalField("g_game", "onClientEvent", type, taskId); + break; + } + case Otc::CLIENT_EVENT_TYPE_WEEKLY_TASK: { + const auto raceId = msg->getU16(); + g_lua.callGlobalField("g_game", "onClientEvent", type, raceId); + break; + } + case Otc::CLIENT_EVENT_TYPE_SPELL_UNLOCKED: { + const auto spellId = msg->getU32(); + g_lua.callGlobalField("g_game", "onClientEvent", type, spellId); + break; + } default: - throw stdext::exception("[ProtocolGame::parseClientEvent] Unknown event type {}", static_cast(type)); + g_logger.warning(std::format("[ProtocolGame::parseClientEvent] Unknown event type {}", static_cast(type))); + break; } }