From f7847c3fd035db1dbd0bcabfb05c9d9d469767ad Mon Sep 17 00:00:00 2001 From: ai4rei Date: Mon, 18 Apr 2011 02:10:38 +0000 Subject: * Updated packet for the view players' equip feature for 2010-11-24aRagexeRE+ and made it support robes (follow up to r14797). - Fixed spawn/walking packets using wrong variable for shifting buffer reference (since r14797). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14799 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ src/map/clif.c | 64 +++++++++++++++++++++++++++++++---------------------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index bc05a05f4..1bbd73c5d 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,6 +1,8 @@ Date Added 2011/04/17 + * Updated packet for the view players' equip feature for 2010-11-24aRagexeRE+ and made it support robes (follow up to r14797). [Ai4rei] + - Fixed spawn/walking packets using wrong variable for shifting buffer reference (since r14797). * Fixed char-server missing some WFIFOHEAD (partially due to r10909 being reverted by r11245, follow up to r9307 and r14618). [Ai4rei] 2011/04/16 * Added support for visible garments/robes. [Ai4rei] diff --git a/src/map/clif.c b/src/map/clif.c index 0bd3519ff..0ef00507b 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -886,7 +886,7 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool #if PACKETVER >= 20110111 WBUFW(buf,34) = vd->robe; offset+= 2; - buf = WBUFP(buf,offset); + buf = WBUFP(buffer,offset); #endif WBUFL(buf,34) = status_get_guild_id(bl); WBUFW(buf,38) = status_get_emblem_id(bl); @@ -1009,7 +1009,7 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un #if PACKETVER >= 20110111 WBUFW(buf,38) = vd->robe; offset+= 2; - buf = WBUFP(buf,offset); + buf = WBUFP(buffer,offset); #endif WBUFL(buf,38) = status_get_guild_id(bl); WBUFW(buf,42) = status_get_emblem_id(bl); @@ -8056,15 +8056,15 @@ void clif_equipcheckbox(struct map_session_data* sd) WFIFOSET(fd, packet_len(0x2da)); } -/*========================================== - * Sends info about a player's equipped items - * R 002d7 .W .24B .w .w .w .w .w .w .w .1B {equip item}.26B* - * for PACKETVER >= 20100629 - * R 002d7 .W .24B .w .w .w .w .w .w .w .1B {equip item}.28B* - *------------------------------------------*/ +/// Sends info about a player's equipped items (ZC_EQUIPWIN_MICROSCOPE) +/// 02d7 .W .24B .W .W .W .W .W .W .W .B {equip item}.26B* +/// 02d7 .W .24B .W .W .W .W .W .W .W .B {equip item}.28B* (PACKETVER >= 20100629) +/// 0859 .W .24B .W .W .W .W .W .W .W .B {equip item}.28B* (PACKETVER >= 20101124) +/// 0859 .W .24B .W .W .W .W .W .W .W .W .B {equip item}.28B* (PACKETVER >= 20110111) void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd) { - int i, n, fd; + uint8* buf; + int i, n, fd, offset = 0; #if PACKETVER < 20100629 const int s = 26; #else @@ -8075,17 +8075,27 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts fd = sd->fd; WFIFOHEAD(fd, MAX_INVENTORY * s + 43); + buf = WFIFOP(fd,0); - WFIFOW(fd, 0) = 0x2d7; - safestrncpy((char*)WFIFOP(fd, 4), tsd->status.name, NAME_LENGTH); - WFIFOW(fd,28) = tsd->status.class_; - WFIFOW(fd,30) = tsd->vd.hair_style; - WFIFOW(fd,32) = tsd->vd.head_bottom; - WFIFOW(fd,34) = tsd->vd.head_mid; - WFIFOW(fd,36) = tsd->vd.head_top; - WFIFOW(fd,38) = tsd->vd.hair_color; - WFIFOW(fd,40) = tsd->vd.cloth_color; - WFIFOB(fd,42) = tsd->vd.sex; +#if PACKETVER < 20101124 + WBUFW(buf, 0) = 0x2d7; +#else + WBUFW(buf, 0) = 0x859; +#endif + safestrncpy((char*)WBUFP(buf, 4), tsd->status.name, NAME_LENGTH); + WBUFW(buf,28) = tsd->status.class_; + WBUFW(buf,30) = tsd->vd.hair_style; + WBUFW(buf,32) = tsd->vd.head_bottom; + WBUFW(buf,34) = tsd->vd.head_mid; + WBUFW(buf,36) = tsd->vd.head_top; +#if PACKETVER >= 20110111 + WBUFW(buf,38) = tsd->vd.robe; + offset+= 2; + buf = WBUFP(buf,2); +#endif + WBUFW(buf,38) = tsd->vd.hair_color; + WBUFW(buf,40) = tsd->vd.cloth_color; + WBUFB(buf,42) = tsd->vd.sex; for(i=0,n=0; i < MAX_INVENTORY; i++) { @@ -8095,24 +8105,24 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts continue; // Inventory position - WFIFOW(fd, n*s+43) = i + 2; + WBUFW(buf, n*s+43) = i + 2; // Add refine, identify flag, element, etc. - clif_item_sub(WFIFOP(fd,0), n*s+45, &tsd->status.inventory[i], tsd->inventory_data[i], pc_equippoint(tsd, i)); + clif_item_sub(WBUFP(buf,0), n*s+45, &tsd->status.inventory[i], tsd->inventory_data[i], pc_equippoint(tsd, i)); // Add cards - clif_addcards(WFIFOP(fd, n*s+55), &tsd->status.inventory[i]); + clif_addcards(WBUFP(buf, n*s+55), &tsd->status.inventory[i]); // Expiration date stuff, if all of those are set to 0 then the client doesn't show anything related (6 bytes) - WFIFOL(fd, n*s+63) = tsd->status.inventory[i].expire_time; - WFIFOW(fd, n*s+67) = 0; + WBUFL(buf, n*s+63) = tsd->status.inventory[i].expire_time; + WBUFW(buf, n*s+67) = 0; #if PACKETVER >= 20100629 if (tsd->inventory_data[i]->equip&EQP_VISIBLE) - WFIFOW(fd, n*s+69) = tsd->inventory_data[i]->look; + WBUFW(buf, n*s+69) = tsd->inventory_data[i]->look; else - WFIFOW(fd, n*s+69) = 0; + WBUFW(buf, n*s+69) = 0; #endif n++; } - WFIFOW(fd, 2) = 43 + n*s; // Set length + WFIFOW(fd, 2) = 43+offset+n*s; // Set length WFIFOSET(fd, WFIFOW(fd, 2)); } -- cgit v1.2.3-70-g09d2