diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-04-07 14:14:30 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-04-07 14:14:30 +0000 |
commit | 110b5e6c908fb2e7187b60812f55076adb0434fc (patch) | |
tree | a44b9a7c91c44c4cdac06051c26e04471dd465f9 | |
parent | 93b84b9cb16fb9335269bf486cc4c1f9105b9cd6 (diff) | |
download | hercules-110b5e6c908fb2e7187b60812f55076adb0434fc.tar.gz hercules-110b5e6c908fb2e7187b60812f55076adb0434fc.tar.bz2 hercules-110b5e6c908fb2e7187b60812f55076adb0434fc.tar.xz hercules-110b5e6c908fb2e7187b60812f55076adb0434fc.zip |
* Throwing around with packet updates.
- Clarified the description for role-change chatroom packets 0xe0 (CZ_REQ_ROLE_CHANGE) and 0xe1 (ZC_ROLE_CHANGE).
- Fixed auction window opening packet 0x25f (ZC_AUCTION_WINDOWS) had also a close button packet attached (since r12270).
- Fixed auction search results packet 0x252 (ZC_AUCTION_ITEM_REQ_SEARCH) obtaining only a WFIFO buffer of 20 bytes, regardless of the amount of results (since r12301).
- Fixed auction search result item type was .W instead of .L, which also eliminates the unknown field after it (since r12301).
- Fixed an odd packet in clif_Auction_close, which is supposed to have layout of 0x25e, while using 0x25d as packet type (since r12323).
- Resolved unconfirmed fields in clif_party_show_picker (follow up to r13987).
- Updated packet layouts for auction in packet_db.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14777 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 9 | ||||
-rw-r--r-- | db/packet_db.txt | 6 | ||||
-rw-r--r-- | src/map/clif.c | 109 |
3 files changed, 69 insertions, 55 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index ae006de4f..9426b2dc4 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,5 +1,14 @@ Date Added +2011/04/07 + * Throwing around with packet updates. [Ai4rei] + - Clarified the description for role-change chatroom packets 0xe0 (CZ_REQ_ROLE_CHANGE) and 0xe1 (ZC_ROLE_CHANGE). + - Fixed auction window opening packet 0x25f (ZC_AUCTION_WINDOWS) had also a close button packet attached (since r12270). + - Fixed auction search results packet 0x252 (ZC_AUCTION_ITEM_REQ_SEARCH) obtaining only a WFIFO buffer of 20 bytes, regardless of the amount of results (since r12301). + - Fixed auction search result item type was .W instead of .L, which also eliminates the unknown field after it (since r12301). + - Fixed an odd packet in clif_Auction_close, which is supposed to have layout of 0x25e, while using 0x25d as packet type (since r12323). + - Resolved unconfirmed fields in clif_party_show_picker (follow up to r13987). + - Updated packet layouts for auction in packet_db. 2011/04/06 * Resolved some pc_setparam issues. [Ai4rei] - Fixed HP/MaxHP/SP/MaxSP could be set to arbitrary values, thus disregarding configuration limits and causing client crashes on certain conditions (bugreport:4177). diff --git a/db/packet_db.txt b/db/packet_db.txt index f1f1af53c..a3f91ee78 100644 --- a/db/packet_db.txt +++ b/db/packet_db.txt @@ -767,7 +767,7 @@ packet_ver: 18 0x0248,68 0x0249,3 0x024a,70 -0x024b,4,auctioncancelreg,0 +0x024b,4,auctioncancelreg,2 0x024c,8,auctionsetitem,0 0x024d,14 0x024e,6,auctioncancel,0 @@ -799,7 +799,7 @@ packet_ver: 19 0x0251,4 //2005-08-08aSakexe -0x024d,12,auctionregister,0 +0x024d,12,auctionregister,2:6:10 0x024e,4 //2005-08-17aSakexe @@ -830,7 +830,7 @@ packet_ver: 19 //2005-10-17aSakexe 0x007a,58 -0x025d,6,auctionclose,0 +0x025d,6,auctionclose,2 0x025e,4 //2005-10-24aSakexe diff --git a/src/map/clif.c b/src/map/clif.c index 496100c65..e4105c170 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3297,8 +3297,8 @@ int clif_addchat(struct chat_data* cd,struct map_session_data *sd) } /*========================================== - * Announce the new owner - * R 00e1 <owner flag>.l <nick>.24B + * Announce the new owner (ZC_ROLE_CHANGE) + * R 00e1 <role>.L <nick>.24B *------------------------------------------*/ void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd) { @@ -3307,18 +3307,12 @@ void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd) nullpo_retv(sd); nullpo_retv(cd); - //FIXME: this announces a swap between positions 0 and 1 (probably not what we want) [ultramage] - //FIXME: aegis sends obviously incorrect packets; need to figure out what to send to display it correctly :X - //TODO: is it just owner swap, or can it do general-purpose reordering? - // It's not position, but operator flag, everyone set to 1 gets chat - // operator menu (yes, that means a chat may host multiple operators) [Ai4rei] - WBUFW(buf, 0) = 0xe1; - WBUFL(buf, 2) = 1; + WBUFL(buf, 2) = 1; // normal memcpy(WBUFP(buf,6),cd->usersd[0]->status.name,NAME_LENGTH); WBUFW(buf,30) = 0xe1; - WBUFL(buf,32) = 0; + WBUFL(buf,32) = 0; // owner (menu) memcpy(WBUFP(buf,36),sd->status.name,NAME_LENGTH); clif_send(buf,packet_len(0xe1)*2,&sd->bl,CHAT); @@ -9615,11 +9609,14 @@ void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) } /*========================================== - * S 00e0 ?.l <nick>.24B + * CZ_REQ_ROLE_CHANGE + * S 00e0 <role>.L <nick>.24B + * role: + * 0 = owner (ROOMROLE_OWNER) + * 1 = normal (ROOMROLE_GENERAL) *------------------------------------------*/ void clif_parse_ChangeChatOwner(int fd, struct map_session_data* sd) { - //TODO: the first argument seems to be the destination position (always 0) [ultramage] chat_changechatowner(sd,(char*)RFIFOP(fd,6)); } @@ -12856,6 +12853,13 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd) * AUCTION SYSTEM * By Zephyrus *==========================================*/ + + +/// Opens/closes the auction window (ZC_AUCTION_WINDOWS) +/// 025f <type>.L +/// type: +/// 0 = open +/// 1 = close void clif_Auction_openwindow(struct map_session_data *sd) { int fd = sd->fd; @@ -12863,17 +12867,15 @@ void clif_Auction_openwindow(struct map_session_data *sd) if( sd->state.storage_flag || sd->state.vending || sd->state.buyingstore || sd->state.trading ) return; - WFIFOHEAD(fd,12); + WFIFOHEAD(fd,packet_len(0x25f)); WFIFOW(fd,0) = 0x25f; WFIFOL(fd,2) = 0; - WFIFOB(fd,6) = 0xb6; - WFIFOB(fd,7) = 0x00; - WFIFOB(fd,8) = 0xa6; - WFIFOB(fd,9) = 0xde; - WFIFOW(fd,10) = 0; - WFIFOSET(fd,12); + WFIFOSET(fd,packet_len(0x25f)); } + +/// Returns auction item search results (ZC_AUCTION_ITEM_REQ_SEARCH) +/// 0252 <packet len>.W <pages>.L <count>.L { <auction id>.L <seller name>.24B <name id>.W <type>.L <amount>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <now price>.L <max price>.L <buyer name>.24B <delete time>.L }* void clif_Auction_results(struct map_session_data *sd, short count, short pages, uint8 *buf) { int i, fd = sd->fd, len = sizeof(struct auction_data); @@ -12881,7 +12883,7 @@ void clif_Auction_results(struct map_session_data *sd, short count, short pages, struct item_data *item; int k; - WFIFOHEAD(fd,20); + WFIFOHEAD(fd,12 + (count * 83)); WFIFOW(fd,0) = 0x252; WFIFOW(fd,2) = 12 + (count * 83); WFIFOL(fd,4) = pages; @@ -12900,9 +12902,8 @@ void clif_Auction_results(struct map_session_data *sd, short count, short pages, else WFIFOW(fd,28+k) = auction.item.nameid; - WFIFOW(fd,30+k) = auction.type; - WFIFOW(fd,32+k) = 0; // ?? - WFIFOW(fd,34+k) = auction.item.amount; // Allways 1 + WFIFOL(fd,30+k) = auction.type; + WFIFOW(fd,34+k) = auction.item.amount; // Always 1 WFIFOB(fd,36+k) = auction.item.identify; WFIFOB(fd,37+k) = auction.item.attribute; WFIFOB(fd,38+k) = auction.item.refine; @@ -12915,7 +12916,7 @@ void clif_Auction_results(struct map_session_data *sd, short count, short pages, safestrncpy((char*)WFIFOP(fd,55+k), auction.buyer_name, NAME_LENGTH); WFIFOL(fd,79+k) = (uint32)auction.timestamp; } - WFIFOSET(fd, 12 + (count * 83)); + WFIFOSET(fd,WFIFOW(fd,2)); } static void clif_Auction_setitem(int fd, int index, bool fail) @@ -12938,7 +12939,7 @@ void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd) void clif_parse_Auction_setitem(int fd, struct map_session_data *sd) { int idx = RFIFOW(fd,2) - 2; - int amount = RFIFOL(fd,4); // Allways 1 + int amount = RFIFOL(fd,4); // Always 1 struct item_data *item; if( sd->auction.amount > 0 ) @@ -12973,34 +12974,40 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd) clif_Auction_setitem(fd, idx + 2, false); } -// 0 = You have failed to bid into the auction -// 1 = You have successfully bid in the auction -// 2 = The auction has been canceled -// 3 = An auction with at least one bidder cannot be canceled -// 4 = You cannot register more than 5 items in an auction at a time -// 5 = You do not have enough Zeny to pay the Auction Fee -// 6 = You have won the auction -// 7 = You have failed to win the auction -// 8 = You do not have enough Zeny -// 9 = You cannot place more than 5 bids at a time - +/// Result from an auction action (ZC_AUCTION_RESULT) +/// 0250 <result>.B +/// result: +/// 0 = You have failed to bid into the auction +/// 1 = You have successfully bid in the auction +/// 2 = The auction has been canceled +/// 3 = An auction with at least one bidder cannot be canceled +/// 4 = You cannot register more than 5 items in an auction at a time +/// 5 = You do not have enough Zeny to pay the Auction Fee +/// 6 = You have won the auction +/// 7 = You have failed to win the auction +/// 8 = You do not have enough Zeny +/// 9 = You cannot place more than 5 bids at a time void clif_Auction_message(int fd, unsigned char flag) { - WFIFOHEAD(fd,3); + WFIFOHEAD(fd,packet_len(0x250)); WFIFOW(fd,0) = 0x250; WFIFOB(fd,2) = flag; - WFIFOSET(fd,3); + WFIFOSET(fd,packet_len(0x250)); } -// 0 = You have ended the auction -// 1 = You cannot end the auction -// 2 = Bid number is incorrect + +/// Result of the auction close request (ZC_AUCTION_ACK_MY_SELL_STOP) +/// 025e <result>.W +/// result: +/// 0 = You have ended the auction +/// 1 = You cannot end the auction +/// 2 = Bid number is incorrect void clif_Auction_close(int fd, unsigned char flag) { - WFIFOHEAD(fd,6); - WFIFOW(fd,0) = 0x25d; - WFIFOL(fd,2) = flag; - WFIFOSET(fd,6); + WFIFOHEAD(fd,packet_len(0x25e)); + WFIFOW(fd,0) = 0x25d; // BUG: The client identifies this packet as 0x25d (CZ_AUCTION_REQ_MY_SELL_STOP) + WFIFOW(fd,2) = flag; + WFIFOSET(fd,packet_len(0x25e)); } void clif_parse_Auction_register(int fd, struct map_session_data *sd) @@ -13987,6 +13994,7 @@ void clif_party_show_picker(struct map_session_data * sd, struct item * item_dat { #if PACKETVER >= 20071002 unsigned char buf[22]; + struct item_data* id = itemdb_search(item_data->nameid); WBUFW(buf,0)=0x2b8; WBUFL(buf,2) = sd->status.account_id; @@ -13994,12 +14002,9 @@ void clif_party_show_picker(struct map_session_data * sd, struct item * item_dat WBUFB(buf,8) = item_data->identify; WBUFB(buf,9) = item_data->attribute; WBUFB(buf,10) = item_data->refine; - WBUFW(buf,11) = item_data->card[0]; - WBUFW(buf,13) = item_data->card[1]; - WBUFW(buf,15) = item_data->card[2]; - WBUFW(buf,17) = item_data->card[3]; - //WBUFW(buf,19) = 0; // equip location? 32+2 for left/right hand, 0x8000 for 'throw' (verify this) - //WBUFB(buf,21) = 0; // item type + clif_addcards(WBUFP(buf,11), item_data); + WBUFW(buf,19) = id->equip; // equip location + WBUFB(buf,21) = itemtype(id->type); // item type clif_send(buf, packet_len(0x2b8), &sd->bl, PARTY_SAMEMAP_WOS); #endif } @@ -14846,7 +14851,7 @@ static int packetdb_readdb(void) 12, 26, 9, 11, -1, -1, 10, 2,282, 11, 4, 36, -1, -1, 4, 2, //#0x0240 -1, -1, -1, -1, -1, 3, 4, 8, -1, 3, 70, 4, 8, 12, 4, 10, - 3, 32, -1, 3, 3, 5, 5, 8, 2, 3, -1, 6, 4, -1, 4, 0, + 3, 32, -1, 3, 3, 5, 5, 8, 2, 3, -1, 6, 4, 6, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //#0x0280 |