-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement missing ITEM_AGREE packet handler
- Loading branch information
1 parent
5c797bc
commit a4228c1
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using AutomaticTypeMapper; | ||
using EOLib.Domain.Character; | ||
using EOLib.Domain.Login; | ||
using EOLib.Net.Handlers; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net.Server; | ||
|
||
namespace EOLib.PacketHandlers.Items | ||
{ | ||
[AutoMappedType] | ||
public class ItemAgreeHandler : InGameOnlyPacketHandler<ItemAgreeServerPacket> | ||
{ | ||
private readonly ICharacterInventoryRepository _characterInventoryRepository; | ||
|
||
public override PacketFamily Family => PacketFamily.Item; | ||
|
||
public override PacketAction Action => PacketAction.Agree; | ||
|
||
public ItemAgreeHandler(IPlayerInfoProvider playerInfoProvider, | ||
ICharacterInventoryRepository characterInventoryRepository) | ||
: base(playerInfoProvider) | ||
{ | ||
_characterInventoryRepository = characterInventoryRepository; | ||
} | ||
|
||
public override bool HandlePacket(ItemAgreeServerPacket packet) | ||
{ | ||
_characterInventoryRepository.ItemInventory.RemoveWhere(x => x.ItemID == packet.ItemId); | ||
return true; | ||
} | ||
} | ||
} |