Struct element clarification

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Struct element clarification

Post by Zcoretri » Tue Jul 21, 2009 6:00 pm

LE, what do those elements in red mean, what happens to the value?

<Data ElementName="offers_quest" Type="EQ2_8Bit_String" Size="1" IfVariableNotSet="footer_set_name_0" />
<Data ElementName="part_of_quest" Type="EQ2_8Bit_String" Size="1" IfVariableNotSet="footer_set_name_0" />
<Data ElementName="offers_quest_color" Type="int8" IfVariableSet="footer_offers_quest_0" />
<Data ElementName="part_of_quest_color" Type="int8" IfVariableSet="footer_part_of_quest_0" />
<Data ElementName="unknown_set_data1" Type="int8" Size="1" IfVariableSet="footer_set_name_0" />
<Data ElementName="charges" Type="int8" IfVariableNotSet="footer_set_name_0" />
<Data ElementName="total_charges" Type="int16" IfVariableSet="footer_charges_0" />
<Data ElementName="charges_left" Type="int16" IfVariableSet="footer_charges_0" />
<Data ElementName="unknown_set_info" Type="int32" Size="1" IfVariableSet="footer_set_name_0" />
<Data ElementName="unknown_set_info2" Type="int8" Size="1" IfVariableSet="footer_set_name_0" />
<Data ElementName="unknown_set_info3" Type="int32" Size="1" IfVariableSet="footer_unknown_set_info2_0" />

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Struct element clarification

Post by LethalEncounter » Tue Jul 21, 2009 6:11 pm

IfVariableNotSet="FIELD" means that if the FIELD is a 0, then this data element is used, otherwise it is skipped.

IfVariableSet="FIELD" means that if the FIELD is NOT 0, then this data element is used, otherwise it is skipped.

In your example if the footer_set_name_0 field for the packet is 0 then the offers_quest field is used, otherwise it is skipped.
Likewise, unknown_set_data1 is only used if footer_set_name_0 is set. Its just my way of trying to handle all the crazy curveballs that SOE throws into their data.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Struct element clarification

Post by Zcoretri » Tue Jul 21, 2009 6:40 pm

OK, just trying to wrap my brain around this stuff, lol....

So, if there is there is no value for set_name (meaning its = 00), then...
<Data ElementName="unknown_set_data1" Type="int8" Size="1" IfVariableSet="footer_set_name_0" /> is skipped and
<Data ElementName="offers_quest" Type="EQ2_8Bit_String" Size="1" IfVariableNotSet="footer_set_name_0" /> is used.

So being skipped I assume that there is no value there at all? (i.e. not a 00)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Struct element clarification

Post by LethalEncounter » Wed Jul 22, 2009 2:43 pm

That is correct. Being skipped means that it will not be used when loading a data packet or creating a new data packet. To the client, that field never existed.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests