Jump to content
  • 0

[r17690] i got sent incorrect cash shop buy packet.


youyi1314

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   2
  • Joined:  01/22/13
  • Last Seen:  

Hi , 

 

May i know what should i change in clif.c in r17690?

here is cashshop_buy from r17690 clif.c

/// Request to buy item(s) from cash shop (CZ_PC_BUY_CASH_POINT_ITEM).
/// 0288 <name id>.W <amount>.W
/// 0288 <name id>.W <amount>.W <kafra points>.L (PACKETVER >= 20070711)
/// 0288 <packet len>.W <kafra points>.L <count>.W { <amount>.W <name id>.W }.4B*count (PACKETVER >= 20100803)
/// 0848 <packet len>.W <count>.W <packet len>.W <kafra points>.L <count>.W { <amount>.W <name id>.W <tab>.W }.6B*count (PACKETVER >= 20130000)
void clif_parse_cashshop_buy(int fd, struct map_session_data *sd){

    int fail = 0;
    struct s_packet_db* info;
    int cmd = RFIFOW(fd,0);

    nullpo_retv(sd);

    info = &packet_db[sd->packet_ver][cmd];

    if( sd->state.trading || !sd->npc_shopid )
        fail = 1;
    else {
// #if PACKETVER < 20101116
#if PACKETVER < 20120410
        short nameid = RFIFOW(fd,info->pos[0]);
        short amount = RFIFOW(fd,info->pos[1]);
        int points   = RFIFOL(fd,info->pos[2]);

        fail = npc_cashshop_buy(sd, nameid, amount, points);
        clif_cashshop_ack(sd,fail);
#else
        int s_itl = (cmd==0x848)?10:4; //item _list size (depend on cmd even for 2013+)
        int len    = RFIFOW(fd,info->pos[0]);
        int points = RFIFOL(fd,info->pos[1]);
        int count  = RFIFOW(fd,info->pos[2]);
        unsigned short* item_list = (unsigned short*)RFIFOP(fd,info->pos[3]);

        if( len < 10 || len != 10 + count * s_itl){
            ShowWarning("Player %u sent incorrect cash shop buy packet (len %u:%u)!\n", sd->status.char_id, len, 10 + count * s_itl);
            return;
        }
        if(cmd==0x848){
            cashshop_buylist( sd, points, count, item_list);
        } else {
            fail = npc_cashshop_buylist(sd,points,count,item_list);
        }
#endif
    }
    clif_cashshop_ack(sd,fail);
} 

 

This is what my map server show:

[Warning]: Player 150000 sent incorrect cash shop buy packet (len 20:10)!

 

my i use Brynner packet_db.txt  from : http://rathena.org/board/topic/81747-2012-04-10aragexe-v3-booking-system/
 

and their patch not work with my revision. 

thanks.

Edited by youyi1314
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...