openkore icon indicating copy to clipboard operation
openkore copied to clipboard

Wrong npc sell and buy packets in restart

Open Henrybk opened this issue 9 years ago • 2 comments

Summary: The current packet steps for npc selling and buying are wrong in iRO restart.

I did these tests with wireshark logged in normally in my character.

Test 1:

    Instructions:
        Click npc
        Cancel
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 09d4 (sendSellComplete)

Test 2:

    Instructions:
        Click npc
        Sell
        Cancel empty
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c7 (npc_sell_list)
        send 09d4 (sendSellComplete)
        send 09d4 (sendSellComplete)

Test 3:

    Instructions:
        Click npc
        Sell
        Sell empty
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c7 (npc_sell_list)
        send 09d4 (sendSellComplete)
        send 09d4 (sendSellComplete)

Test 4:
    Instructions:
        Click npc
        Sell
        Add item
        Sell
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c7 (npc_sell_list)
        send 00c9 (sendSell or sendSellBulk)
        send 09d4 (sendSellComplete)
        send 09d4 (sendSellComplete)
        recv 00cb (sell_result)

Test 5:

    Instructions:
        Click npc
        Sell
        Add item
        Cancel
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c7 (npc_sell_list)
        send 09d4 (sendSellComplete)
        send 09d4 (sendSellComplete)

Test 6:

    Instructions:
        Click npc
        Buy
        Cancel empty
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c6 (npc_store_info)
        send 09d4 (sendSellComplete)
        send 09d4 (sendSellComplete)

Test 7:

    Instructions:
        Click npc
        Buy
        Buy empty
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c6 (npc_store_info)
        send 09d4 (sendSellComplete)
        send 09d4 (sendSellComplete)

Test 8:

    Instructions:
        Click npc
        Buy
        Add item
        Buy
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c6 (npc_store_info)
        send 00c8 (sendBuyBulk)
        send 09d4 (sendSellComplete)
        send 09d4 (sendSellComplete)
        recv 00ca (buy_result)

Test 9:

    Instructions:
        Click npc
        Buy
        Add item
        Cancel
    Results:
        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c6 (npc_store_info)
        send 09d4 (sendSellComplete)
        send 09d4 (sendSellComplete)

Only Tests 4 and 8 have 'useful' information since we are not doing the other situations normally on openkore.

At the moment a npc sell in restart looks like this:

        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
        recv 00c7 (npc_sell_list)
        send 00c9 (sendSell or sendSellBulk)
        recv 00cb (sell_result)

        send 09d4 (sendSellComplete) only when openkore moves

And a npc buy looks like this:

        send 0090 (npc_talk)
        recv 00c4 (npc_store_begin)
        send 00c5 (sendNPCBuySellList)
         recv 00c6 (npc_store_info)
        send 00c8 (sendBuyBulk)
        recv 00ca (buy_result)

Openkore sends sendSellComplete only after sell_result has been received and only before moving while it should be sent together with sendSell or sendSellBulk and sendBuyBulk (and twice). This may be the cause of some of the current autostorage / sellauto / buyauto issues.

Henrybk avatar Aug 02 '17 01:08 Henrybk

Good job my friend! thumbs up

BigRussianBot avatar Aug 02 '17 20:08 BigRussianBot

Fixed in #826

alisonrag avatar Aug 13 '17 22:08 alisonrag