PDA

View Full Version : Understanding PlayerProfile_Struct


John Adams
07-28-2007, 03:12 PM
Another question from me.

I do understand the general idea behind the blob data that makes up the profile data in the character_ record, however I am trying to dig something out of this stream of data that is currently "unknown". As some know, I have been digging through Cofruben's old Adventure code (LDoNs) and resurrecting it for my own inscrutible purpose.

So far, I've found and fixed a lot of the quests related to LDoNs, started rebuilding the merchant lists, fixed a few Opcodes for beginning your adventures... but here's where I've hit a wall. I do not understand enough about the code or C++ (or this Blob stuff) to really grasp what to do next.

When you ask for an adventure, the code assumes the playerprofile_struct is aware of an "adventure_id", which is currently NOT a part of the m_pp. So it always returns a 0, or no adventure, and therefore you cannot be assigned a new one. This is what I made of it by putting in tons of debug code to show what things are set to as the code progresses.

I believe the value I am looking for might be hidden somewhere in this area:
eq_packet_structs.h/*6008*/ char groupMembers[6][64]; //
/*6392*/ char unknown6392[668];
/*7060*/ sint32 ldon_points_guk; //client uses these as signed
/*7064*/ sint32 ldon_points_mir;
/*7068*/ sint32 ldon_points_mmc;
/*7072*/ sint32 ldon_points_ruj;
/*7076*/ sint32 ldon_points_tak;
/*7080*/ sint32 ldon_points_available;
/*7084*/ uint8 unknown5940[112];
I assume this, because of the ldon_* info and the 2 unknowns just before and after, plus the "groupMembers[6][64]" just before it all (gotta be in a group to LDoN, right? Good assumption? haha)


I also noticed the original code seems to randomly generate a 0-3 for what "type" of LDoN it'll be, instead of using the selector from the UI (Collection, MassKill, Boss, Rescue). So it appears the previous coder had random LDoN assignments only, which is fine - except for this missing GetAdventureID().

If any dev is watching, and can guide me passed this one little hangup, I can proceed with my task of revitalizing LDoN adventures. I think once the ID is assigned and the groups formed, everything else is nearly in place. Currently, I cannot figure out how to "fake" the m_pp.adventure_id so I can hard-code it and continue testing. Working on that right now.


Also, if there is an existing tool out there that will disect and display the character_.profile data, please guide me to that. I could figure this out if I could read that damned blob.

Anyway, thanks in advance for any advice.
J


Edit: One more bit -- this is the item I'm trying to fill: int32 GetAdventureID() const { return 0 /*m_pp.adventure_id;*/ } note the commented out m_pp.adventure_id...

John Adams
07-28-2007, 07:12 PM
If it helps anyone help me faster (grin), I located when I believe the now-missing "adventure_id" was first introduced. Browsing through Sourceforge, version 1.16 of eq_packet_structs.h, you can see it stuck in around /* 6028 */.

http://eqemulator.cvs.sourceforge.net/eqemulator/EQEmuCVS/Source/common/eq_packet_structs.h?revision=1.16&view=markup

I think this means this used to work, but has since been lost. Any help would be appreciated finding this location again, or a hint how to figure it out myself.

ksmith08
07-29-2007, 12:47 PM
Also, if there is an existing tool out there that will disect and display the character_.profile data, please guide me to that. I could figure this out if I could read that damned blob.

If there's not a tool out there for this, would this tool be worth while to have? This is pretty close to the type of coding I do at work. I could probably put something together, if it doesn't exist already.

John Adams
07-30-2007, 12:31 PM
There are some utils in the source package, one in particular is called ppreader.pl - but it makes my brain hurt. I don't understand what it's for.

In fact, in this dir (utils), there's a lot of stuff I cannot identify. asmtools, with strings and opcodes perl files. Thing is, I cannot imagine this stuff "just magically works" without tweaking, and that's where I fall short.

John Adams
07-31-2007, 10:41 AM
I guess I should have mentioned, this work is being done using the Titanium client. The correct opCode for Titanium to request an adventure is:

OP_AdventureRequest=0x43fd

More to come if I can get a valid adventure_id.