Skip to content

Commit

Permalink
Merge 3.3.5 to 3.3.5-base_patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Jan 29, 2024
2 parents 3141835 + b4783d6 commit 9344c1e
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 23 deletions.
7 changes: 7 additions & 0 deletions sql/updates/world/3.3.5/2024_01_26_00_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--
DELETE FROM `areatrigger_tavern` WHERE `id` = 5309;
INSERT INTO `areatrigger_tavern` (`id`, `name`) VALUES (5309, 'Shadow Vault');

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 30 AND `SourceEntry` = 5309;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(30, 0, 5309, 0, 0, 26, 0, 1, 0, 0, 0, 0, 0, '', 'Shadow Vault tavern requires phase 1.');
9 changes: 9 additions & 0 deletions src/server/game/Conditions/ConditionMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,15 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
}
break;
}
case CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED:
{
if (!sAreaTriggerStore.LookupEntry(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exists in AreaTrigger.dbc, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case CONDITION_SOURCE_TYPE_TERRAIN_SWAP:
{
TC_LOG_ERROR("sql.sql", "CONDITION_SOURCE_TYPE_TERRAIN_SWAP: is only for master branch, skipped");
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Conditions/ConditionMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ enum ConditionSourceType
CONDITION_SOURCE_TYPE_GRAVEYARD = 27, // only master
CONDITION_SOURCE_TYPE_AREATRIGGER = 28, // only master (this refers to dynamically spawned areatriggers, not the ones from AreaTrigger.dbc/db2)
CONDITION_SOURCE_TYPE_CONVERSATION_LINE = 29, // only master
CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED = 30, // only master (TODO: cherry-pick)
CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED = 30,
CONDITION_SOURCE_TYPE_TRAINER_SPELL = 31, // only master (TODO: cherry-pick)
CONDITION_SOURCE_TYPE_OBJECT_ID_VISIBILITY = 32, // only master (TODO: cherry-pick)
CONDITION_SOURCE_TYPE_SPAWN_GROUP = 33, // only master (TODO: cherry-pick)
Expand Down
7 changes: 3 additions & 4 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13514,17 +13514,16 @@ bool Player::IsUsingTwoHandedWeaponInOneHand() const
return true;
}

void Player::TradeCancel(bool sendback)
void Player::TradeCancel(bool sendback, TradeStatus status /*= TRADE_STATUS_TRADE_CANCELED*/)
{
if (m_trade)
{
Player* trader = m_trade->GetTrader();

// send yellow "Trade canceled" message to both traders
if (sendback)
GetSession()->SendCancelTrade();
GetSession()->SendCancelTrade(status);

trader->GetSession()->SendCancelTrade();
trader->GetSession()->SendCancelTrade(status);

// cleanup
delete m_trade;
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Player/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>

Player* GetTrader() const;
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; }

Expand Down
3 changes: 3 additions & 0 deletions src/server/game/Handlers/MiscHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
if (player->isDebugAreaTriggers)
ChatHandler(player->GetSession()).PSendSysMessage(LANG_DEBUG_AREATRIGGER_REACHED, triggerId);

if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED, atEntry->ID, player))
return;

if (sScriptMgr->OnAreaTrigger(player, atEntry))
return;

Expand Down
17 changes: 4 additions & 13 deletions src/server/game/Handlers/TradeHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ void WorldSession::SendTradeStatus(TradeStatusInfo const& info)

void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/)
{
TC_LOG_DEBUG("network", "WORLD: Ignore Trade {}", _player->GetGUID().ToString());
// recvPacket.print_storage();
_player->TradeCancel(true, TRADE_STATUS_IGNORE_YOU);
}

void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/)
{
TC_LOG_DEBUG("network", "WORLD: Busy Trade {}", _player->GetGUID().ToString());
// recvPacket.print_storage();
_player->TradeCancel(true, TRADE_STATUS_BUSY);
}

void WorldSession::SendUpdateTrade(bool trader_data /*= true*/)
Expand Down Expand Up @@ -570,13 +568,13 @@ void WorldSession::HandleBeginTradeOpcode(WorldPacket& /*recvPacket*/)
SendTradeStatus(info);
}

void WorldSession::SendCancelTrade()
void WorldSession::SendCancelTrade(TradeStatus status)
{
if (PlayerRecentlyLoggedOut() || PlayerLogout())
return;

TradeStatusInfo info;
info.Status = TRADE_STATUS_TRADE_CANCELED;
info.Status = status;
SendTradeStatus(info);
}

Expand Down Expand Up @@ -676,13 +674,6 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return;
}

if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUID()))
{
info.Status = TRADE_STATUS_IGNORE_YOU;
SendTradeStatus(info);
return;
}

if (pOther->GetTeam() != _player->GetTeam() &&
(!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) &&
!GetPlayer()->GetSession()->HasPermission(rbac::RBAC_PERM_ALLOW_TWO_SIDE_TRADE)))
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Server/WorldSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ void WorldSession::InitializeSessionCallback(CharacterDatabaseQueryHolder const&
SendTutorialsData();
}

rbac::RBACData* WorldSession::GetRBACData()
rbac::RBACData* WorldSession::GetRBACData() const
{
return _RBACData;
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/Server/WorldSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class TC_GAME_API WorldSession

GameClient* GetGameClient() const { return _gameClient; };

rbac::RBACData* GetRBACData();
rbac::RBACData* GetRBACData() const;
bool HasPermission(uint32 permissionId);
void LoadPermissions();
QueryCallback LoadPermissionsAsync();
Expand Down Expand Up @@ -529,7 +529,7 @@ class TC_GAME_API WorldSession

void SendTradeStatus(TradeStatusInfo const& status);
void SendUpdateTrade(bool trader_data = true);
void SendCancelTrade();
void SendCancelTrade(TradeStatus status);

void SendPetitionQueryOpcode(ObjectGuid petitionguid);

Expand Down
3 changes: 2 additions & 1 deletion src/server/scripts/Commands/cs_account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ class account_commandscript : public CommandScript
return false;
}

sAccountMgr->UpdateAccountAccess(nullptr, accountId, securityLevel, realmID);
WorldSession const* session = sWorld->FindSession(accountId);
sAccountMgr->UpdateAccountAccess(session ? session->GetRBACData() : nullptr, accountId, securityLevel, realmID);

handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, accountName->c_str(), securityLevel);
return true;
Expand Down

0 comments on commit 9344c1e

Please sign in to comment.