Page 1 of 1

Incorrect packet

Posted: Mon Jun 08, 2009 3:38 pm
by Gnacik
Probably i should post that in Bug Report section but i choose Discussion
because we can discuss that problem ;)

Some players notice about error with 'duplicated items'. When you for example buy seeds or crystalize something and have opened inventory you see new item twice. And you must close & open inventory again to see only one, correct item. Its only visual effect, not a serious bug.

I make a little reasearch and found a reason - PCInventory.java : addItem()

additem is sending InventoryUpdate() packet or ItemList() packet

Problem is with InventoryUpdate() and that is a main reason of duplicated items. For example : if you crystalize something one InventoryUpdate() is send from clientpackets/RequestCrystalize with +crystal -item and second packet is send from Additem() with only +item

I make a little sniff on offi and after crystalize only one InventoryUpdate() is send with +crystal -item

Similar problem is with quest items, buy seeds and probably in many places where addItem is used.

I suggest remove that packet from additem. its not necessary - i can say/proof that is incorrect there - correct packets should be send AFTER using additem(). And we can save some traffic ;)

Re: Incorrect packet

Posted: Mon Jun 08, 2009 4:45 pm
by _DS_
Create patch, install and test on live, tell about results :)

Re: Incorrect packet

Posted: Wed Jun 10, 2009 1:23 pm
by janiii
gnat wrote: I suggest remove that packet from additem. its not necessary - i can say/proof that is incorrect there - correct packets should be send AFTER using additem(). And we can save some traffic ;)
why not leave it in addItem and remove from methods they call it?

Re: Incorrect packet

Posted: Wed Jun 10, 2009 1:33 pm
by Gnacik
Because in many situation packet InventoryUpdate is with more items. for example

crystalize - server must send packet with +crystals -item
buyseed - server must send one packet with x-buyed items - not x packets with 1 seed each.

and in many places we already send correct 1 packet with all information. AND duplicated packet from additem

if we leave packet in additem() in many places we will send x packets with 1 item each instead of 1 packet.

maybe its not a big deal, but on high populated servers every unnecessary packet can make a difference.

Re: Incorrect packet

Posted: Wed Jun 10, 2009 1:45 pm
by janiii
what i dont understand is, why this wasn't an issue on 2.2 because the packets were sent in the same way - in addItem and also after..

Re: Incorrect packet

Posted: Wed Jun 10, 2009 1:52 pm
by JIV
because ct2.2 handle that packet different way so it showed up now, and also maybe NCZ0ft checking l2j and edit client to be incompatibile for reason xD

Re: Incorrect packet

Posted: Wed Jun 10, 2009 4:14 pm
by toastgodsupreme
janiii wrote:what i dont understand is, why this wasn't an issue on 2.2 because the packets were sent in the same way - in addItem and also after..
I think CT2.2 had the inventory glitch of seeing 2 sets of crystals when crystalizing. I never paid it much attention really. just toggled the inventory and continued on.