Implement a general way to store selection data for gossip and fix trainer exploit
This commit is contained in:
@@ -367,6 +367,9 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.MailReturnToSender)]
|
||||
void HandleMailReturnToSender(MailReturnToSender packet)
|
||||
{
|
||||
if (!CanOpenMailBox(_player.PlayerTalkClass.GetInteractionData().SourceGuid))
|
||||
return;
|
||||
|
||||
Player player = GetPlayer();
|
||||
Mail m = player.GetMail(packet.MailID);
|
||||
if (m == null || m.state == MailState.Deleted || m.deliver_time > Time.UnixTime || m.sender != packet.SenderGUID.GetCounter())
|
||||
@@ -576,6 +579,8 @@ namespace Game
|
||||
response.Mails.Add(new MailListEntry(m, player));
|
||||
}
|
||||
|
||||
player.PlayerTalkClass.GetInteractionData().Reset();
|
||||
player.PlayerTalkClass.GetInteractionData().SourceGuid = packet.Mailbox;
|
||||
SendPacket(response);
|
||||
|
||||
// recalculate m_nextMailDelivereTime and unReadMails
|
||||
|
||||
@@ -432,6 +432,12 @@ namespace Game
|
||||
_player.Prestige();
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CloseInteraction, Processing = PacketProcessing.ThreadSafe)]
|
||||
void HandleCloseInteraction(CloseInteraction packet)
|
||||
{
|
||||
_player.PlayerTalkClass.GetInteractionData().Reset();
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.ChatUnregisterAllAddonPrefixes)]
|
||||
void HandleUnregisterAllAddonPrefixes(ChatUnregisterAllAddonPrefixes packet)
|
||||
{
|
||||
|
||||
@@ -79,7 +79,9 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
_player.SetCurrentTrainerId(trainerId);
|
||||
_player.PlayerTalkClass.GetInteractionData().Reset();
|
||||
_player.PlayerTalkClass.GetInteractionData().SourceGuid = guid;
|
||||
_player.PlayerTalkClass.GetInteractionData().TrainerId = trainerId;
|
||||
trainer.SendSpells(unit, _player, GetSessionDbLocaleIndex());
|
||||
}
|
||||
|
||||
@@ -97,7 +99,10 @@ namespace Game
|
||||
if (_player.HasUnitState(UnitState.Died))
|
||||
_player.RemoveAurasByType(AuraType.FeignDeath);
|
||||
|
||||
if (_player.GetCurrentTrainerId() != packet.TrainerID)
|
||||
if (_player.PlayerTalkClass.GetInteractionData().SourceGuid != packet.TrainerGUID)
|
||||
return;
|
||||
|
||||
if (_player.PlayerTalkClass.GetInteractionData().TrainerId != packet.TrainerID)
|
||||
return;
|
||||
|
||||
// check present spell in trainer spell list
|
||||
@@ -164,7 +169,7 @@ namespace Game
|
||||
return;
|
||||
|
||||
// Prevent cheating on C# scripted menus
|
||||
if (GetPlayer().PlayerTalkClass.GetGossipMenu().GetSenderGUID() != packet.GossipUnit)
|
||||
if (GetPlayer().PlayerTalkClass.GetInteractionData().SourceGuid != packet.GossipUnit)
|
||||
return;
|
||||
|
||||
Creature unit = null;
|
||||
|
||||
Reference in New Issue
Block a user