Merge branch 'master' into Playerbot
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "WorldSessionMgr.h"
|
||||
|
||||
LoginQueryHolder::LoginQueryHolder(uint32 accountId, ObjectGuid guid) : m_accountId(accountId), m_guid(guid)
|
||||
{
|
||||
@@ -607,7 +608,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
|
||||
uint32 initAccountId = GetAccountId();
|
||||
|
||||
// can't delete loaded character
|
||||
if (ObjectAccessor::FindConnectedPlayer(guid) || sWorld->FindOfflineSessionForCharacterGUID(guid.GetCounter()))
|
||||
if (ObjectAccessor::FindConnectedPlayer(guid) || sWorldSessionMgr->FindOfflineSessionForCharacterGUID(guid.GetCounter()))
|
||||
{
|
||||
sScriptMgr->OnPlayerFailedDelete(guid, initAccountId);
|
||||
return;
|
||||
@@ -693,14 +694,14 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData)
|
||||
};
|
||||
|
||||
// pussywizard:
|
||||
if (WorldSession* sess = sWorld->FindOfflineSessionForCharacterGUID(playerGuid.GetCounter()))
|
||||
if (WorldSession* sess = sWorldSessionMgr->FindOfflineSessionForCharacterGUID(playerGuid.GetCounter()))
|
||||
if (sess->GetAccountId() != GetAccountId())
|
||||
{
|
||||
SendCharLogin(CHAR_LOGIN_DUPLICATE_CHARACTER);
|
||||
return;
|
||||
}
|
||||
// pussywizard:
|
||||
if (WorldSession* sess = sWorld->FindOfflineSession(GetAccountId()))
|
||||
if (WorldSession* sess = sWorldSessionMgr->FindOfflineSession(GetAccountId()))
|
||||
{
|
||||
Player* p = sess->GetPlayer();
|
||||
if (!p || sess->IsKicked())
|
||||
@@ -956,7 +957,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
if (sWorld->IsFFAPvPRealm() && !pCurrChar->IsGameMaster() && !pCurrChar->HasPlayerFlag(PLAYER_FLAGS_RESTING))
|
||||
if (!pCurrChar->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
|
||||
{
|
||||
sScriptMgr->OnFfaPvpStateUpdate(pCurrChar,true);
|
||||
sScriptMgr->OnPlayerFfaPvpStateUpdate(pCurrChar,true);
|
||||
pCurrChar->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
|
||||
}
|
||||
|
||||
@@ -1096,7 +1097,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
{
|
||||
bool isReferrer = pCurrChar->GetSession()->IsARecruiter();
|
||||
|
||||
for (auto const& [accID, session] : sWorld->GetAllSessions())
|
||||
for (auto const& [accID, session] : sWorldSessionMgr->GetAllSessions())
|
||||
{
|
||||
if (!session->GetRecruiterId() && !session->IsARecruiter())
|
||||
continue;
|
||||
@@ -1118,7 +1119,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST))
|
||||
{
|
||||
pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST);
|
||||
sScriptMgr->OnFirstLogin(pCurrChar);
|
||||
sScriptMgr->OnPlayerFirstLogin(pCurrChar);
|
||||
}
|
||||
|
||||
METRIC_EVENT("player_events", "Login", pCurrChar->GetName());
|
||||
@@ -1385,7 +1386,7 @@ void WorldSession::HandleCharRenameCallBack(std::shared_ptr<CharacterRenameInfo>
|
||||
atLoginFlags &= ~AT_LOGIN_RENAME;
|
||||
|
||||
// pussywizard:
|
||||
if (ObjectAccessor::FindConnectedPlayer(ObjectGuid::Create<HighGuid::Player>(guidLow)) || sWorld->FindOfflineSessionForCharacterGUID(guidLow))
|
||||
if (ObjectAccessor::FindConnectedPlayer(ObjectGuid::Create<HighGuid::Player>(guidLow)) || sWorldSessionMgr->FindOfflineSessionForCharacterGUID(guidLow))
|
||||
{
|
||||
SendCharRename(CHAR_CREATE_ERROR, renameInfo.get());
|
||||
return;
|
||||
@@ -1621,7 +1622,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
// pussywizard:
|
||||
if (ObjectAccessor::FindConnectedPlayer(customizeInfo->Guid) || sWorld->FindOfflineSessionForCharacterGUID(customizeInfo->Guid.GetCounter()))
|
||||
if (ObjectAccessor::FindConnectedPlayer(customizeInfo->Guid) || sWorldSessionMgr->FindOfflineSessionForCharacterGUID(customizeInfo->Guid.GetCounter()))
|
||||
{
|
||||
recvData.rfinish();
|
||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||
@@ -1923,7 +1924,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
|
||||
>> factionChangeInfo->Race;
|
||||
|
||||
// pussywizard:
|
||||
if (ObjectAccessor::FindConnectedPlayer(factionChangeInfo->Guid) || sWorld->FindOfflineSessionForCharacterGUID(factionChangeInfo->Guid.GetCounter()))
|
||||
if (ObjectAccessor::FindConnectedPlayer(factionChangeInfo->Guid) || sWorldSessionMgr->FindOfflineSessionForCharacterGUID(factionChangeInfo->Guid.GetCounter()))
|
||||
{
|
||||
SendCharFactionChange(CHAR_CREATE_ERROR, factionChangeInfo.get());
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user