From c781ba9a46ff4e619edc83ffd9dcae295edaa52a Mon Sep 17 00:00:00 2001 From: lcdr Date: Mon, 16 Nov 2020 21:25:39 +0100 Subject: [PATCH] Add FriendUpdateNotify message --- examples/capture_parser.rs | 1 - src/world/client/mod.rs | 19 ++++++++++++++++++ src/world/client/tests/FriendUpdateNotify.bin | Bin 0 -> 82 bytes src/world/client/tests/FriendUpdateNotify.rs | 13 ++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/world/client/tests/FriendUpdateNotify.bin create mode 100644 src/world/client/tests/FriendUpdateNotify.rs diff --git a/examples/capture_parser.rs b/examples/capture_parser.rs index b30f671..72e5480 100644 --- a/examples/capture_parser.rs +++ b/examples/capture_parser.rs @@ -73,7 +73,6 @@ fn parse(path: &Path) -> Res { && !file.name().contains("[53-05-00-06]") && !file.name().contains("[53-05-00-15]") && !file.name().contains("[53-05-00-1c]") - && !file.name().contains("[53-05-00-1f]") && !file.name().contains("[53-05-00-31]") && !file.name().contains("[76-00]") && !file.name().contains("[7f-00]") diff --git a/src/world/client/mod.rs b/src/world/client/mod.rs index 41be26b..b6c583e 100644 --- a/src/world/client/mod.rs +++ b/src/world/client/mod.rs @@ -59,6 +59,7 @@ pub enum ClientMessage { BlueprintLoadItemResponse(BlueprintLoadItemResponse) = 23, AddFriendRequest(AddFriendRequest) = 27, GetFriendsListResponse(GetFriendsListResponse) = 30, + FriendUpdateNotify(FriendUpdateNotify) = 31, GetIgnoreListResponse(GetIgnoreListResponse) = 34, TeamInvite(TeamInvite) = 35, MinimumChatModeResponse(MinimumChatModeResponse) = 57, @@ -303,6 +304,24 @@ pub enum GetFriendsListResponse { GeneralError, } +#[derive(Debug, Deserialize, PartialEq, Serialize)] +#[repr(u8)] +pub enum FriendUpdateType { + Logout, + Login, + Transfer, + FreeTrialChange, +} + +#[derive(Debug, Deserialize, PartialEq, Serialize)] +pub struct FriendUpdateNotify { + update_type: FriendUpdateType, + char_name: LuWString33, + zone_id: ZoneId, + is_best_friend: bool, + is_free_trial: bool, +} + #[derive(Debug, Deserialize, PartialEq, Serialize)] #[trailing_padding=6] pub struct IgnoreState { diff --git a/src/world/client/tests/FriendUpdateNotify.bin b/src/world/client/tests/FriendUpdateNotify.bin new file mode 100644 index 0000000000000000000000000000000000000000..d61e572eb1bf75f064a90f4569c3f7bc6fadd803 GIT binary patch literal 82 zcmb1V00Jf_h9ZVkAgp4jWN>510g{;vc?{_ceqcI_ArYtuq=JFLl);F>5{M0fEJFqZ S1~V|UVDMoHSp+hQfdK#nehYj6 literal 0 HcmV?d00001 diff --git a/src/world/client/tests/FriendUpdateNotify.rs b/src/world/client/tests/FriendUpdateNotify.rs new file mode 100644 index 0000000..0f2e1a3 --- /dev/null +++ b/src/world/client/tests/FriendUpdateNotify.rs @@ -0,0 +1,13 @@ +ClientMessage::FriendUpdateNotify( + FriendUpdateNotify { + update_type: FriendUpdateType::Transfer, + char_name: lu!("BreezyFlyingNinja"), + zone_id: ZoneId { + map_id: 1100, + instance_id: 41556, + clone_id: 0, + }, + is_best_friend: false, + is_free_trial: false, + }, +) \ No newline at end of file