mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
@@ -9629,6 +9629,28 @@ void ObjectMgr::LoadGossipMenuItems()
|
||||
_gossipMenuItemsStore.insert(GossipMenuItemsContainer::value_type(gMenuItem.MenuID, gMenuItem));
|
||||
} while (result->NextRow());
|
||||
|
||||
// Warn if any trainer creature templates reference a GossipMenuId that has no gossip_menu_option entries
|
||||
// This will cause the gossip menu to fallback to MenuID 0 at runtime which will display: "I wish to unlearn my talents."
|
||||
std::set<uint32> checkedMenuIds;
|
||||
for (auto const& [entry, tmpl] : _creatureTemplateStore)
|
||||
{
|
||||
uint32 menuId = tmpl.GossipMenuId;
|
||||
if (!menuId)
|
||||
continue;
|
||||
|
||||
if (!(tmpl.npcflag & UNIT_NPC_FLAG_TRAINER))
|
||||
continue;
|
||||
|
||||
if (checkedMenuIds.contains(menuId))
|
||||
continue;
|
||||
|
||||
checkedMenuIds.insert(menuId);
|
||||
|
||||
auto [first, second] = _gossipMenuItemsStore.equal_range(menuId);
|
||||
if (first == second)
|
||||
LOG_WARN("server.loading", "Trainer creature template references GossipMenuId {} has no `gossip_menu_option` entries. This will fallback to MenuID 0.", menuId);
|
||||
}
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded {} gossip_menu_option entries in {} ms", uint32(_gossipMenuItemsStore.size()), GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
{ "string", HandleStringCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "opendoor", HandleOpenDoorCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "bm", HandleBMCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "packetlog", HandlePacketLog, SEC_GAMEMASTER, Console::No }
|
||||
{ "packetlog", HandlePacketLog, SEC_GAMEMASTER, Console::Yes }
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
@@ -3109,9 +3109,19 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandlePacketLog(ChatHandler* handler, Optional<bool> enableArg)
|
||||
static bool HandlePacketLog(ChatHandler* handler, Optional<PlayerIdentifier> target, Optional<bool> enableArg)
|
||||
{
|
||||
WorldSession* session = handler->GetSession();
|
||||
if (!target)
|
||||
target = PlayerIdentifier::FromTargetOrSelf(handler);
|
||||
|
||||
if (!target || !target->IsConnected())
|
||||
{
|
||||
handler->SendErrorMessage(LANG_PLAYER_NOT_FOUND);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* playerTarget = target->GetConnectedPlayer();
|
||||
WorldSession* session = playerTarget->GetSession();
|
||||
|
||||
if (!session)
|
||||
return false;
|
||||
@@ -3121,13 +3131,13 @@ public:
|
||||
if (*enableArg)
|
||||
{
|
||||
session->SetPacketLogging(true);
|
||||
handler->SendNotification(LANG_ON);
|
||||
handler->PSendSysMessage("Packet logging enabled for {}.", playerTarget->GetName());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
session->SetPacketLogging(false);
|
||||
handler->SendNotification(LANG_OFF);
|
||||
handler->PSendSysMessage("Packet logging disabled for {}.", playerTarget->GetName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user