mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Core/WorldSession: Bypass assigned handler restriction if .debug send opcode command is used
This commit is contained in:
@@ -181,7 +181,7 @@ uint32 WorldSession::GetGuidLow() const
|
||||
}
|
||||
|
||||
/// Send a packet to the client
|
||||
void WorldSession::SendPacket(WorldPacket const* packet)
|
||||
void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/)
|
||||
{
|
||||
if (!m_Socket)
|
||||
return;
|
||||
@@ -192,10 +192,13 @@ void WorldSession::SendPacket(WorldPacket const* packet)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!opcodeTable[packet->GetOpcode()])
|
||||
if (!forced)
|
||||
{
|
||||
sLog->outError("Prevented sending disabled opcode %d (hex 0x%04X)", packet->GetOpcode(), packet->GetOpcode());
|
||||
return;
|
||||
if (!opcodeTable[packet->GetOpcode()])
|
||||
{
|
||||
sLog->outError("Prevented sending disabled opcode %d (hex 0x%04X)", packet->GetOpcode(), packet->GetOpcode());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
|
||||
@@ -236,7 +236,7 @@ class WorldSession
|
||||
void ReadMovementInfo(WorldPacket& data, MovementInfo* mi);
|
||||
void WriteMovementInfo(WorldPacket &data, MovementInfo* mi);
|
||||
|
||||
void SendPacket(WorldPacket const* packet);
|
||||
void SendPacket(WorldPacket const* packet, bool forced = false);
|
||||
void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3);
|
||||
void SendNotification(uint32 string_id, ...);
|
||||
void SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName *declinedName);
|
||||
|
||||
@@ -416,7 +416,7 @@ public:
|
||||
}
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending opcode %u", data.GetOpcode());
|
||||
data.hexlike();
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->GetSession()->SendPacket(&data, true);
|
||||
handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user