Skip to content

Commit

Permalink
Implemented extended item serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Sep 28, 2024
1 parent 9a85e7f commit 5dae087
Show file tree
Hide file tree
Showing 25 changed files with 1,868 additions and 535 deletions.
25 changes: 25 additions & 0 deletions docs/Packets/C1-25-AppearanceChangedExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# C1 25 - AppearanceChangedExtended (by server)

## Is sent when

The appearance of a player changed, all surrounding players are informed about it.

## Causes the following actions on the client side

The appearance of the player is updated.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 10 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x25 | Packet header - packet type identifier |
| 3 | 2 | ShortLittleEndian | | ChangedPlayerId |
| 5 | 4 bit | Byte | | ItemSlot |
| 5 | 4 bit | Byte | | ItemGroup |
| 6 | 2 | ShortLittleEndian | | ItemNumber |
| 8 | 1 | Byte | | ItemLevel |
| 9 << 0 | 1 bit | Boolean | | IsExcellent |
| 9 << 1 | 1 bit | Boolean | | IsAncient |
| 9 << 2 | 1 bit | Boolean | | IsAncientSetComplete |
46 changes: 46 additions & 0 deletions docs/Packets/C2-3F-05-PlayerShopItemListExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# C2 3F 05 - PlayerShopItemListExtended (by server)

## Is sent when

After the player requested to open a shop of another player.

## Causes the following actions on the client side

The player shop dialog is shown with the provided item data.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC2 | [Packet type](PacketTypes.md) |
| 1 | 2 | Short | | Packet header - length of the packet |
| 3 | 1 | Byte | 0x3F | Packet header - packet type identifier |
| 4 | 1 | Byte | 0x05 | Packet header - sub packet type identifier |
| 4 | 1 | ActionKind | | Action |
| 5 | 1 | Boolean | true | Success |
| 6 | 2 | ShortBigEndian | | PlayerId |
| 8 | 10 | String | | PlayerName |
| 18 | 36 | String | | ShopName |
| 54 | 1 | Byte | | ItemCount |
| 55 | PlayerShopItemExtended.Length * ItemCount | Array of PlayerShopItemExtended | | Items |

### PlayerShopItemExtended Structure

Data of an item in a player shop, which allows for dynamic item sizes and trades for specific kind of items (e.g. jewels), too.

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | | ItemSlot |
| 4 | 4 | IntegerLittleEndian | | MoneyPrice |
| 8 | 2 | ShortLittleEndian | | PriceItemType; Contains the item group in the highest 4 bits, and the item number in the remaining ones. |
| 9 | 2 | ShortLittleEndian | | RequiredItemAmount |
| 11 | | Binary | | ItemData |

### ActionKind Enum

The kind of action which led to the list message.

| Value | Name | Description |
|-------|------|-------------|
| 5 | ByRequest | The list was requested. |
| 19 | UpdateAfterItemChange | The list was changed, e.g. because an item was sold. |
2 changes: 2 additions & 0 deletions docs/Packets/ServerToClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
* [C3 24 - ItemMoved (by server)](C3-24-ItemMoved_by-server.md)
* [C3 24 FF - ItemMoveRequestFailed (by server)](C3-24-FF-ItemMoveRequestFailed_by-server.md)
* [C1 25 - AppearanceChanged (by server)](C1-25-AppearanceChanged_by-server.md)
* [C1 25 - AppearanceChangedExtended (by server)](C1-25-AppearanceChangedExtended_by-server.md)
* [C1 26 FD - ItemConsumptionFailed (by server)](C1-26-FD-ItemConsumptionFailed_by-server.md)
* [C1 26 FD - ItemConsumptionFailedExtended (by server)](C1-26-FD-ItemConsumptionFailedExtended_by-server.md)
* [C1 26 FE - MaximumHealthAndShield (by server)](C1-26-FE-MaximumHealthAndShield_by-server.md)
Expand Down Expand Up @@ -76,6 +77,7 @@
* [C2 3F 00 - PlayerShops (by server)](C2-3F-00-PlayerShops_by-server.md)
* [C3 3F 01 - PlayerShopSetItemPriceResponse (by server)](C3-3F-01-PlayerShopSetItemPriceResponse_by-server.md)
* [C2 3F 05 - PlayerShopItemList (by server)](C2-3F-05-PlayerShopItemList_by-server.md)
* [C2 3F 05 - PlayerShopItemListExtended (by server)](C2-3F-05-PlayerShopItemListExtended_by-server.md)
* [C1 3F 08 - PlayerShopItemSoldToPlayer (by server)](C1-3F-08-PlayerShopItemSoldToPlayer_by-server.md)
* [C1 3F 12 - ClosePlayerShopDialog (by server)](C1-3F-12-ClosePlayerShopDialog_by-server.md)
* [C1 3F 2 - PlayerShopOpenSuccessful (by server)](C1-3F-2-PlayerShopOpenSuccessful_by-server.md)
Expand Down
Loading

0 comments on commit 5dae087

Please sign in to comment.