Jump to content


Photo

Windower Packets bug (packets.parse)


    5 replies to this topic

    #1 Sammeh

    Sammeh

      Member

    • Members
    • PipPip
    • 24 posts

      Posted 07 May 2017 - 10:47 PM

      I apologize if this isn't the right forum to post; however i was trying to build a generic 'buy' script to command line buy items.

       

      When I talk to a shop NPC I get a return 0x03c which seems to have the list of items to purchase.  However, the list is inaccurate based on   packets.parse. 

       

      Example:

      Yoskolo in Lower-Jeuno offers to sell a number of items (16); however the packets.parse returns 24 items.  A handful of the items are correctly parse and a handful are not - which seems to me to be an offset definition somewhere.

       

      I'm going to try and debug and extract the exact bits I need/want by reading it raw, but if you guys can help on the packets.parse that would be more consistent.

       

      To recreate simply load up PacketViewer then log incoming 0x03c.

       

      What is for sale in the game:

      image.png

       

       

      Log:

      [2017-05-07 13:32:13] 
              |  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F      | 0123456789ABCDEF
          -----------------------------------------------------  ----------------------
            0 | 3C 64 3D 06 00 00 0F 01 0C 00 00 00 9D 11 00 C2    0 | <d=.............
            1 | 00 00 00 00 C8 00 00 00 46 11 01 00 00 00 00 00    1 | ........F.......
            2 | 2C 01 00 00 47 11 02 00 00 00 00 00 4C 04 00 00    2 | ,...G.......L...
            3 | 48 11 03 00 00 00 00 00 A2 03 00 00 59 11 04 00    3 | H...........Y...
            4 | 00 00 00 00 90 01 00 00 5A 11 05 00 00 00 00 00    4 | ........Z.......
            5 | A8 15 00 00 CC 11 06 00 00 00 00 00 EC 18 00 00    5 | ................
            6 | B6 13 07 00 00 00 00 00 10 1D 00 00 B7 13 08 00    6 | ................
            7 | 00 00 00 00 34 17 00 00 B8 13 09 00 00 00 00 00    7 | ....4...........
            8 | F8 11 00 00 B9 13 0A 00 00 00 00 00 F0 1E 00 00    8 | ................
            9 | BA 13 0B 00 00 00 00 00 88 13 00 00 BB 13 0C 00    9 | ................
            A | 00 00 00 00 68 10 00 00 BC 13 0D 00 00 00 00 00    A | ....h...........
            B | D0 20 00 00 BD 13 0E 00 00 00 00 00 60 EA 00 00    B | . ..........`...
            C | D6 13 0F 00 00 00 00 00 -- -- -- -- -- -- -- --    C | ........--------
      _zero1: 0
      _padding1: 271
      Price 1: 12 (12 G)
      Item 1: 4509 (Distilled Water)
      Shop Slot 1: 49664
      Price 2: 0 (0 G)
      Item 2: 200 (Tsahyan Mask)
      Shop Slot 2: 0
      Price 3: 69958 (69,958 G)
      Item 3: 0 (-)
      Shop Slot 3: 0
      Price 4: 300 (300 G)
      Item 4: 4423 (Apple Juice)
      Shop Slot 4: 2
      Price 5: 0 (0 G)
      Item 5: 1100 (Xalmo Feather)
      Shop Slot 5: 0
      Price 6: 201032 (201,032 G)
      Item 6: 0 (-)
      Shop Slot 6: 0
      Price 7: 930 (930 G)
      Item 7: 4441 (Grape Juice)
      Shop Slot 7: 4
      Price 8: 0 (0 G)
      Item 8: 400 (Gr. Mahogany Bed)
      Shop Slot 8: 0
      Price 9: 332122 (332,122 G)
      Item 9: 0 (-)
      Shop Slot 9: 0
      Price 10: 5544 (5,544 G)
      Item 10: 4556 (Icecap Rolanberry)
      Shop Slot 10: 6
      Price 11: 0 (0 G)
      Item 11: 6380 (Refined Chair)
      Shop Slot 11: 0
      
      

      The 2nd item should be Orange Juice - resource item # 4422 which in hex is 1146, which you can see in line "1" of the raw hex above right in the middle "46 11".  However it's being parsed as item "200" (Hex: C8).

       

       

      Any help would be appreciated!

       

      thanks,

      Sam

       



      #2 Sammeh

      Sammeh

        Member

      • Members
      • PipPip
      • 24 posts

        Posted 07 May 2017 - 10:49 PM

        Here to post 5 seconds after I did... I just noticed that the subsequent items appear to match the current price of the item.   Example: Orange Juice is 200 gil.   Xalmo Feather (item 1100) is really the price of Melon Juice.

         

        -Sam



        #3 Sammeh

        Sammeh

          Member

        • Members
        • PipPip
        • 24 posts

          Posted 07 May 2017 - 11:35 PM

          I added a couple bits of padding... not sure if this is the right way to do it (probably not - I'm a newb at this stuff).   but seems to be functioning correctly now.

           

          addons\libs\packets\fields.lua

          Starting Line 2097 - adding in _junk1 and _junk2

          types.shop_item = L{
              {ctype='unsigned int',      label='Price',              fn=gil},            -- 00
              {ctype='unsigned short',    label='Item',               fn=item},           -- 04
              {ctype='unsigned short',    label='Shop Slot'},                             -- 08
          	{ctype='unsigned short',     label='_junk1'},                               -- Adding Junk1
          	{ctype='unsigned short',     label='_junk2'},                               -- Adding Junk2
          }
          
          


          #4 Sammeh

          Sammeh

            Member

          • Members
          • PipPip
          • 24 posts

            Posted 08 May 2017 - 04:42 PM

            Well I'll keep adding.

             

            What I allocated as _junk1 and _junk2 do have values when purchasing from the Guild NPCs..   

             

            _junk1 -  Correlates to res.skills  as the Skill ID

            _junk2 - Correlates to rank but I can't find a correlation in Resources.

             

            Based on this - will be renaming them to "Craft Skill" and "Craft Rank"

             

             

            Sample log:

            
            _padding1: 0
            Price 1: 100 (100 G)
            Item 1: 1657 (Bundling Twine)
            Shop Slot 1: 17408
            _junk1 1: 49
            _junk2 1: 0
            Price 2: 25 (25 G)
            Item 2: 688 (Arrowwood Log)
            Shop Slot 2: 1
            _junk1 2: 49
            _junk2 2: 0
            Price 3: 50 (50 G)
            Item 3: 689 (Lauan Log)
            Shop Slot 3: 2
            _junk1 3: 49
            _junk2 3: 0
            Price 4: 70 (70 G)
            Item 4: 691 (Maple Log)
            Shop Slot 4: 3
            _junk1 4: 49
            _junk2 4: 0
            Price 5: 800 (800 G)
            Item 5: 697 (Holly Log)
            Shop Slot 5: 4
            _junk1 5: 49
            _junk2 5: 200
            Price 6: 1600 (1,600 G)
            Item 6: 695 (Willow Log)
            Shop Slot 6: 5
            _junk1 6: 49
            _junk2 6: 200
            Price 7: 1300 (1,300 G)
            Item 7: 693 (Walnut Log)
            Shop Slot 7: 6
            _junk1 7: 49
            _junk2 7: 200
            Price 8: 500 (500 G)
            Item 8: 696 (Yew Log)
            Shop Slot 8: 7
            _junk1 8: 49
            _junk2 8: 300
            Price 9: 3800 (3,800 G)
            Item 9: 690 (Elm Log)
            Shop Slot 9: 8
            _junk1 9: 49
            _junk2 9: 300
            Price 10: 3400 (3,400 G)
            Item 10: 694 (Chestnut Log)
            Shop Slot 10: 9
            _junk1 10: 49
            _junk2 10: 300
            Price 11: 2000 (2,000 G)
            Item 11: 727 (Dogwood Log)
            Shop Slot 11: 10
            _junk1 11: 49
            _junk2 11: 400
            Price 12: 4000 (4,000 G)
            Item 12: 699 (Oak Log)
            Shop Slot 12: 11
            _junk1 12: 49
            _junk2 12: 400
            Price 13: 4500 (4,500 G)
            Item 13: 701 (Rosewood Log)
            Shop Slot 13: 12
            _junk1 13: 49
            _junk2 13: 500
            Price 14: 4500 (4,500 G)
            Item 14: 700 (Mahogany Log)
            Shop Slot 14: 13
            _junk1 14: 49
            _junk2 14: 600
            Price 15: 5000 (5,000 G)
            Item 15: 702 (Ebony Log)
            Shop Slot 15: 14
            _junk1 15: 49
            _junk2 15: 700
            Price 16: 5500 (5,500 G)
            Item 16: 2761 (Feyweald Log)
            Shop Slot 16: 15
            _junk1 16: 49
            _junk2 16: 700
            Price 17: 300 (300 G)
            
            
            
            
            


            #5 Kenshi

            Kenshi

              Advanced Member

            • Members
            • PipPipPip
            • 334 posts

              Posted 08 May 2017 - 06:13 PM

              You should send a pull request on Github for it to be updated.



              #6 Sammeh

              Sammeh

                Member

              • Members
              • PipPip
              • 24 posts

                Posted 08 May 2017 - 11:20 PM

                Just did.  Not sure etiquette on that process (I'm not a developer in nature).  I also added several of the custom addons there.






                1 user(s) are reading this topic

                0 members, 1 guests, 0 anonymous users