Skip to content

Commit

Permalink
Added extended appearance serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Sep 28, 2024
1 parent 63c06b9 commit 9a85e7f
Show file tree
Hide file tree
Showing 12 changed files with 1,325 additions and 0 deletions.
72 changes: 72 additions & 0 deletions docs/Packets/C1-F3-00-CharacterListExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# C1 F3 00 - CharacterListExtended (by server)

## Is sent when

After the game client requested it, usually after a successful login.

## Causes the following actions on the client side

The game client shows the available characters of the account.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | | Packet header - length of the packet |
| 2 | 1 | Byte | 0xF3 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x00 | Packet header - sub packet type identifier |
| 4 | 1 | CharacterCreationUnlockFlags | | UnlockFlags |
| 5 | 1 | Byte | | MoveCnt |
| 6 | 1 | Byte | | CharacterCount |
| 7 | 1 | Boolean | | IsVaultExtended |
| 8 | CharacterData.Length * CharacterCount | Array of CharacterData | | Characters |

### CharacterData Structure

Data of one character in the list.

Length: 44 Bytes

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | | SlotIndex |
| 1 | 10 | String | | Name |
| 12 | 2 | ShortLittleEndian | | Level |
| 14 | 4 bit | CharacterStatus | | Status |
| 14 << 4 | 1 bit | Boolean | | IsItemBlockActive |
| 15 | 27 | Binary | | Appearance |
| 42 | 1 | GuildMemberRole | | GuildPosition |

### CharacterStatus Enum

The status of a character.

| Value | Name | Description |
|-------|------|-------------|
| 0 | Normal | The state of the character is normal. |
| 1 | Banned | The character is banned from the game. |
| 32 | GameMaster | The character is a game master. |

### GuildMemberRole Enum

Defines the role of a guild member.

| Value | Name | Description |
|-------|------|-------------|
| 0 | NormalMember | The member is a normal member without special rights. |
| 32 | BattleMaster | The member is a battle master. |
| 128 | GuildMaster | The member is the guild master. |
| 255 | Undefined | The character is not a member, therefore the role is undefined. |

### CharacterCreationUnlockFlags Enum

The flags to unlock the specified character classes for the creation of new characters.

| Value | Name | Description |
|-------|------|-------------|
| 0 | None | No unlocked class. |
| 1 | Summoner | Unlocks the summoner class. |
| 2 | DarkLord | Unlocks the dark lord class. |
| 4 | MagicGladiator | Unlocks the magic gladiator class. |
| 8 | RageFighter | Unlocks the rage fighter class. |
1 change: 1 addition & 0 deletions docs/Packets/ServerToClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
* [C1 F1 01 - LoginResponse (by server)](C1-F1-01-LoginResponse_by-server.md)
* [C3 F1 02 - LogoutResponse (by server)](C3-F1-02-LogoutResponse_by-server.md)
* [C1 F3 00 - CharacterList (by server)](C1-F3-00-CharacterList_by-server.md)
* [C1 F3 00 - CharacterListExtended (by server)](C1-F3-00-CharacterListExtended_by-server.md)
* [C1 F3 00 - CharacterList075 (by server)](C1-F3-00-CharacterList075_by-server.md)
* [C1 F3 00 - CharacterList095 (by server)](C1-F3-00-CharacterList095_by-server.md)
* [C1 F3 01 - CharacterCreationSuccessful (by server)](C1-F3-01-CharacterCreationSuccessful_by-server.md)
Expand Down
5 changes: 5 additions & 0 deletions src/DataModel/Entities/AppearanceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public class AppearanceData : IAppearanceData
/// </summary>
public virtual CharacterClass? CharacterClass { get; set; }

/// <summary>
/// Gets the character status.
/// </summary>
public CharacterStatus CharacterStatus { get; set; }

/// <inheritdoc />
public CharacterPose Pose { get; set; }

Expand Down
5 changes: 5 additions & 0 deletions src/DataModel/Entities/IAppearanceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public interface IAppearanceData
/// </summary>
CharacterClass? CharacterClass { get; }

/// <summary>
/// Gets the character status.
/// </summary>
CharacterStatus CharacterStatus { get; }

/// <summary>
/// Gets the current pose.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/GameLogic/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,8 @@ public AppearanceDataAdapter(Player player)

public CharacterClass? CharacterClass => this._player.SelectedCharacter?.CharacterClass;

public CharacterStatus CharacterStatus => this._player.SelectedCharacter?.CharacterStatus ?? default;

public CharacterPose Pose => this._player.SelectedCharacter?.Pose ?? default;

public bool FullAncientSetEquipped => (this._fullAncientSetEquipped ??= this._player.SelectedCharacter?.HasFullAncientSetEquipped()) ?? false;
Expand Down
Loading

0 comments on commit 9a85e7f

Please sign in to comment.