From 0a9a941b6bd4fba2d8b863e146817b302f6045dc Mon Sep 17 00:00:00 2001 From: KimLS Date: Wed, 23 Oct 2024 21:53:24 -0700 Subject: [PATCH] WIP on membership --- common/patches/larion.cpp | 49 +++++++++++++++++++++++++++++++++ common/patches/larion_ops.h | 2 ++ common/patches/larion_structs.h | 38 +++++++++++++++++++++++++ 3 files changed, 89 insertions(+) diff --git a/common/patches/larion.cpp b/common/patches/larion.cpp index d5530eb7e..6997b7a7f 100644 --- a/common/patches/larion.cpp +++ b/common/patches/larion.cpp @@ -216,6 +216,55 @@ namespace Larion safe_delete(in); } + ENCODE(OP_SendMembership) { + ENCODE_LENGTH_EXACT(Membership_Struct); + SETUP_DIRECT_ENCODE(Membership_Struct, structs::Membership_Struct); + + eq->membership = emu->membership; + eq->races = emu->races; + eq->classes = emu->classes; + eq->entrysize = 33; + eq->entries[0] = -1; + eq->entries[1] = -1; + eq->entries[2] = -1; + eq->entries[3] = -1; + eq->entries[4] = -1; + eq->entries[5] = -1; + eq->entries[6] = 1; + eq->entries[7] = 1; + eq->entries[8] = 1; + eq->entries[9] = -1; + eq->entries[10] = 1; + eq->entries[11] = -1; + eq->entries[12] = -1; + eq->entries[13] = 1; + eq->entries[14] = 1; + eq->entries[15] = 1; + eq->entries[16] = 1; + eq->entries[17] = 1; + eq->entries[18] = 1; + eq->entries[19] = -1; + eq->entries[20] = -1; + eq->entries[21] = 0; + eq->entries[22] = 0; + eq->entries[23] = 0; + eq->entries[24] = 0; + eq->entries[25] = 0; + eq->entries[26] = 0; + eq->entries[27] = 0; + eq->entries[28] = 0; + eq->entries[29] = 0; + eq->entries[30] = 0; + eq->entries[31] = 0; + eq->entries[32] = 0; + + FINISH_ENCODE(); + } + + ENCODE(OP_SendMembershipDetails) { + + } + // DECODE methods } /*Larion*/ diff --git a/common/patches/larion_ops.h b/common/patches/larion_ops.h index 37b2db42c..0daf37f65 100644 --- a/common/patches/larion_ops.h +++ b/common/patches/larion_ops.h @@ -3,6 +3,8 @@ //list of packets we need to decode on the way in: E(OP_LogServer) +E(OP_SendMembership) +E(OP_SendMembershipDetails) #undef E #undef D diff --git a/common/patches/larion_structs.h b/common/patches/larion_structs.h index cd81f7915..e05d96240 100644 --- a/common/patches/larion_structs.h +++ b/common/patches/larion_structs.h @@ -17,6 +17,44 @@ namespace Larion { /*68*/ uint32 unknown68; /*72*/ uint32 unknown72; }; + + struct Membership_Struct + { + /*000*/ uint8 membership; //0 not gold, 2 gold + /*001*/ uint32 races; // Seen ff ff 01 00 + /*005*/ uint32 classes; // Seen ff ff 01 00 + /*009*/ uint32 entrysize; // Seen 33 + /*013*/ int32 entries[33]; // Most -1, 1, and 0 for Gold Status + /*145*/ + }; + + struct Membership_Entry_Struct + { + /*000*/ uint32 purchase_id; // Seen 1, then increments 90287 to 90300 + /*004*/ uint32 bitwise_entry; // Seen 16 to 65536 - Skips 4096 + /*008*/ + }; + + struct Membership_Setting_Struct + { + /*000*/ uint8 setting_index; // 0, 1, 2 or 3 + /*001*/ uint32 setting_id; // 0 to 23 + /*005*/ int32 setting_value; // All can be 0, 1, or -1 + /*009*/ + }; + + struct Membership_Details_Struct + { + /*000*/ uint32 membership_setting_count; // Seen 96 + /*004*/ Membership_Setting_Struct settings[96]; // 864 Bytes + /*364*/ uint32 race_entry_count; // Seen 17 + /*368*/ Membership_Entry_Struct membership_races[17]; // 136 Bytes + /*3f0*/ uint32 class_entry_count; // Seen 15 + /*3f4*/ Membership_Entry_Struct membership_classes[17]; // 136 Bytes + /*47c*/ uint32 exit_url_length; // Length of the exit_url string (0 for none) + /*480*/ //char exit_url[42]; // Upgrade to Silver or Gold Membership URL + }; + }; //end namespace structs }; //end namespace larion