Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions addons/libs/packets/fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,10 @@ fields.outgoing[0x05A] = L{
-- Dialogue options
fields.outgoing[0x05B] = L{
{ctype='unsigned int', label='Target', fn=id}, -- 04
{ctype='unsigned short', label='Option Index'}, -- 08
{ctype='unsigned short', label='_unknown1'}, -- 0A
{ctype='unsigned int', label='Option Index'}, -- 08
{ctype='unsigned short', label='Target Index', fn=index}, -- 0C
{ctype='bool', label='Automated Message'}, -- 0E 1 if the response packet is automatically generated, 0 if it was selected by you
{ctype='unsigned char', label='_unknown2'}, -- 0F
{ctype='bool', label='Automated Message'}, -- 0E 1 if continuing the current menu, 0 if ending
{ctype='unsigned char', label='_padding'}, -- 0F Upper bits of a Mode short including the previous bool
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not rename something to padding when we know it's not padding.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is padding due to the choice to use the first 8 bits of the 16 bit value as the bool, so the other half will always be unused padding for that value as implemented currently. Ideally we'd combine this value and the previous bool into a short, but given that would break things, understandable to keep them separate?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you reached this conclusion by modifying _unknown2 and observing that the Automated Message boolean didn't work properly anymore?

It's weird that Mode is 1 byte in 0x05C and 2 bytes in 0x05B.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is indeed, but that seems to be what the data structs are. Kind of silly they even gave it 16 bits in the first place if they were only going to use 1 and 0 values (and 0x05C only ever sends 1) but SE gonna SE.

Honestly I guess just to make it explicit I could const the padding to 0 just to make sure people don't muck with the upper bits of the short as well.

{ctype='unsigned short', label='Zone', fn=zone}, -- 10
{ctype='unsigned short', label='Menu ID'}, -- 12
}
Expand All @@ -685,11 +684,11 @@ fields.outgoing[0x05C] = L{
{ctype='float', label='Z'}, -- 08
{ctype='float', label='Y'}, -- 0C
{ctype='unsigned int', label='Target ID', fn=id}, -- 10 NPC that you are requesting a warp from
{ctype='unsigned int', label='_unknown1'}, -- 14 01 00 00 00 observed
{ctype='unsigned int', label='Option Index'}, -- 14
{ctype='unsigned short', label='Zone'}, -- 18
{ctype='unsigned short', label='Menu ID'}, -- 1A
{ctype='unsigned short', label='Target Index', fn=index}, -- 1C
{ctype='unsigned char', label='_unknown2', const=1}, -- 1E
{ctype='unsigned char', label='Mode', const=1}, -- 1E
{ctype='unsigned char', label='Rotation'}, -- 1F
}

Expand Down Expand Up @@ -2030,7 +2029,7 @@ fields.incoming[0x033] = L{
{ctype='char[16]', label='_dupeNPC Name1'}, -- 20
{ctype='char[16]', label='_dupeNPC Name2'}, -- 30
{ctype='char[16]', label='_dupeNPC Name3'}, -- 40
{ctype='char[32]', label='Menu Parameters'}, -- 50 The way this information is interpreted varies by menu.
{ctype='data[32]', label='Menu Parameters'}, -- 50 The way this information is interpreted varies by menu.
}

-- NPC Interaction Type 2
Expand Down Expand Up @@ -3437,7 +3436,7 @@ fields.incoming[0x0AC] = L{
}

fields.incoming[0x0AE] = L{
{ctype='data[7]', label='Mounts'}, -- 04
{ctype='data[7]', label='Mounts'}, -- 04
}

-- Moblin Maze Mongers information
Expand All @@ -3457,6 +3456,14 @@ fields.incoming[0x0B5] = L{
{ctype='unsigned int', label='_unknown2'}, -- 1C
}

-- Reservation Response
fields.incoming[0x0BF] = L{
{ctype='unsigned short', label='_unknown1'}, -- 04
{ctype='unsigned short', label='Result'}, -- 06 Success is 4, other values are failures
{ctype='unsigned int', label='_unknown2'}, -- 08
{ctype='unsigned int', label='NPC Index'}, -- 0C
}

-- Alliance status update
fields.incoming[0x0C8] = L{
{ctype='unsigned char', label='_unknown1'}, -- 04
Expand Down