From 3e6199fd739d811fdc15139ce4743fa4596c5473 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Aug 2018 00:09:12 +0300 Subject: Update storage packet for 2018-08-29 RE. --- src/map/clif.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 12 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 4e48d7886..77d072d20 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -86,8 +86,8 @@ static struct s_packet_db packet_db[MAX_PACKET_DB + 1]; /* re-usable */ static struct packet_itemlist_normal itemlist_normal; static struct packet_itemlist_equip itemlist_equip; -static struct packet_storelist_normal storelist_normal; -static struct packet_storelist_equip storelist_equip; +static struct ZC_STORE_ITEMLIST_NORMAL storelist_normal; +static struct ZC_STORE_ITEMLIST_EQUIP storelist_equip; static struct packet_viewequip_ack viewequip_list; #if PACKETVER >= 20131223 static struct packet_npc_market_result_ack npcmarket_result; @@ -2863,13 +2863,56 @@ static void clif_equiplist(struct map_session_data *sd) #endif } -static void clif_storagelist(struct map_session_data *sd, struct item *items, int items_length) +static void clif_storageList(struct map_session_data *sd, struct item *items, int items_length) { - int i = 0; - struct item_data *id; + nullpo_retv(sd); + + clif->storageStart(sd, "Storage"); + if (sd->storage.aggregate > 0) + clif->storageItems(sd, items, items_length); + clif->storageEnd(sd); +} + +static void clif_guildStorageList(struct map_session_data *sd, struct item *items, int items_length) +{ + clif->storageStart(sd, "Guild storage"); + clif->storageItems(sd, items, items_length); + clif->storageEnd(sd); +} + +static void clif_storageStart(struct map_session_data *sd, const char *name) +{ +#if PACKETVER_RE_NUM >= 20180829 + nullpo_retv(sd); + nullpo_retv(name); + + struct ZC_STORE_START p; + p.packetType = 0xb08; + safestrncpy(p.name, name, NAME_LENGTH); + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} +static void clif_storageEnd(struct map_session_data *sd) +{ +#if PACKETVER_RE_NUM >= 20180829 + nullpo_retv(sd); + + struct ZC_STORE_END p; + p.packetType = 0xb0b; + p.flag = 0; + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} + +static void clif_storageItems(struct map_session_data *sd, struct item *items, int items_length) +{ nullpo_retv(sd); nullpo_retv(items); + + int i = 0; + struct item_data *id; + do { int normal = 0, equip = 0, k = 0; @@ -2887,10 +2930,10 @@ static void clif_storagelist(struct map_session_data *sd, struct item *items, in } if( normal ) { - storelist_normal.PacketType = storagelistnormalType; + storelist_normal.PacketType = storageListNormalType; storelist_normal.PacketLength = ( sizeof( storelist_normal ) - sizeof( storelist_normal.list ) ) + (sizeof(struct NORMALITEM_INFO) * normal); -#if PACKETVER >= 20120925 +#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 safestrncpy(storelist_normal.name, "Storage", NAME_LENGTH); #endif @@ -2898,10 +2941,10 @@ static void clif_storagelist(struct map_session_data *sd, struct item *items, in } if( equip ) { - storelist_equip.PacketType = storagelistequipType; + storelist_equip.PacketType = storageListEquipType; storelist_equip.PacketLength = ( sizeof( storelist_equip ) - sizeof( storelist_equip.list ) ) + (sizeof(struct EQUIPITEM_INFO) * equip); -#if PACKETVER >= 20120925 +#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 safestrncpy(storelist_equip.name, "Storage", NAME_LENGTH); #endif @@ -8825,8 +8868,8 @@ static void clif_refresh_storagewindow(struct map_session_data *sd) if (sd->state.storage_flag == STORAGE_FLAG_NORMAL) { if (sd->storage.aggregate > 0) { storage->sortitem(VECTOR_DATA(sd->storage.item), VECTOR_LENGTH(sd->storage.item)); - clif->storagelist(sd, VECTOR_DATA(sd->storage.item), VECTOR_LENGTH(sd->storage.item)); } + clif->storageList(sd, VECTOR_DATA(sd->storage.item), VECTOR_LENGTH(sd->storage.item)); clif->updatestorageamount(sd, sd->storage.aggregate, MAX_STORAGE); } // Notify the client that the gstorage is open otherwise it will @@ -8838,7 +8881,7 @@ static void clif_refresh_storagewindow(struct map_session_data *sd) intif->request_guild_storage(sd->status.account_id,sd->status.guild_id); } else { storage->sortitem(gstor->items, ARRAYLENGTH(gstor->items)); - clif->storagelist(sd, gstor->items, ARRAYLENGTH(gstor->items)); + clif->guildStorageList(sd, gstor->items, ARRAYLENGTH(gstor->items)); clif->updatestorageamount(sd, gstor->storage_amount, MAX_GUILD_STORAGE); } } @@ -22355,7 +22398,11 @@ void clif_defaults(void) clif->openvendingAck = clif_openvendingAck; clif->vendingreport = clif_vendingreport; /* storage handling */ - clif->storagelist = clif_storagelist; + clif->storageList = clif_storageList; + clif->guildStorageList = clif_guildStorageList; + clif->storageItems = clif_storageItems; + clif->storageStart = clif_storageStart; + clif->storageEnd = clif_storageEnd; clif->updatestorageamount = clif_updatestorageamount; clif->storageitemadded = clif_storageitemadded; clif->storageitemremoved = clif_storageitemremoved; -- cgit v1.2.3-70-g09d2 From 1243ccae245b12134f841703957221c3157dda9a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 8 Sep 2018 20:32:19 +0300 Subject: Fix packet ZC_INVENTORY_MOVE_FAILED (fixes #2213) --- src/map/clif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 77d072d20..b36efd3f2 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2641,7 +2641,7 @@ static void clif_item_movefailed(struct map_session_data *sd, int n) WFIFOHEAD(fd, len); struct PACKET_ZC_INVENTORY_MOVE_FAILED *p = WFIFOP(fd, 0); p->packetType = 0xaa7; - p->index = n; + p->index = n + 2; p->unknown = 1; WFIFOSET(fd, len); #else @@ -11131,7 +11131,7 @@ static void clif_parse_DropItem(int fd, struct map_session_data *sd) } //Because the client does not like being ignored. - clif->item_movefailed(sd, item_index); + clif->dropitem(sd, item_index, 0); } static void clif_parse_UseItem(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); -- cgit v1.2.3-70-g09d2 From fbbc7f4dec0c7301a0ee3547675a2fba6c62a34c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 12 Sep 2018 23:19:02 +0300 Subject: Update storage/guild storage packets for 2018-09-12 RE. --- src/map/clif.c | 38 +++++++++++++++++++++++++------------- src/map/clif.h | 16 +++++++++++++--- src/map/packets.h | 16 ++++++++-------- src/map/packets_struct.h | 16 ++++++++++++++-- 4 files changed, 60 insertions(+), 26 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index b36efd3f2..3b114cdca 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2867,45 +2867,51 @@ static void clif_storageList(struct map_session_data *sd, struct item *items, in { nullpo_retv(sd); - clif->storageStart(sd, "Storage"); + clif->inventoryStart(sd, INVTYPE_STORAGE, "Storage"); if (sd->storage.aggregate > 0) - clif->storageItems(sd, items, items_length); - clif->storageEnd(sd); + clif->storageItems(sd, INVTYPE_STORAGE, items, items_length); + clif->inventoryEnd(sd, INVTYPE_STORAGE); } static void clif_guildStorageList(struct map_session_data *sd, struct item *items, int items_length) { - clif->storageStart(sd, "Guild storage"); - clif->storageItems(sd, items, items_length); - clif->storageEnd(sd); + clif->inventoryStart(sd, INVTYPE_GUILD_STORAGE, "Guild storage"); + clif->storageItems(sd, INVTYPE_GUILD_STORAGE, items, items_length); + clif->inventoryEnd(sd, INVTYPE_GUILD_STORAGE); } -static void clif_storageStart(struct map_session_data *sd, const char *name) +static void clif_inventoryStart(struct map_session_data *sd, enum inventory_type type, const char *name) { #if PACKETVER_RE_NUM >= 20180829 nullpo_retv(sd); nullpo_retv(name); - struct ZC_STORE_START p; + struct ZC_INVENTORY_START p; p.packetType = 0xb08; +#if PACKETVER_RE_NUM >= 20180912 + p.invType = type; +#endif safestrncpy(p.name, name, NAME_LENGTH); clif->send(&p, sizeof(p), &sd->bl, SELF); #endif } -static void clif_storageEnd(struct map_session_data *sd) +static void clif_inventoryEnd(struct map_session_data *sd, enum inventory_type type) { #if PACKETVER_RE_NUM >= 20180829 nullpo_retv(sd); - struct ZC_STORE_END p; + struct ZC_INVENTORY_END p; p.packetType = 0xb0b; +#if PACKETVER_RE_NUM >= 20180912 + p.invType = type; +#endif p.flag = 0; clif->send(&p, sizeof(p), &sd->bl, SELF); #endif } -static void clif_storageItems(struct map_session_data *sd, struct item *items, int items_length) +static void clif_storageItems(struct map_session_data *sd, enum inventory_type type, struct item *items, int items_length) { nullpo_retv(sd); nullpo_retv(items); @@ -2933,6 +2939,9 @@ static void clif_storageItems(struct map_session_data *sd, struct item *items, i storelist_normal.PacketType = storageListNormalType; storelist_normal.PacketLength = ( sizeof( storelist_normal ) - sizeof( storelist_normal.list ) ) + (sizeof(struct NORMALITEM_INFO) * normal); +#if PACKETVER_RE_NUM >= 20180912 + storelist_normal.invType = type; +#endif #if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 safestrncpy(storelist_normal.name, "Storage", NAME_LENGTH); #endif @@ -2944,6 +2953,9 @@ static void clif_storageItems(struct map_session_data *sd, struct item *items, i storelist_equip.PacketType = storageListEquipType; storelist_equip.PacketLength = ( sizeof( storelist_equip ) - sizeof( storelist_equip.list ) ) + (sizeof(struct EQUIPITEM_INFO) * equip); +#if PACKETVER_RE_NUM >= 20180912 + storelist_equip.invType = type; +#endif #if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 safestrncpy(storelist_equip.name, "Storage", NAME_LENGTH); #endif @@ -22401,8 +22413,8 @@ void clif_defaults(void) clif->storageList = clif_storageList; clif->guildStorageList = clif_guildStorageList; clif->storageItems = clif_storageItems; - clif->storageStart = clif_storageStart; - clif->storageEnd = clif_storageEnd; + clif->inventoryStart = clif_inventoryStart; + clif->inventoryEnd = clif_inventoryEnd; clif->updatestorageamount = clif_updatestorageamount; clif->storageitemadded = clif_storageitemadded; clif->storageitemremoved = clif_storageitemremoved; diff --git a/src/map/clif.h b/src/map/clif.h index 2de2ddc7d..335fb42c5 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -611,6 +611,16 @@ enum pet_evolution_result { PET_EVOL_SUCCESS = 0x6, }; +/** + * Inventory type for clients 2018-09-12 RE + + **/ +enum inventory_type { + INVTYPE_INVENTORY = 0, + INVTYPE_CART = 1, + INVTYPE_STORAGE = 2, + INVTYPE_GUILD_STORAGE = 3, +}; + /** * Structures **/ @@ -988,9 +998,9 @@ struct clif_interface { /* storage handling */ void (*storageList) (struct map_session_data* sd, struct item* items, int items_length); void (*guildStorageList) (struct map_session_data* sd, struct item* items, int items_length); - void (*storageItems) (struct map_session_data* sd, struct item* items, int items_length); - void (*storageStart) (struct map_session_data* sd, const char* name); - void (*storageEnd) (struct map_session_data* sd); + void (*storageItems) (struct map_session_data* sd, enum inventory_type type, struct item* items, int items_length); + void (*inventoryStart) (struct map_session_data* sd, enum inventory_type type, const char* name); + void (*inventoryEnd) (struct map_session_data* sd, enum inventory_type type); void (*updatestorageamount) (struct map_session_data* sd, int amount, int max_amount); void (*storageitemadded) (struct map_session_data* sd, struct item* i, int index, int amount); void (*storageitemremoved) (struct map_session_data* sd, int index, int amount); diff --git a/src/map/packets.h b/src/map/packets.h index 8283662ef..16ad4d00a 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -4276,10 +4276,10 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0b05,59); packet(0x0b06,53,clif->pDull/*,XXX*/); packet(0x0b07,-1); - packet(0x0b08,26); // ZC_STORE_START + packet(0x0b08,26); // ZC_INVENTORY_START packet(0x0b09,-1); // ZC_STORE_ITEMLIST_NORMAL_V6 packet(0x0b0a,-1); // ZC_STORE_ITEMLIST_EQUIP_V6 - packet(0x0b0b,3); // ZC_STORE_END + packet(0x0b0b,3); // ZC_INVENTORY_END packet(0x0b0c,155,clif->pDull/*,XXX*/); // changed packet sizes #endif @@ -4290,10 +4290,10 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0b05,63); packet(0x0b06,53,clif->pDull/*,XXX*/); packet(0x0b07,-1); - packet(0x0b08,26); // ZC_STORE_START + packet(0x0b08,26); // ZC_INVENTORY_START packet(0x0b09,-1); // ZC_STORE_ITEMLIST_NORMAL_V6 packet(0x0b0a,-1); // ZC_STORE_ITEMLIST_EQUIP_V6 - packet(0x0b0b,3); // ZC_STORE_END + packet(0x0b0b,3); // ZC_INVENTORY_END packet(0x0b0c,155,clif->pDull/*,XXX*/); // changed packet sizes #endif @@ -4303,8 +4303,8 @@ packet(0x96e,-1,clif->ackmergeitems); // new packets packet(0x0b0d,6,clif->pDull/*,XXX*/); // changed packet sizes - packet(0x0b08,27); // ZC_STORE_START - packet(0x0b0b,4); // ZC_STORE_END + packet(0x0b08,27); // ZC_INVENTORY_START + packet(0x0b0b,4); // ZC_INVENTORY_END #endif #ifndef PACKETVER_ZERO @@ -4315,8 +4315,8 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0b0e,-1,clif->pDull/*,XXX*/); packet(0x0b0f,-1,clif->pDull/*,XXX*/); // changed packet sizes - packet(0x0b08,27,clif->pDull/*,XXX*/); // ZC_STORE_START - packet(0x0b0b,4,clif->pDull/*,XXX*/); // ZC_STORE_END + packet(0x0b08,27,clif->pDull/*,XXX*/); // ZC_INVENTORY_START + packet(0x0b0b,4,clif->pDull/*,XXX*/); // ZC_INVENTORY_END #endif #endif diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 7a15f4274..f21d493c8 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1178,25 +1178,37 @@ struct packet_itemlist_equip { struct ZC_STORE_ITEMLIST_NORMAL { int16 PacketType; int16 PacketLength; +#if PACKETVER_RE_NUM >= 20180912 + uint8 invType; +#endif #if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 char name[NAME_LENGTH]; #endif struct NORMALITEM_INFO list[MAX_ITEMLIST]; } __attribute__((packed)); -struct ZC_STORE_START { +struct ZC_INVENTORY_START { int16 packetType; +#if PACKETVER_RE_NUM >= 20180912 + uint8 invType; +#endif char name[NAME_LENGTH]; } __attribute__((packed)); -struct ZC_STORE_END { +struct ZC_INVENTORY_END { int16 packetType; +#if PACKETVER_RE_NUM >= 20180912 + uint8 invType; +#endif char flag; } __attribute__((packed)); struct ZC_STORE_ITEMLIST_EQUIP { int16 PacketType; int16 PacketLength; +#if PACKETVER_RE_NUM >= 20180912 + uint8 invType; +#endif #if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 char name[NAME_LENGTH]; #endif -- cgit v1.2.3-70-g09d2 From c479ff1aafe1765633ebdc310f86c1d9035a6a16 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 13 Sep 2018 00:28:41 +0300 Subject: Update inventory packet for 2018-09-12 RE. --- src/map/atcommand.c | 2 +- src/map/clif.c | 60 +++++++++++++++++++++++++++++++++++++----------- src/map/clif.h | 6 +++-- src/map/packets_struct.h | 14 +++++++++-- src/map/pet.c | 2 +- src/map/script.c | 4 ++-- src/map/skill.c | 6 ++--- 7 files changed, 70 insertions(+), 24 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 6522f3013..2538f797c 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -4297,7 +4297,7 @@ ACMD(repairall) if (count > 0) { clif->misceffect(&sd->bl, 3); - clif->equiplist(sd); + clif->equipList(sd); clif->message(fd, msg_fd(fd,107)); // All items have been repaired. } else { clif->message(fd, msg_fd(fd,108)); // No item need to be repaired. diff --git a/src/map/clif.c b/src/map/clif.c index 3b114cdca..f76a76efc 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2787,7 +2787,18 @@ static void clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item * #endif } -static void clif_inventorylist(struct map_session_data *sd) +static void clif_inventoryList(struct map_session_data *sd) +{ +#if PACKETVER_RE_NUM >= 20180912 + clif->inventoryStart(sd, INVTYPE_INVENTORY, ""); +#endif + clif->inventoryItems(sd, INVTYPE_INVENTORY); +#if PACKETVER_RE_NUM >= 20180912 + clif->inventoryEnd(sd, INVTYPE_INVENTORY); +#endif +} + +static void clif_inventoryItems(struct map_session_data *sd, enum inventory_type type) { int i, normal = 0, equip = 0; @@ -2802,9 +2813,12 @@ static void clif_inventorylist(struct map_session_data *sd) clif->item_normal(i+2,&itemlist_normal.list[normal++],&sd->status.inventory[i],sd->inventory_data[i]); } - if( normal ) { - itemlist_normal.PacketType = inventorylistnormalType; - itemlist_normal.PacketLength = 4 + (sizeof(struct NORMALITEM_INFO) * normal); + if (normal) { + itemlist_normal.PacketType = inventorylistnormalType; + itemlist_normal.PacketLength = (sizeof(itemlist_normal) - sizeof(itemlist_normal.list)) + (sizeof(struct NORMALITEM_INFO) * normal); +#if PACKETVER_RE_NUM >= 20180912 + itemlist_normal.invType = type; +#endif clif->send(&itemlist_normal, itemlist_normal.PacketLength, &sd->bl, SELF); } @@ -2814,7 +2828,10 @@ static void clif_inventorylist(struct map_session_data *sd) if( equip ) { itemlist_equip.PacketType = inventorylistequipType; - itemlist_equip.PacketLength = 4 + (sizeof(struct EQUIPITEM_INFO) * equip); + itemlist_equip.PacketLength = (sizeof(itemlist_equip) - sizeof(itemlist_equip.list)) + (sizeof(struct EQUIPITEM_INFO) * equip); +#if PACKETVER_RE_NUM >= 20180912 + itemlist_equip.invType = type; +#endif clif->send(&itemlist_equip, itemlist_equip.PacketLength, &sd->bl, SELF); } @@ -2830,8 +2847,20 @@ static void clif_inventorylist(struct map_session_data *sd) #endif } +static void clif_equipList(struct map_session_data *sd) +{ +#if PACKETVER_RE_NUM >= 20180912 + clif->inventoryStart(sd, INVTYPE_INVENTORY, ""); + clif->inventoryItems(sd, INVTYPE_INVENTORY); + clif->inventoryEnd(sd, INVTYPE_INVENTORY); +#else + // [4144] for old packet version it send only equipment. this is bug? + clif->equipItems(sd, INVTYPE_INVENTORY); +#endif +} + //Required when items break/get-repaired. Only sends equippable item list. -static void clif_equiplist(struct map_session_data *sd) +static void clif_equipItems(struct map_session_data *sd, enum inventory_type type) { int i, equip = 0; @@ -2844,9 +2873,12 @@ static void clif_equiplist(struct map_session_data *sd) clif->item_equip(i+2,&itemlist_equip.list[equip++],&sd->status.inventory[i],sd->inventory_data[i],pc->equippoint(sd,i)); } - if( equip ) { - itemlist_equip.PacketType = inventorylistequipType; - itemlist_equip.PacketLength = 4 + (sizeof(struct EQUIPITEM_INFO) * equip); + if (equip) { + itemlist_equip.PacketType = inventorylistequipType; + itemlist_equip.PacketLength = (sizeof(itemlist_equip) - sizeof(itemlist_equip.list)) + (sizeof(struct EQUIPITEM_INFO) * equip); +#if PACKETVER_RE_NUM >= 20180912 + itemlist_equip.invType = type; +#endif clif->send(&itemlist_equip, itemlist_equip.PacketLength, &sd->bl, SELF); } @@ -8905,7 +8937,7 @@ static void clif_refresh(struct map_session_data *sd) nullpo_retv(sd); clif->changemap(sd,sd->bl.m,sd->bl.x,sd->bl.y); - clif->inventorylist(sd); + clif->inventoryList(sd); if(pc_iscarton(sd)) { clif->cartlist(sd); clif->updatestatus(sd,SP_CARTINFO); @@ -9939,7 +9971,7 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) // Send character inventory to the client. // call this before pc->checkitem() so that the client isn't called to delete a non-existent item. - clif->inventorylist(sd); + clif->inventoryList(sd); // Send the cart inventory, counts & weight to the client. if(pc_iscarton(sd)) { @@ -22252,8 +22284,10 @@ void clif_defaults(void) clif->combo_delay = clif_combo_delay; clif->status_change = clif_status_change; clif->insert_card = clif_insert_card; - clif->inventorylist = clif_inventorylist; - clif->equiplist = clif_equiplist; + clif->inventoryList = clif_inventoryList; + clif->inventoryItems = clif_inventoryItems; + clif->equipList = clif_equipList; + clif->equipItems = clif_equipItems; clif->cartlist = clif_cartlist; clif->favorite_item = clif_favorite_item; clif->clearcart = clif_clearcart; diff --git a/src/map/clif.h b/src/map/clif.h index 335fb42c5..a5d95172b 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -837,8 +837,10 @@ struct clif_interface { void (*combo_delay) (struct block_list *bl,int wait); void (*status_change) (struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3); void (*insert_card) (struct map_session_data *sd,int idx_equip,int idx_card,int flag); - void (*inventorylist) (struct map_session_data *sd); - void (*equiplist) (struct map_session_data *sd); + void (*inventoryList) (struct map_session_data *sd); + void (*inventoryItems) (struct map_session_data *sd, enum inventory_type type); + void (*equipList) (struct map_session_data *sd); + void (*equipItems) (struct map_session_data *sd, enum inventory_type type); void (*cartlist) (struct map_session_data *sd); void (*favorite_item) (struct map_session_data* sd, unsigned short index); void (*clearcart) (int fd); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index f21d493c8..c94c140a1 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -198,7 +198,9 @@ enum packet_headers { #else dropflooritemType = 0x9e, #endif -#if PACKETVER >= 20120925 +#if PACKETVER_RE_NUM >= 20180912 + inventorylistnormalType = 0xb09, +#elif PACKETVER >= 20120925 inventorylistnormalType = 0x991, #elif PACKETVER >= 20080102 inventorylistnormalType = 0x2e8, @@ -207,7 +209,9 @@ enum packet_headers { #else inventorylistnormalType = 0xa3, #endif -#if PACKETVER >= 20150226 +#if PACKETVER_RE_NUM >= 20180912 + inventorylistequipType = 0xb0a, +#elif PACKETVER >= 20150226 inventorylistequipType = 0xa0d, #elif PACKETVER >= 20120925 inventorylistequipType = 0x992, @@ -1166,12 +1170,18 @@ struct packet_roulette_itemrecv_ack { struct packet_itemlist_normal { int16 PacketType; int16 PacketLength; +#if PACKETVER_RE_NUM >= 20180912 + uint8 invType; +#endif struct NORMALITEM_INFO list[MAX_ITEMLIST]; } __attribute__((packed)); struct packet_itemlist_equip { int16 PacketType; int16 PacketLength; +#if PACKETVER_RE_NUM >= 20180912 + uint8 invType; +#endif struct EQUIPITEM_INFO list[MAX_ITEMLIST]; } __attribute__((packed)); diff --git a/src/map/pet.c b/src/map/pet.c index cfb3e8253..c32a92b78 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -350,7 +350,7 @@ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd) sd->status.inventory[i].bound = IBT_NONE; } #if PACKETVER >= 20180704 - clif->inventorylist(sd); + clif->inventoryList(sd); clif->send_petdata(sd, pd, 6, 0); #endif pd->pet.incubate = 1; diff --git a/src/map/script.c b/src/map/script.c index 65ffc1a6d..2182b942c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9361,7 +9361,7 @@ static BUILDIN(repair) if(num==repaircounter) { sd->status.inventory[i].attribute |= ATTR_BROKEN; sd->status.inventory[i].attribute ^= ATTR_BROKEN; - clif->equiplist(sd); + clif->equipList(sd); clif->produce_effect(sd, 0, sd->status.inventory[i].nameid); clif->misceffect(&sd->bl, 3); break; @@ -9398,7 +9398,7 @@ static BUILDIN(repairall) if(repaircounter) { clif->misceffect(&sd->bl, 3); - clif->equiplist(sd); + clif->equipList(sd); } return true; diff --git a/src/map/skill.c b/src/map/skill.c index c5579c2f6..4eaab5457 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2588,7 +2588,7 @@ static int skill_break_equip(struct block_list *bl, unsigned short where, int ra pc->unequipitem(sd, j, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE); } } - clif->equiplist(sd); + clif->equipList(sd); } return where; //Return list of pieces broken. @@ -16139,7 +16139,7 @@ static void skill_repairweapon(struct map_session_data *sd, int idx) item->attribute |= ATTR_BROKEN; item->attribute ^= ATTR_BROKEN; /* clear broken state */ - clif->equiplist(target_sd); + clif->equipList(target_sd); pc->delitem(sd, pc->search_inventory(sd, material), 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME); // FIXME: is this the correct reason flag? @@ -16222,7 +16222,7 @@ static void skill_weaponrefine(struct map_session_data *sd, int idx) } clif->delitem(sd, idx, 1, DELITEM_NORMAL); clif->upgrademessage(sd->fd, 0,item->nameid); - clif->inventorylist(sd); + clif->inventoryList(sd); clif->refine(sd->fd,0,idx,item->refine); if (ep) pc->equipitem(sd,idx,ep); -- cgit v1.2.3-70-g09d2 From 135ca4ad9ecd3ee0b7f548104d92d2a8d74c77a0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 13 Sep 2018 00:43:46 +0300 Subject: Update cart packet for 2018-09-12 RE. --- src/map/clif.c | 38 ++++++++++++++++++++++++++++---------- src/map/clif.h | 3 ++- src/map/packets_struct.h | 8 ++++++-- src/map/pc.c | 6 +++--- 4 files changed, 39 insertions(+), 16 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index f76a76efc..03a6ba507 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2999,7 +2999,18 @@ static void clif_storageItems(struct map_session_data *sd, enum inventory_type t } -static void clif_cartlist(struct map_session_data *sd) +static void clif_cartList(struct map_session_data *sd) +{ +#if PACKETVER_RE_NUM >= 20180912 + clif->inventoryStart(sd, INVTYPE_CART, ""); +#endif + clif->cartItems(sd, INVTYPE_CART); +#if PACKETVER_RE_NUM >= 20180912 + clif->inventoryEnd(sd, INVTYPE_CART); +#endif +} + +static void clif_cartItems(struct map_session_data *sd, enum inventory_type type) { int i, normal = 0, equip = 0; struct item_data *id; @@ -3017,16 +3028,22 @@ static void clif_cartlist(struct map_session_data *sd) clif->item_normal(i+2,&itemlist_normal.list[normal++],&sd->status.cart[i],id); } - if( normal ) { - itemlist_normal.PacketType = cartlistnormalType; - itemlist_normal.PacketLength = 4 + (sizeof(struct NORMALITEM_INFO) * normal); + if (normal) { + itemlist_normal.PacketType = cartlistnormalType; + itemlist_normal.PacketLength = (sizeof(itemlist_normal) - sizeof(itemlist_normal.list)) + (sizeof(struct NORMALITEM_INFO) * normal); +#if PACKETVER_RE_NUM >= 20180912 + itemlist_normal.invType = type; +#endif clif->send(&itemlist_normal, itemlist_normal.PacketLength, &sd->bl, SELF); } - if( equip ) { - itemlist_equip.PacketType = cartlistequipType; - itemlist_equip.PacketLength = 4 + (sizeof(struct EQUIPITEM_INFO) * equip); + if (equip) { + itemlist_equip.PacketType = cartlistequipType; + itemlist_equip.PacketLength = (sizeof(itemlist_equip) - sizeof(itemlist_equip.list)) + (sizeof(struct EQUIPITEM_INFO) * equip); +#if PACKETVER_RE_NUM >= 20180912 + itemlist_equip.invType = type; +#endif clif->send(&itemlist_equip, itemlist_equip.PacketLength, &sd->bl, SELF); } @@ -8939,7 +8956,7 @@ static void clif_refresh(struct map_session_data *sd) clif->changemap(sd,sd->bl.m,sd->bl.x,sd->bl.y); clif->inventoryList(sd); if(pc_iscarton(sd)) { - clif->cartlist(sd); + clif->cartList(sd); clif->updatestatus(sd,SP_CARTINFO); } clif->updatestatus(sd,SP_WEIGHT); @@ -9975,7 +9992,7 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) // Send the cart inventory, counts & weight to the client. if(pc_iscarton(sd)) { - clif->cartlist(sd); + clif->cartList(sd); clif->updatestatus(sd, SP_CARTINFO); } @@ -22288,7 +22305,8 @@ void clif_defaults(void) clif->inventoryItems = clif_inventoryItems; clif->equipList = clif_equipList; clif->equipItems = clif_equipItems; - clif->cartlist = clif_cartlist; + clif->cartList = clif_cartList; + clif->cartItems = clif_cartItems; clif->favorite_item = clif_favorite_item; clif->clearcart = clif_clearcart; clif->item_identify_list = clif_item_identify_list; diff --git a/src/map/clif.h b/src/map/clif.h index a5d95172b..13435e82e 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -841,7 +841,8 @@ struct clif_interface { void (*inventoryItems) (struct map_session_data *sd, enum inventory_type type); void (*equipList) (struct map_session_data *sd); void (*equipItems) (struct map_session_data *sd, enum inventory_type type); - void (*cartlist) (struct map_session_data *sd); + void (*cartList) (struct map_session_data *sd); + void (*cartItems) (struct map_session_data *sd, enum inventory_type type); void (*favorite_item) (struct map_session_data* sd, unsigned short index); void (*clearcart) (int fd); void (*item_identify_list) (struct map_session_data *sd); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index c94c140a1..d82a413a1 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -246,7 +246,9 @@ enum packet_headers { #else storageListEquipType = 0xa6, #endif -#if PACKETVER >= 20120925 +#if PACKETVER_RE_NUM >= 20180829 + cartlistnormalType = 0xb09, +#elif PACKETVER >= 20120925 cartlistnormalType = 0x993, #elif PACKETVER >= 20080102 cartlistnormalType = 0x2e9, @@ -255,7 +257,9 @@ enum packet_headers { #else cartlistnormalType = 0x123, #endif -#if PACKETVER >= 20150226 +#if PACKETVER_RE_NUM >= 20180829 + cartlistequipType = 0xb0a, +#elif PACKETVER >= 20150226 cartlistequipType = 0xa0f, #elif PACKETVER >= 20120925 cartlistequipType = 0x994, diff --git a/src/map/pc.c b/src/map/pc.c index be28f8dad..961dda9f5 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2075,7 +2075,7 @@ static int pc_disguise(struct map_session_data *sd, int class) clif->spawn(&sd->bl); if (class == sd->status.class && pc_iscarton(sd)) { //It seems the cart info is lost on undisguise. - clif->cartlist(sd); + clif->cartList(sd); clif->updatestatus(sd,SP_CARTINFO); } if (sd->chat_id != 0) { @@ -9198,7 +9198,7 @@ static int pc_setoption(struct map_session_data *sd, int type) #ifndef NEW_CARTS if( type&OPTION_CART && !( p_type&OPTION_CART ) ) { //Cart On - clif->cartlist(sd); + clif->cartList(sd); clif->updatestatus(sd, SP_CARTINFO); if(pc->checkskill(sd, MC_PUSHCART) < 10) status_calc_pc(sd,SCO_NONE); //Apply speed penalty. @@ -9305,7 +9305,7 @@ static int pc_setcart(struct map_session_data *sd, int type) break; default:/* everything else is an allowed ID so we can move on */ if( !sd->sc.data[SC_PUSH_CART] ) /* first time, so fill cart data */ - clif->cartlist(sd); + clif->cartList(sd); clif->updatestatus(sd, SP_CARTINFO); sc_start(NULL,&sd->bl, SC_PUSH_CART, 100, type, 0); clif->sc_load(&sd->bl, sd->bl.id, AREA, SI_ON_PUSH_CART, type, 0, 0); -- cgit v1.2.3-70-g09d2 From 0f55a042a9eeb8334f28493f24e1dc9d72893425 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 20 Sep 2018 01:22:38 +0300 Subject: Update inventory start packet for 2018-09-19 RE and zero packet versions. --- src/map/clif.c | 58 +++++++++++++++++++++++++++++------------------- src/map/packets_struct.h | 35 +++++++++++++++++------------ 2 files changed, 56 insertions(+), 37 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 03a6ba507..d70f69557 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2789,11 +2789,11 @@ static void clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item * static void clif_inventoryList(struct map_session_data *sd) { -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 clif->inventoryStart(sd, INVTYPE_INVENTORY, ""); #endif clif->inventoryItems(sd, INVTYPE_INVENTORY); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 clif->inventoryEnd(sd, INVTYPE_INVENTORY); #endif } @@ -2816,7 +2816,7 @@ static void clif_inventoryItems(struct map_session_data *sd, enum inventory_type if (normal) { itemlist_normal.PacketType = inventorylistnormalType; itemlist_normal.PacketLength = (sizeof(itemlist_normal) - sizeof(itemlist_normal.list)) + (sizeof(struct NORMALITEM_INFO) * normal); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 itemlist_normal.invType = type; #endif @@ -2829,7 +2829,7 @@ static void clif_inventoryItems(struct map_session_data *sd, enum inventory_type if( equip ) { itemlist_equip.PacketType = inventorylistequipType; itemlist_equip.PacketLength = (sizeof(itemlist_equip) - sizeof(itemlist_equip.list)) + (sizeof(struct EQUIPITEM_INFO) * equip); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 itemlist_equip.invType = type; #endif @@ -2849,7 +2849,7 @@ static void clif_inventoryItems(struct map_session_data *sd, enum inventory_type static void clif_equipList(struct map_session_data *sd) { -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 clif->inventoryStart(sd, INVTYPE_INVENTORY, ""); clif->inventoryItems(sd, INVTYPE_INVENTORY); clif->inventoryEnd(sd, INVTYPE_INVENTORY); @@ -2876,7 +2876,7 @@ static void clif_equipItems(struct map_session_data *sd, enum inventory_type typ if (equip) { itemlist_equip.PacketType = inventorylistequipType; itemlist_equip.PacketLength = (sizeof(itemlist_equip) - sizeof(itemlist_equip.list)) + (sizeof(struct EQUIPITEM_INFO) * equip); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 itemlist_equip.invType = type; #endif @@ -2914,28 +2914,40 @@ static void clif_guildStorageList(struct map_session_data *sd, struct item *item static void clif_inventoryStart(struct map_session_data *sd, enum inventory_type type, const char *name) { -#if PACKETVER_RE_NUM >= 20180829 +#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 nullpo_retv(sd); nullpo_retv(name); - struct ZC_INVENTORY_START p; - p.packetType = 0xb08; -#if PACKETVER_RE_NUM >= 20180912 - p.invType = type; + char buf[sizeof(struct ZC_INVENTORY_START) + 24]; + memset(buf, 0, sizeof(buf)); + struct ZC_INVENTORY_START *p = (struct ZC_INVENTORY_START *)buf; + p->packetType = 0xb08; +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 + p->invType = type; +#endif +#if PACKETVER_RE_NUM >= 20180919 || PACKETVER_ZERO_NUM >= 20180919 + int strLen = (int)safestrnlen(name, 24); + if (strLen > 24) + strLen = 24; + const int len = sizeof(struct ZC_INVENTORY_START) + strLen; + p->packetLength = len; + safestrncpy(p->name, name, strLen); +#else + const int len = sizeof(struct ZC_INVENTORY_START); + safestrncpy(p->name, name, NAME_LENGTH); #endif - safestrncpy(p.name, name, NAME_LENGTH); - clif->send(&p, sizeof(p), &sd->bl, SELF); + clif->send(p, len, &sd->bl, SELF); #endif } static void clif_inventoryEnd(struct map_session_data *sd, enum inventory_type type) { -#if PACKETVER_RE_NUM >= 20180829 +#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 nullpo_retv(sd); struct ZC_INVENTORY_END p; p.packetType = 0xb0b; -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 p.invType = type; #endif p.flag = 0; @@ -2971,10 +2983,10 @@ static void clif_storageItems(struct map_session_data *sd, enum inventory_type t storelist_normal.PacketType = storageListNormalType; storelist_normal.PacketLength = ( sizeof( storelist_normal ) - sizeof( storelist_normal.list ) ) + (sizeof(struct NORMALITEM_INFO) * normal); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 storelist_normal.invType = type; #endif -#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 +#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 && PACKETVER_ZERO_NUM < 20180919 safestrncpy(storelist_normal.name, "Storage", NAME_LENGTH); #endif @@ -2985,10 +2997,10 @@ static void clif_storageItems(struct map_session_data *sd, enum inventory_type t storelist_equip.PacketType = storageListEquipType; storelist_equip.PacketLength = ( sizeof( storelist_equip ) - sizeof( storelist_equip.list ) ) + (sizeof(struct EQUIPITEM_INFO) * equip); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 storelist_equip.invType = type; #endif -#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 +#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 && PACKETVER_ZERO_NUM < 20180919 safestrncpy(storelist_equip.name, "Storage", NAME_LENGTH); #endif @@ -3001,11 +3013,11 @@ static void clif_storageItems(struct map_session_data *sd, enum inventory_type t static void clif_cartList(struct map_session_data *sd) { -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 clif->inventoryStart(sd, INVTYPE_CART, ""); #endif clif->cartItems(sd, INVTYPE_CART); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 clif->inventoryEnd(sd, INVTYPE_CART); #endif } @@ -3031,7 +3043,7 @@ static void clif_cartItems(struct map_session_data *sd, enum inventory_type type if (normal) { itemlist_normal.PacketType = cartlistnormalType; itemlist_normal.PacketLength = (sizeof(itemlist_normal) - sizeof(itemlist_normal.list)) + (sizeof(struct NORMALITEM_INFO) * normal); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 itemlist_normal.invType = type; #endif @@ -3041,7 +3053,7 @@ static void clif_cartItems(struct map_session_data *sd, enum inventory_type type if (equip) { itemlist_equip.PacketType = cartlistequipType; itemlist_equip.PacketLength = (sizeof(itemlist_equip) - sizeof(itemlist_equip.list)) + (sizeof(struct EQUIPITEM_INFO) * equip); -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 itemlist_equip.invType = type; #endif diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index d82a413a1..549923b99 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -198,7 +198,7 @@ enum packet_headers { #else dropflooritemType = 0x9e, #endif -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 inventorylistnormalType = 0xb09, #elif PACKETVER >= 20120925 inventorylistnormalType = 0x991, @@ -209,7 +209,7 @@ enum packet_headers { #else inventorylistnormalType = 0xa3, #endif -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 inventorylistequipType = 0xb0a, #elif PACKETVER >= 20150226 inventorylistequipType = 0xa0d, @@ -222,7 +222,7 @@ enum packet_headers { #else inventorylistequipType = 0xa4, #endif -#if PACKETVER_RE_NUM >= 20180829 +#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 storageListNormalType = 0xb09, #elif PACKETVER >= 20120925 storageListNormalType = 0x995, @@ -233,7 +233,7 @@ enum packet_headers { #else storageListNormalType = 0xa5, #endif -#if PACKETVER_RE_NUM >= 20180829 +#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 storageListEquipType = 0xb0a, #elif PACKETVER >= 20150226 storageListEquipType = 0xa10, @@ -246,7 +246,7 @@ enum packet_headers { #else storageListEquipType = 0xa6, #endif -#if PACKETVER_RE_NUM >= 20180829 +#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 cartlistnormalType = 0xb09, #elif PACKETVER >= 20120925 cartlistnormalType = 0x993, @@ -257,7 +257,7 @@ enum packet_headers { #else cartlistnormalType = 0x123, #endif -#if PACKETVER_RE_NUM >= 20180829 +#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 cartlistequipType = 0xb0a, #elif PACKETVER >= 20150226 cartlistequipType = 0xa0f, @@ -1174,7 +1174,7 @@ struct packet_roulette_itemrecv_ack { struct packet_itemlist_normal { int16 PacketType; int16 PacketLength; -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 uint8 invType; #endif struct NORMALITEM_INFO list[MAX_ITEMLIST]; @@ -1183,7 +1183,7 @@ struct packet_itemlist_normal { struct packet_itemlist_equip { int16 PacketType; int16 PacketLength; -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 uint8 invType; #endif struct EQUIPITEM_INFO list[MAX_ITEMLIST]; @@ -1192,10 +1192,10 @@ struct packet_itemlist_equip { struct ZC_STORE_ITEMLIST_NORMAL { int16 PacketType; int16 PacketLength; -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 uint8 invType; #endif -#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 +#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 && PACKETVER_ZERO_NUM < 20180919 char name[NAME_LENGTH]; #endif struct NORMALITEM_INFO list[MAX_ITEMLIST]; @@ -1203,15 +1203,22 @@ struct ZC_STORE_ITEMLIST_NORMAL { struct ZC_INVENTORY_START { int16 packetType; -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180919 || PACKETVER_ZERO_NUM >= 20180919 + int16 packetLength; +#endif +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 uint8 invType; #endif +#if PACKETVER_RE_NUM >= 20180919 || PACKETVER_ZERO_NUM >= 20180919 + char name[]; +#else char name[NAME_LENGTH]; +#endif } __attribute__((packed)); struct ZC_INVENTORY_END { int16 packetType; -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 uint8 invType; #endif char flag; @@ -1220,10 +1227,10 @@ struct ZC_INVENTORY_END { struct ZC_STORE_ITEMLIST_EQUIP { int16 PacketType; int16 PacketLength; -#if PACKETVER_RE_NUM >= 20180912 +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 uint8 invType; #endif -#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 +#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 && PACKETVER_ZERO_NUM < 20180919 char name[NAME_LENGTH]; #endif struct EQUIPITEM_INFO list[MAX_ITEMLIST]; -- cgit v1.2.3-70-g09d2 From bb5897b1d3323e8e9d2fd0fd45e2dd41679e9d30 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 22 Sep 2018 21:20:36 +0300 Subject: Fix versions usage for packet ZC_MVP_GETTING_SPECIAL_EXP It was never removed from kro (ragexe or ragexeRE), but for some reason was disabled. --- src/map/clif.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index d70f69557..5cb362c7f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7687,22 +7687,16 @@ static void clif_mvp_item(struct map_session_data *sd, int nameid) /// 010b .L static void clif_mvp_exp(struct map_session_data *sd, unsigned int exp) { -#if PACKETVER >= 20131223 // Kro removed this packet [Napster] - if (battle_config.mvp_exp_reward_message) { - char e_msg[CHAT_SIZE_MAX]; - sprintf(e_msg, msg_txt(855), exp); - clif->messagecolor_self(sd->fd, COLOR_CYAN, e_msg); // Congratulations! You are the MVP! Your reward EXP Points are %u !! - } -#else +#if PACKETVER_RE_NUM >= 20080827 || PACKETVER_MAIN_NUM >= 20090401 || defined(PACKETVER_ZERO) int fd; nullpo_retv(sd); - fd=sd->fd; - WFIFOHEAD(fd,packet_len(0x10b)); - WFIFOW(fd,0)=0x10b; - WFIFOL(fd,2)=cap_value(exp,0,INT32_MAX); - WFIFOSET(fd,packet_len(0x10b)); + fd = sd->fd; + WFIFOHEAD(fd, packet_len(0x10b)); + WFIFOW(fd, 0) = 0x10b; + WFIFOL(fd, 2) = cap_value(exp, 0, INT32_MAX); + WFIFOSET(fd, packet_len(0x10b)); #endif } -- cgit v1.2.3-70-g09d2