diff --git a/EOLib/PacketHandlers/Chair/ChairRemoveHandler.cs b/EOLib/PacketHandlers/Chair/ChairRemoveHandler.cs new file mode 100644 index 000000000..3c1be6003 --- /dev/null +++ b/EOLib/PacketHandlers/Chair/ChairRemoveHandler.cs @@ -0,0 +1,32 @@ +using AutomaticTypeMapper; +using EOLib.Domain.Character; +using EOLib.Domain.Login; +using EOLib.Domain.Map; +using EOLib.PacketHandlers.Sit; +using Moffat.EndlessOnline.SDK.Protocol.Net; +using Moffat.EndlessOnline.SDK.Protocol.Net.Server; + +namespace EOLib.PacketHandlers.Chair +{ + /// + /// Handle another player standing up from a chair + /// + [AutoMappedType] + public class ChairRemoveHandler : PlayerStandHandlerBase + { + public override PacketFamily Family => PacketFamily.Chair; + + public override PacketAction Action => PacketAction.Remove; + + public ChairRemoveHandler(IPlayerInfoProvider playerInfoProvider, + ICharacterRepository characterRepository, + ICurrentMapStateRepository currentMapStateRepository) + : base(playerInfoProvider, characterRepository, currentMapStateRepository) { } + + public override bool HandlePacket(ChairRemoveServerPacket packet) + { + Handle(packet.PlayerId, packet.Coords.X, packet.Coords.Y); + return true; + } + } +} diff --git a/EOLib/PacketHandlers/Chair/ChairReplyHandler.cs b/EOLib/PacketHandlers/Chair/ChairReplyHandler.cs new file mode 100644 index 000000000..4b53e494e --- /dev/null +++ b/EOLib/PacketHandlers/Chair/ChairReplyHandler.cs @@ -0,0 +1,32 @@ +using AutomaticTypeMapper; +using EOLib.Domain.Character; +using EOLib.Domain.Login; +using EOLib.Domain.Map; +using EOLib.PacketHandlers.Sit; +using Moffat.EndlessOnline.SDK.Protocol.Net; +using Moffat.EndlessOnline.SDK.Protocol.Net.Server; + +namespace EOLib.PacketHandlers.Chair +{ + /// + /// Handle your player sitting in a chair + /// + [AutoMappedType] + public class ChairReplyHandler : PlayerSitHandlerBase + { + public override PacketFamily Family => PacketFamily.Chair; + + public override PacketAction Action => PacketAction.Reply; + + public ChairReplyHandler(IPlayerInfoProvider playerInfoProvider, + ICharacterRepository characterRepository, + ICurrentMapStateRepository currentMapStateRepository) + : base(playerInfoProvider, characterRepository, currentMapStateRepository) { } + + public override bool HandlePacket(ChairReplyServerPacket packet) + { + Handle(packet.PlayerId, packet.Coords.X, packet.Coords.Y, (EODirection)packet.Direction); + return true; + } + } +} diff --git a/EOLib/PacketHandlers/Sit/SitReplyHandler.cs b/EOLib/PacketHandlers/Sit/SitReplyHandler.cs new file mode 100644 index 000000000..d4e532bf2 --- /dev/null +++ b/EOLib/PacketHandlers/Sit/SitReplyHandler.cs @@ -0,0 +1,31 @@ +using AutomaticTypeMapper; +using EOLib.Domain.Character; +using EOLib.Domain.Login; +using EOLib.Domain.Map; +using Moffat.EndlessOnline.SDK.Protocol.Net; +using Moffat.EndlessOnline.SDK.Protocol.Net.Server; + +namespace EOLib.PacketHandlers.Sit +{ + /// + /// Handle your player sitting + /// + [AutoMappedType] + public class SitReplyHandler : PlayerSitHandlerBase + { + public override PacketFamily Family => PacketFamily.Sit; + + public override PacketAction Action => PacketAction.Reply; + + public SitReplyHandler(IPlayerInfoProvider playerInfoProvider, + ICharacterRepository characterRepository, + ICurrentMapStateRepository currentMapStateRepository) + : base(playerInfoProvider, characterRepository, currentMapStateRepository) { } + + public override bool HandlePacket(SitReplyServerPacket packet) + { + Handle(packet.PlayerId, packet.Coords.X, packet.Coords.Y, (EODirection)packet.Direction); + return true; + } + } +}