client: native AVA2 cube_renewal module (ENABLE_CUBE_RENEWAL_WORLDARD=1)

PythonCubeRenewal + PhaseGameCubeRenewal ported verbatim from AVA2: GC 221
fills the recipe list and calls BINARY_CUBE_RENEWAL_OPEN, the XXF
uicuberenewal window sends CG 216 make/close (its 3rd "improve" argument
is accepted and not sent). Replaces the read-only CubeRenewalScript.inc
preview shim. Version mt20261026 so the server picks the new window.
FakeLoginServer: CG 215/216 sizes and a /mt_test_cube_open fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-24 14:06:26 +09:00
co-authored by Claude Opus 5.5
parent d6617e01f7
commit 909fc8f851
15 changed files with 336 additions and 277 deletions
+43
View File
@@ -165,6 +165,7 @@ enum
HEADER_CG_DRAGON_SOUL_REFINE = 205,
HEADER_CG_STATE_CHECKER = 206,
HEADER_CG_SASH = 211, // PORT: AVA2 sash (metin2-server FEATURE-AVA2-UNLOCK P4)
HEADER_CG_CUBE_RENEWAL = 216, // PORT: AVA2 cuberenewal (ENABLE_CUBE_RENEWAL_WORLDARD)
#if defined(ENABLE_ATTR_6TH_7TH)
HEADER_CG_67_ATTR = 208,
HEADER_CG_CLOSE_67_ATTR = 209,
@@ -388,6 +389,7 @@ enum
HEADER_GC_CHESTDROP = 66, // PORT: AVA2, DWORD dynamic length
HEADER_GC_AVA2_EVENTS = 214,
HEADER_GC_AVA2_DROP = 220,
HEADER_GC_CUBE_RENEWAL = 221, // PORT: AVA2 cuberenewal (ENABLE_CUBE_RENEWAL_WORLDARD)
HEADER_GC_SWITCHBOT = 171, // PORT: AVA2 switchbot, DYNAMIC_SIZE_PACKET
HEADER_GC_EXTENDED_POINTS = 218, // PORT: AVA2 64-bit gold and extended points
HEADER_GC_PORT_QUIVER = 219, // PORT: sent only after quiver capability subscription.
@@ -3176,4 +3178,45 @@ struct TPacketGCExtendedPointGold
int64_t gold;
};
static_assert(sizeof(TPacketGCExtendedPointGold) == 10, "TPacketGCExtendedPointGold size mismatch");
// PORT: AVA2 cuberenewal (ENABLE_CUBE_RENEWAL_WORLDARD), byte-identical to the AVA2 packets.
enum ECubeRenewalSubHeader
{
CUBE_RENEWAL_SUB_HEADER_OPEN_RECEIVE,
CUBE_RENEWAL_SUB_HEADER_CLEAR_DATES_RECEIVE,
CUBE_RENEWAL_SUB_HEADER_DATES_RECEIVE,
CUBE_RENEWAL_SUB_HEADER_DATES_LOADING,
CUBE_RENEWAL_SUB_HEADER_MAKE_ITEM,
CUBE_RENEWAL_SUB_HEADER_CLOSE,
};
struct TPacketCGCubeRenewalSend
{
uint8_t header;
uint8_t subheader;
uint32_t index_item;
uint32_t count_item;
};
struct TInfoDateCubeRenewal
{
uint32_t npc_vnum;
uint32_t index;
uint32_t vnum_reward;
int32_t count_reward;
bool item_reward_stackable;
uint32_t vnum_material_1; int32_t count_material_1;
uint32_t vnum_material_2; int32_t count_material_2;
uint32_t vnum_material_3; int32_t count_material_3;
uint32_t vnum_material_4; int32_t count_material_4;
uint32_t vnum_material_5; int32_t count_material_5;
int32_t gold;
int32_t percent;
char category[100];
};
struct TPacketGCCubeRenewalReceive
{
uint8_t header;
uint8_t subheader;
TInfoDateCubeRenewal date_cube_renewal;
};
static_assert(sizeof(TPacketCGCubeRenewalSend)==10,"AVA2 CG216 size");
static_assert(sizeof(TPacketGCCubeRenewalReceive)==167,"AVA2 GC221 size");
#pragma pack(pop)