Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-07-07 13:32:00 +08:00
87 changed files with 1928 additions and 1062 deletions

View File

@@ -889,6 +889,9 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation());
else
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation());
// Probably a hackfix, but currently the best workaround to prevent character names showing as Unknown after teleport out from instances at login.
pCurrChar->GetSession()->SendNameQueryOpcode(pCurrChar->GetGUID());
}
pCurrChar->SendInitialPacketsAfterAddToMap();

View File

@@ -283,14 +283,22 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (msg.empty())
return;
if (ChatHandler(this).ParseCommands(msg.c_str()))
return;
if (!_player->CanSpeak())
if (lang == LANG_ADDON)
{
std::string timeStr = secsToTimeString(m_muteTime - GameTime::GetGameTime().count());
SendNotification(GetAcoreString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
return;
if (AddonChannelCommandHandler(this).ParseCommands(msg.c_str()))
return;
}
else
{
if (ChatHandler(this).ParseCommands(msg.c_str()))
return;
if (!_player->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - GameTime::GetGameTime().count());
SendNotification(GetAcoreString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
return;
}
}
}

View File

@@ -84,9 +84,12 @@ void WorldSession::HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& pa
void WorldSession::SendAttackStop(Unit const* enemy)
{
WorldPacket data(SMSG_ATTACKSTOP, (8 + 8 + 4)); // we guess size
WorldPacket data(SMSG_ATTACKSTOP, (8 + 8 + 4)); // we guess size
data << GetPlayer()->GetPackGUID();
data << (enemy ? enemy->GetPackGUID() : PackedGuid()); // must be packed guid
data << uint32(0); // unk, can be 1 also
if (enemy)
{
data << enemy->GetPackGUID(); // must be packed guid
data << enemy->isDead();
}
SendPacket(&data);
}