Core/PacketIO: Implemented CMSG_BUSY_TRADE and CMSG_IGNORE_TRADE
This commit is contained in:
1 parent
1c38edaae4
commit
a145c21495
4 files changed
+9
-14
No files matched your search
@@ -12305,7 +12305,7 @@ bool Player::IsUsingTwoHandedWeaponInOneHand() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::TradeCancel(bool sendback)
|
void Player::TradeCancel(bool sendback, TradeStatus status /*= TRADE_STATUS_TRADE_CANCELED*/)
|
||||||
{
|
{
|
||||||
if (m_trade)
|
if (m_trade)
|
||||||
{
|
{
|
||||||
@@ -12313,9 +12313,9 @@ void Player::TradeCancel(bool sendback)
|
|||||||
|
|
||||||
// send yellow "Trade canceled" message to both traders
|
// send yellow "Trade canceled" message to both traders
|
||||||
if (sendback)
|
if (sendback)
|
||||||
GetSession()->SendCancelTrade();
|
GetSession()->SendCancelTrade(status);
|
||||||
|
|
||||||
trader->GetSession()->SendCancelTrade();
|
trader->GetSession()->SendCancelTrade(status);
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
delete m_trade;
|
delete m_trade;
|
||||||
|
|||||||
@@ -1249,7 +1249,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
|||||||
|
|
||||||
Player* GetTrader() const;
|
Player* GetTrader() const;
|
||||||
TradeData* GetTradeData() const { return m_trade; }
|
TradeData* GetTradeData() const { return m_trade; }
|
||||||
void TradeCancel(bool sendback);
|
void TradeCancel(bool sendback, TradeStatus status = TRADE_STATUS_TRADE_CANCELED);
|
||||||
|
|
||||||
CinematicMgr* GetCinematicMgr() const { return _cinematicMgr.get(); }
|
CinematicMgr* GetCinematicMgr() const { return _cinematicMgr.get(); }
|
||||||
|
|
||||||
|
|||||||
@@ -43,10 +43,12 @@ void WorldSession::SendTradeStatus(WorldPackets::Trade::TradeStatus& info)
|
|||||||
|
|
||||||
void WorldSession::HandleIgnoreTradeOpcode(WorldPackets::Trade::IgnoreTrade& /*ignoreTrade*/)
|
void WorldSession::HandleIgnoreTradeOpcode(WorldPackets::Trade::IgnoreTrade& /*ignoreTrade*/)
|
||||||
{
|
{
|
||||||
|
_player->TradeCancel(true, TRADE_STATUS_IGNORE_YOU);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleBusyTradeOpcode(WorldPackets::Trade::BusyTrade& /*busyTRade*/)
|
void WorldSession::HandleBusyTradeOpcode(WorldPackets::Trade::BusyTrade& /*busyTRade*/)
|
||||||
{
|
{
|
||||||
|
_player->TradeCancel(true, TRADE_STATUS_BUSY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SendUpdateTrade(bool trader_data /*= true*/)
|
void WorldSession::SendUpdateTrade(bool trader_data /*= true*/)
|
||||||
@@ -549,13 +551,13 @@ void WorldSession::HandleBeginTradeOpcode(WorldPackets::Trade::BeginTrade& /*beg
|
|||||||
SendTradeStatus(info);
|
SendTradeStatus(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SendCancelTrade()
|
void WorldSession::SendCancelTrade(TradeStatus status)
|
||||||
{
|
{
|
||||||
if (PlayerRecentlyLoggedOut() || PlayerLogout())
|
if (PlayerRecentlyLoggedOut() || PlayerLogout())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WorldPackets::Trade::TradeStatus info;
|
WorldPackets::Trade::TradeStatus info;
|
||||||
info.Status = TRADE_STATUS_TRADE_CANCELED;
|
info.Status = status;
|
||||||
SendTradeStatus(info);
|
SendTradeStatus(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -650,13 +652,6 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade&
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUID()))
|
|
||||||
{
|
|
||||||
info.Status = TRADE_STATUS_IGNORE_YOU;
|
|
||||||
SendTradeStatus(info);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pOther->GetTeam() != _player->GetTeam() &&
|
if (pOther->GetTeam() != _player->GetTeam() &&
|
||||||
(!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) &&
|
(!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) &&
|
||||||
!GetPlayer()->GetSession()->HasPermission(rbac::RBAC_PERM_ALLOW_TWO_SIDE_TRADE)))
|
!GetPlayer()->GetSession()->HasPermission(rbac::RBAC_PERM_ALLOW_TWO_SIDE_TRADE)))
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ class TC_GAME_API WorldSession
|
|||||||
|
|
||||||
void SendTradeStatus(WorldPackets::Trade::TradeStatus& info);
|
void SendTradeStatus(WorldPackets::Trade::TradeStatus& info);
|
||||||
void SendUpdateTrade(bool trader_data = true);
|
void SendUpdateTrade(bool trader_data = true);
|
||||||
void SendCancelTrade();
|
void SendCancelTrade(TradeStatus status);
|
||||||
|
|
||||||
void SendPetitionQueryOpcode(ObjectGuid petitionguid);
|
void SendPetitionQueryOpcode(ObjectGuid petitionguid);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user