[RESOLVED] Client API does not send the Collection message properly

    • [RESOLVED] Client API does not send the Collection message properly

      Update: cause of the bug seems to be size of collection rather than the latest patch. See following messages.

      Since the 1.1.0.034 patch, the client always sends an empty array in the Collection message:

      Source Code

      1. {"Action":"","Complete":[],"CardsAdded":[],"CardsRemoved":[],"User":"Fred","Message":"Collection","Version":"Live"}

      The post was edited 1 time, last by Fred ().

    • Since version 1.1.0.038, I started having the same issue on Windows (Steam), so I updated the thread title since it's no longer Linux only.

      To make sure my message listener wasn't the one receiving the wrong data, I installed a packet sniffer (Wireshark) on the Windows machine and captured outgoing packets to my server. Here's the raw HTTP request of the Collection call:

      Source Code

      1. 0000 50 4f 53 54 20 2f 72 65 71 75 65 73 74 73 20 48 POST /requests H
      2. 0010 54 54 50 2f 31 2e 31 0d 0a 41 63 63 65 70 74 3a TTP/1.1..Accept:
      3. 0020 20 2a 2f 2a 0d 0a 55 73 65 72 2d 41 67 65 6e 74 */*..User-Agent
      4. 0030 3a 20 48 65 78 43 6c 69 65 6e 74 0d 0a 43 6f 6e : HexClient..Con
      5. 0040 6e 65 63 74 69 6f 6e 3a 20 63 6c 6f 73 65 0d 0a nection: close..
      6. 0050 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61 70 Content-Type: ap
      7. 0060 70 6c 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e 0d 0a plication/json..
      8. 0070 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 Content-Length:
      9. 0080 31 31 35 0d 0a 48 6f 73 74 3a 20 31 39 32 2e 31 115..Host: 192.1
      10. 0090 36 38 2e 39 2e 32 30 0d 0a 0d 0a 7b 22 41 63 74 68.9.20....{"Act
      11. 00a0 69 6f 6e 22 3a 22 22 2c 22 43 6f 6d 70 6c 65 74 ion":"","Complet
      12. 00b0 65 22 3a 5b 5d 2c 22 43 61 72 64 73 41 64 64 65 e":[],"CardsAdde
      13. 00c0 64 22 3a 5b 5d 2c 22 43 61 72 64 73 52 65 6d 6f d":[],"CardsRemo
      14. 00d0 76 65 64 22 3a 5b 5d 2c 22 55 73 65 72 22 3a 22 ved":[],"User":"
      15. 00e0 46 72 65 64 22 2c 22 4d 65 73 73 61 67 65 22 3a Fred","Message":
      16. 00f0 22 43 6f 6c 6c 65 63 74 69 6f 6e 22 2c 22 56 65 "Collection","Ve
      17. 0100 72 73 69 6f 6e 22 3a 22 4c 69 76 65 22 7d 0d 0a rsion":"Live"}..
      Display All
      The "Action" field is an empty string, and each of "Complete", "CardsAdded" and "CardsRemoved" are empty arrays. I get the same result whether it's the first collection sync when I login, or when I buy a card or sell a card on the AH.

      FWIW, the "Inventory" call gets correctly populated. Only Collection is affected.

      The post was edited 1 time, last by Fred ().

    • Further investigation leads me to believe it's not related to the client or the patch, but rather the player or the collection itself.

      With the same client, a different account (with a smaller collection) sends the Collection message just fine. Seeing that, I got rid of thousands of duplicates in order to reduce the size of my own collection, and the message still doesn't get sent properly. At this point, I'm suspecting that, since the Collection message does not send individual objects for each copy of a same card but rather has a "Count" value, then it's the amount of distinct cards in one's collection that makes the message too large for the client to process. We seemed to have reached a tipping point with the 9th set where players with close to complete collections now have too many different cards in their collection for the client API to work properly.
    • Yes I feel like this is most likely the issue. I was talking with someone about buying a collection of mostly set 7-9 and they were able to sync just fine. My collection has been getting worse and worse since set 8 and now it sends a blank collection array and I get no update. It doesn't update stash items or cards.