PDA

View Full Version : Character "profile"


Cailin
02-05-2005, 12:43 PM
Could someone please explain to me how data in the profile column (in the character_ table) is stored? I'm interested in building a tool that will allow modification of characters while outside of the game (in PHP), and I need to know what's going on in here. I took a look at the code of the emulator itself, but C++ was never my strong point - even though I found functions pertaining to storing/retrieving the data, I couldn't figure out how to decode it.

Can someone please help me out?
Thanks

RangerDown
02-05-2005, 12:56 PM
The struct definition for the player profile blob is in one of the header files. I think it might be called player_profile.h or something to that effect, but I don't know for sure until I get my test server booted up :P

I really don't know what to say other than you WILL need to know C++ data types and structs well before you can make any sense of the binary data in there. If you're still inexperienced to the point that you wouldn't understand what you were looking at when you were looking at that struct definition, you're going to have to either change that or accept that the profile blob is a bit out of your league.

*Edit* The definition is in common/eq_packet_structs.h
Look for the definition for struct PlayerProfile_Struct.

Another thing to be aware of before you begin investing any significant amount of time into a profile editor: this struct was not setup by the devs, but rather it's what the client receives when it expects the server to send it info about the player. In other words, it's defined by the network code. The network structures were defined by SOE. In other words, this entire struct could be rearranged at any time at SOE's whim, simply by putting out a patch that totally the player profile packet structure. In fact, as we speak, EQ2's network engine has been ported to EQLive, so a WHOLE bunch of stuff is changing. You might wanna hold out on that till things settle down.

Cailin
02-05-2005, 01:26 PM
OK, thanks for that. I'll keep it all in mind.

fathernitwit
02-06-2005, 07:53 AM
yes, this structure changes nearly every patch. Normally it is just expanded with unknown stuff, but sometimes it changes more dramatically.

If you wanna edit it in php, you going to have to get framiliar with 'unpack' in php.. and write a VERY long unpack description based on the struct ranger pointed out.

on the other hand, people would love to have this tool. I hear requests for things like it all the time. (expecially by rangerdown :))

Rogean
02-06-2005, 08:39 AM
$Query = mysql_query("SELECT id,name,guild,guildrank,zonename,
(ascii(mid(profile,117,1)))+(ascii(mid(profile,118 ,1))*256)+(ascii(mid(profile,119,1))*4096)+(ascii( mid(profile,120,1))*65536) as level,
(ascii(mid(profile,105,1)))+(ascii(mid(profile,106 ,1))*256)+(ascii(mid(profile,107,1))*4096)+(ascii( mid(profile,108,1))*65536) as race,
(ascii(mid(profile,109,1)))+(ascii(mid(profile,110 ,1))*256)+(ascii(mid(profile,111,1))*4096)+(ascii( mid(profile,112,1))*65536) as pclass,
(ascii(mid(profile,101,1)))+(ascii(mid(profile,102 ,1))*256)+(ascii(mid(profile,103,1))*4096)+(ascii( mid(profile,104,1))*65536) as gender,
(ascii(mid(profile,164,1))) as gm,
(ascii(mid(profile,165,1))) as anon,
mid(profile,69,30) as lastname,
profile
FROM character_ WHERE id = $charid");

$Char = mysql_fetch_array($Query);


Theres something that should help you out a bit. Took it from the Raid Addicts panel I made.

RangerDown
02-06-2005, 11:22 AM
LOL FNW. I don't request a profile blob editor so much as I request getting entirely rid of the blob from the database and save character data in relational db fields/tables like the Good Lord intended a relational db to be used :D

(And for anyone who takes that seriously, there are issues around doing it that way -- not the least of which are possible impact on server performance, reliably saving multiple fields/tables, and just the sheer amount of work that would go into overhauling that.)

Rogean, that's a clever way of using the blob. For the same reasons I mentioned earlier though, don't necessarily expect the fields he's extracting to be in the same positions they were when that was written. He said that was from his RaidAddicts... so it was... some time ago :P