-
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 chair/sit packet handlers
- Loading branch information
1 parent
91e3c9b
commit a78ca84
Showing
3 changed files
with
95 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.Domain.Map; | ||
using EOLib.PacketHandlers.Sit; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net.Server; | ||
|
||
namespace EOLib.PacketHandlers.Chair | ||
{ | ||
/// <summary> | ||
/// Handle another player standing up from a chair | ||
/// </summary> | ||
[AutoMappedType] | ||
public class ChairRemoveHandler : PlayerStandHandlerBase<ChairRemoveServerPacket> | ||
{ | ||
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; | ||
} | ||
} | ||
} |
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.Domain.Map; | ||
using EOLib.PacketHandlers.Sit; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net.Server; | ||
|
||
namespace EOLib.PacketHandlers.Chair | ||
{ | ||
/// <summary> | ||
/// Handle your player sitting in a chair | ||
/// </summary> | ||
[AutoMappedType] | ||
public class ChairReplyHandler : PlayerSitHandlerBase<ChairReplyServerPacket> | ||
{ | ||
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; | ||
} | ||
} | ||
} |
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,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 | ||
{ | ||
/// <summary> | ||
/// Handle your player sitting | ||
/// </summary> | ||
[AutoMappedType] | ||
public class SitReplyHandler : PlayerSitHandlerBase<SitReplyServerPacket> | ||
{ | ||
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; | ||
} | ||
} | ||
} |