-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/common/Edelstein.Common.Gameplay.Game/Handling/Packets/UserGatherItemRequestHandler.cs
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,15 @@ | ||
using Edelstein.Common.Gameplay.Handling; | ||
using Edelstein.Protocol.Gameplay.Game; | ||
using Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Recv; | ||
using Edelstein.Protocol.Gameplay.Handling; | ||
using Edelstein.Protocol.Network.Packets; | ||
using Edelstein.Protocol.Utilities.Pipelines; | ||
|
||
namespace Edelstein.Common.Gameplay.Game.Handling.Packets; | ||
|
||
public class UserGatherItemRequestHandler( | ||
IPipeline<PipedPacketMessage<IGameStageSystem, IGameStageSystemUser, UserGatherItemRequest>> pipeline | ||
) : PipedPacketHandler<IGameStageSystem, IGameStageSystemUser, UserGatherItemRequest>( | ||
(short)PacketRecvOperation.UserGatherItemRequest, | ||
pipeline | ||
); |
15 changes: 15 additions & 0 deletions
15
src/common/Edelstein.Common.Gameplay.Game/Handling/Packets/UserSortItemRequestHandler.cs
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,15 @@ | ||
using Edelstein.Common.Gameplay.Handling; | ||
using Edelstein.Protocol.Gameplay.Game; | ||
using Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Recv; | ||
using Edelstein.Protocol.Gameplay.Handling; | ||
using Edelstein.Protocol.Network.Packets; | ||
using Edelstein.Protocol.Utilities.Pipelines; | ||
|
||
namespace Edelstein.Common.Gameplay.Game.Handling.Packets; | ||
|
||
public class UserSortItemRequestHandler( | ||
IPipeline<PipedPacketMessage<IGameStageSystem, IGameStageSystemUser, UserSortItemRequest>> pipeline | ||
) : PipedPacketHandler<IGameStageSystem, IGameStageSystemUser, UserSortItemRequest>( | ||
(short)PacketRecvOperation.UserSortItemRequest, | ||
pipeline | ||
); |
19 changes: 19 additions & 0 deletions
19
...common/Edelstein.Common.Gameplay.Game/Handling/Pipes/UserOnPacketUserGatherItemRequest.cs
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,19 @@ | ||
using System.Threading.Tasks; | ||
using Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Recv; | ||
using Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Send; | ||
using Edelstein.Protocol.Gameplay.Game.Objects.Users; | ||
using Edelstein.Protocol.Utilities.Pipelines; | ||
|
||
namespace Edelstein.Common.Gameplay.Game.Handling.Pipes; | ||
|
||
public class UserOnPacketUserGatherItemRequest : AbstractUserOnPacketInField<UserGatherItemRequest> | ||
{ | ||
protected override async Task HandleAfter(IPipelineContext ctx, PipedFieldPacketMessage<UserGatherItemRequest> message) | ||
{ | ||
await message.User.ModifyInventory(i => i[message.Packet.Type]?.Gather(), true); | ||
await message.User.Dispatch(new GatherItemResult | ||
{ | ||
Type = message.Packet.Type | ||
}); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/common/Edelstein.Common.Gameplay.Game/Handling/Pipes/UserOnPacketUserSortItemRequest.cs
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,19 @@ | ||
using System.Threading.Tasks; | ||
using Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Recv; | ||
using Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Send; | ||
using Edelstein.Protocol.Gameplay.Game.Objects.Users; | ||
using Edelstein.Protocol.Utilities.Pipelines; | ||
|
||
namespace Edelstein.Common.Gameplay.Game.Handling.Pipes; | ||
|
||
public class UserOnPacketUserSortItemRequest : AbstractUserOnPacketInField<UserSortItemRequest> | ||
{ | ||
protected override async Task HandleAfter(IPipelineContext ctx, PipedFieldPacketMessage<UserSortItemRequest> message) | ||
{ | ||
await message.User.ModifyInventory(i => i[message.Packet.Type]?.Sort(), true); | ||
await message.User.Dispatch(new SortItemResult | ||
{ | ||
Type = message.Packet.Type | ||
}); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...protocol/Edelstein.Protocol.Gameplay.Game/Contracts/Packets/Recv/UserGatherItemRequest.cs
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,11 @@ | ||
using BinarySerialization; | ||
using Edelstein.Protocol.Gameplay.Entities.Inventories; | ||
using Edelstein.Protocol.Network.Packets; | ||
|
||
namespace Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Recv; | ||
|
||
public record UserGatherItemRequest : StructuredRecvPacket | ||
{ | ||
[FieldOrder(0)] public int UpdateTime { get; init; } | ||
[FieldOrder(1)] public ItemInventoryType Type { get; init; } | ||
} |
11 changes: 11 additions & 0 deletions
11
src/protocol/Edelstein.Protocol.Gameplay.Game/Contracts/Packets/Recv/UserSortItemRequest.cs
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,11 @@ | ||
using BinarySerialization; | ||
using Edelstein.Protocol.Gameplay.Entities.Inventories; | ||
using Edelstein.Protocol.Network.Packets; | ||
|
||
namespace Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Recv; | ||
|
||
public record UserSortItemRequest : StructuredRecvPacket | ||
{ | ||
[FieldOrder(0)] public int UpdateTime { get; init; } | ||
[FieldOrder(1)] public ItemInventoryType Type { get; init; } | ||
} |
11 changes: 11 additions & 0 deletions
11
src/protocol/Edelstein.Protocol.Gameplay.Game/Contracts/Packets/Send/GatherItemResult.cs
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,11 @@ | ||
using BinarySerialization; | ||
using Edelstein.Protocol.Gameplay.Entities.Inventories; | ||
using Edelstein.Protocol.Network.Packets; | ||
|
||
namespace Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Send; | ||
|
||
public record GatherItemResult() : StructuredSendPacket((short)PacketSendOperation.GatherItemResult) | ||
{ | ||
[FieldOrder(0)] public byte Unk1 { get; init; } | ||
[FieldOrder(1)] public required ItemInventoryType Type { get; init; } | ||
} |
11 changes: 11 additions & 0 deletions
11
src/protocol/Edelstein.Protocol.Gameplay.Game/Contracts/Packets/Send/SortItemResult.cs
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,11 @@ | ||
using BinarySerialization; | ||
using Edelstein.Protocol.Gameplay.Entities.Inventories; | ||
using Edelstein.Protocol.Network.Packets; | ||
|
||
namespace Edelstein.Protocol.Gameplay.Game.Contracts.Packets.Send; | ||
|
||
public record SortItemResult() : StructuredSendPacket((short)PacketSendOperation.SortItemResult) | ||
{ | ||
[FieldOrder(0)] public byte Unk1 { get; init; } | ||
[FieldOrder(1)] public required ItemInventoryType Type { get; init; } | ||
} |