Core/Gossip: Integrate banker guid checks into shared gossip interaction data
Port From (https://github.com/TrinityCore/TrinityCore/commit/bde93b25d2b899c4623467a094c71333b2b54e8d)
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Game
|
||||
{
|
||||
if (!CanUseBank())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: HandleAutoBankItemOpcode - {0} not found or you can't interact with him.", m_currentBankerGUID.ToString());
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleAutoBankItemOpcode - {_player.PlayerTalkClass.GetInteractionData().SourceGuid} not found or you can't interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Game
|
||||
{
|
||||
if (!CanUseBank())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: HandleAutoBankItemOpcode - {0} not found or you can't interact with him.", m_currentBankerGUID.ToString());
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleAutoBankItemOpcode - {_player.PlayerTalkClass.GetInteractionData().SourceGuid} not found or you can't interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace Game
|
||||
{
|
||||
if (!CanUseBank())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleAutoBankReagentOpcode - {m_currentBankerGUID} not found or you can't interact with him.");
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleAutoBankReagentOpcode - {_player.PlayerTalkClass.GetInteractionData().SourceGuid} not found or you can't interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace Game
|
||||
{
|
||||
if (!CanUseBank())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleAutoBankReagentOpcode - {m_currentBankerGUID} not found or you can't interact with him.");
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleAutoBankReagentOpcode - {_player.PlayerTalkClass.GetInteractionData().SourceGuid} not found or you can't interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -297,6 +297,8 @@ namespace Game
|
||||
|
||||
public void SendShowBank(ObjectGuid guid)
|
||||
{
|
||||
_player.PlayerTalkClass.GetInteractionData().Reset();
|
||||
_player.PlayerTalkClass.GetInteractionData().SourceGuid = guid;
|
||||
NPCInteractionOpenResult npcInteraction = new();
|
||||
npcInteraction.Npc = guid;
|
||||
npcInteraction.InteractionType = PlayerInteractionType.Banker;
|
||||
|
||||
@@ -89,13 +89,13 @@ namespace Game
|
||||
|
||||
if (Player.IsBankPos(InventorySlots.Bag0, swapInvItem.Slot1) && !CanUseBank())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: HandleSwapInvItemOpcode - {0} not found or you can't interact with him.", m_currentBankerGUID.ToString());
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleSwapInvItemOpcode - {_player.PlayerTalkClass.GetInteractionData().SourceGuid} not found or you can't interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player.IsBankPos(InventorySlots.Bag0, swapInvItem.Slot2) && !CanUseBank())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: HandleSwapInvItemOpcode - {0} not found or you can't interact with him.", m_currentBankerGUID.ToString());
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleSwapInvItemOpcode - {_player.PlayerTalkClass.GetInteractionData().SourceGuid} not found or you can't interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -155,13 +155,13 @@ namespace Game
|
||||
|
||||
if (Player.IsBankPos(swapItem.ContainerSlotA, swapItem.SlotA) && !CanUseBank())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: HandleSwapInvItemOpcode - {0} not found or you can't interact with him.", m_currentBankerGUID.ToString());
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleSwapInvItemOpcode - {_player.PlayerTalkClass.GetInteractionData().SourceGuid} not found or you can't interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player.IsBankPos(swapItem.ContainerSlotB, swapItem.SlotB) && !CanUseBank())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: HandleSwapInvItemOpcode - {0} not found or you can't interact with him.", m_currentBankerGUID.ToString());
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleSwapInvItemOpcode - {_player.PlayerTalkClass.GetInteractionData().SourceGuid} not found or you can't interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1039,9 +1039,9 @@ namespace Game
|
||||
{
|
||||
// bankerGUID parameter is optional, set to 0 by default.
|
||||
if (bankerGUID.IsEmpty())
|
||||
bankerGUID = m_currentBankerGUID;
|
||||
bankerGUID = _player.PlayerTalkClass.GetInteractionData().SourceGuid;
|
||||
|
||||
bool isUsingBankCommand = (bankerGUID == GetPlayer().GetGUID() && bankerGUID == m_currentBankerGUID);
|
||||
bool isUsingBankCommand = bankerGUID == GetPlayer().GetGUID() && bankerGUID == _player.PlayerTalkClass.GetInteractionData().SourceGuid;
|
||||
|
||||
if (!isUsingBankCommand)
|
||||
{
|
||||
|
||||
@@ -56,7 +56,6 @@ namespace Game
|
||||
recruiterId = recruiter;
|
||||
isRecruiter = isARecruiter;
|
||||
expireTime = 60000; // 1 min after socket loss, session is deleted
|
||||
m_currentBankerGUID = ObjectGuid.Empty;
|
||||
_battlePetMgr = new BattlePetMgr(this);
|
||||
_collectionMgr = new CollectionMgr(this);
|
||||
|
||||
@@ -995,8 +994,6 @@ namespace Game
|
||||
ConcurrentQueue<WorldPacket> _recvQueue = new();
|
||||
RBACData _RBACData;
|
||||
|
||||
ObjectGuid m_currentBankerGUID;
|
||||
|
||||
CircularBuffer<Tuple<long, uint>> _timeSyncClockDeltaQueue = new(6); // first member: clockDelta. Second member: latency of the packet exchange that was used to compute that clockDelta.
|
||||
long _timeSyncClockDelta;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user