Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2011, 10:45 PM
jcbbjjttt
Fire Beetle
 
Join Date: Feb 2011
Posts: 7
Default Working With PlayerProfile_Struct

All,

I am writing an application to look at the data in PlayerProfile_Struct. I am using the following code from common/eq_packet_structs.h

Code:
struct PlayerProfile_Struct
{
/*0000*/	uint32				checksum;			// Checksum from CRC32::SetEQChecksum
/*0004*/	char				name[64];			// Name of player sizes not right
/*0068*/	char				last_name[32];		// Last name of player sizes not right
/*0100*/	uint32				gender;				// Player Gender - 0 Male, 1 Female
/*0104*/	uint32				race;				// Player race
/*0108*/	uint32				class_;				// Player class
/*0112*/	uint32				unknown0112;		//
/*0116*/	uint32				level;				// Level of player (might be one byte)
/*0120*/	BindStruct			binds[5];			// Bind points (primary is first, home city is fifth)
/*0220*/	uint32				deity;				// deity
/*0224*/	uint32				guild_id;	
/*0228*/	uint32				birthday;			// characters bday
/*0232*/	uint32				lastlogin;			// last login or zone time
/*0236*/	uint32				timePlayedMin;		// in minutes
/*0240*/	uint8				pvp;
/*0241*/	uint8				level2;				//no idea why this is here, but thats how it is on live
/*0242*/	uint8				anon;				// 2=roleplay, 1=anon, 0=not anon
/*0243*/	uint8				gm;
/*0244*/	uint8				guildrank;
/*0245*/	uint8				guildbanker;
/*0246*/	uint8				unknown0246[6];		//
/*0252*/	uint32				intoxication;
/*0256*/	uint32				spellSlotRefresh[MAX_PP_MEMSPELL];	//in ms
/*0292*/	uint32				abilitySlotRefresh;
/*0296*/	uint8				haircolor;			// Player hair color
/*0297*/	uint8				beardcolor;			// Player beard color
/*0298*/	uint8				eyecolor1;			// Player left eye color
/*0299*/	uint8				eyecolor2;			// Player right eye color
/*0300*/	uint8				hairstyle;			// Player hair style
/*0301*/	uint8				beard;				// Beard type
/*0302*/	uint8				ability_time_seconds;	//The following four spots are unknown right now.....
/*0303*/	uint8				ability_number;		//ability used
/*0304*/	uint8				ability_time_minutes;
/*0305*/	uint8				ability_time_hours;	//place holder
/*0306*/	uint8				unknown0306[6];		// @bp Spacer/Flag?
/*0312*/	uint32				item_material[MAX_MATERIALS];	// Item texture/material of worn/held items
/*0348*/	uint8				unknown0348[44];
/*0392*/	Color_Struct		item_tint[MAX_MATERIALS];
/*0464*/	AA_Array			aa_array[MAX_PP_AA_ARRAY];
/*2384*/	float				unknown2384;		//seen ~128, ~47
/*2388*/	char				servername[32];		// length probably not right
/*2420*/	char				title[32];			// length might be wrong
/*2452*/	char				suffix[32];			// length might be wrong
/*2484*/	uint32				guildid2;			//
/*2488*/	uint32				exp;				// Current Experience
/*2492*/	uint32				unknown2492;
/*2496*/	uint32				points;				// Unspent Practice points
/*2500*/	uint32				mana;				// current mana
/*2504*/	uint32				cur_hp;				// current hp
/*2508*/	uint32				unknown2508;		// 0x05
/*2512*/	uint32				STR;				// Strength
/*2516*/	uint32				STA;				// Stamina
/*2520*/	uint32				CHA;				// Charisma
/*2524*/	uint32				DEX;				// Dexterity
/*2528*/	uint32				INT;				// Intelligence
/*2532*/	uint32				AGI;				// Agility
/*2536*/	uint32				WIS;				// Wisdom
/*2540*/	uint8				face;				// Player face
/*2541*/	uint8				unknown2541[47];	// ?
/*2588*/	uint8				languages[MAX_PP_LANGUAGE];
/*2616*/	uint8				unknown2616[4];
/*2620*/	int32				spell_book[MAX_PP_SPELLBOOK];
/*4540*/	uint8				unknown4540[128];	// Was [428] all 0xff
/*4668*/	int32				mem_spells[MAX_PP_MEMSPELL];
/*4704*/	uint8				unknown4704[32];	//
/*4736*/	float				y;					// Player y position
/*4740*/	float				x;					// Player x position
/*4744*/	float				z;					// Player z position
/*4748*/	float				heading;			// Direction player is facing
/*4752*/	uint8				unknown4752[4];		//
/*4756*/	sint32				platinum;			// Platinum Pieces on player
/*4760*/	sint32				gold;				// Gold Pieces on player
/*4764*/	sint32				silver;				// Silver Pieces on player
/*4768*/	sint32				copper;				// Copper Pieces on player
/*4772*/	sint32				platinum_bank;		// Platinum Pieces in Bank
/*4776*/	sint32				gold_bank;			// Gold Pieces in Bank
/*4780*/	sint32				silver_bank;		// Silver Pieces in Bank
/*4784*/	sint32				copper_bank;		// Copper Pieces in Bank
/*4788*/	sint32				platinum_cursor;	// Platinum on cursor
/*4792*/	sint32				gold_cursor;		// Gold on cursor
/*4796*/	sint32				silver_cursor;		// Silver on cursor
/*4800*/	sint32				copper_cursor;		// Copper on cursor
/*4804*/	sint32				platinum_shared;	// Platinum shared between characters
/*4808*/	uint8				unknown4808[24];	// @bp unknown skills?
/*4832*/	uint32				skills[MAX_PP_SKILL];
/*5132*/	uint8				unknown5132[284];	// @bp unknown skills?
/*5416*/	int32				pvp2;				//
/*5420*/	int32				unknown5420;		//
/*5424*/	int32				pvptype;			//
/*5428*/	int32				unknown5428;		//
/*5432*/	uint32				ability_down;		// Guessing
/*5436*/	uint8				unknown5436[8];		//
/*5444*/	uint32				autosplit;			//not used right now
/*5448*/	uint8				unknown5448[8];
/*5456*/	int32				zone_change_count;	// Number of times user has zoned in their career (guessing)
/*5460*/	uint8				unknown5460[16];	//
/*5476*/	uint32				drakkin_heritage;	//
/*5480*/	uint32				drakkin_tattoo;		//
/*5484*/	uint32				drakkin_details;	//
/*5488*/	int32				expansions;			// expansion setting, bit field of expansions avaliable
/*5492*/	sint32				toxicity;			//from drinking potions, seems to increase by 3 each time you drink
/*5496*/	char				unknown5496[16];	//
/*5512*/	sint32				hunger_level;
/*5516*/	sint32				thirst_level;
/*5520*/	int32				ability_up;
/*5524*/	char				unknown5524[16];
/*5540*/	uint16				zone_id;			// Current zone of the player
/*5542*/	uint16				zoneInstance;		// Instance ID
/*5544*/	SpellBuff_Struct	buffs[BUFF_COUNT];	// Buffs currently on the player
/*6044*/	char 				groupMembers[6][64];//
/*6428*/	char				unknown6428[656];
/*7084*/	uint32				entityid;
/*7088*/	uint32				leadAAActive;
/*7092*/	uint32				unknown7092;
/*7096*/	sint32				ldon_points_guk;	//client uses these as signed
/*7100*/	sint32				ldon_points_mir;
/*7104*/	sint32				ldon_points_mmc;
/*7108*/	sint32				ldon_points_ruj;
/*7112*/	sint32				ldon_points_tak;
/*7116*/	sint32				ldon_points_available;
/*7120*/	sint32				ldon_wins_guk;
/*7124*/	sint32				ldon_wins_mir;
/*7128*/	sint32				ldon_wins_mmc;
/*7132*/	sint32				ldon_wins_ruj;
/*7136*/	sint32				ldon_wins_tak;
/*7140*/	sint32				ldon_losses_guk;
/*7144*/	sint32				ldon_losses_mir;
/*7148*/	sint32				ldon_losses_mmc;
/*7152*/	sint32				ldon_losses_ruj;
/*7156*/	sint32				ldon_losses_tak;
/*7160*/	uint8				unknown7160[72];
/*7232*/	uint32				tribute_time_remaining;	//in miliseconds
/*7236*/	uint32				showhelm;
/*7240*/	uint32				career_tribute_points;
/*7244*/	uint32				unknown7244;
/*7248*/	uint32				tribute_points;
/*7252*/	uint32				unknown7252;
/*7256*/	uint32				tribute_active;		//1=active
/*7260*/	Tribute_Struct		tributes[MAX_PLAYER_TRIBUTES];
/*7300*/	Disciplines_Struct	disciplines;
/*7700*/	uint32				recastTimers[MAX_RECAST_TYPES];	// Timers (GMT of last use)
/*7780*/	char				unknown7780[160];
/*7940*/	uint32				endurance;
/*7944*/	uint32				group_leadership_exp;	//0-1000
/*7948*/	uint32				raid_leadership_exp;	//0-2000
/*7952*/	uint32				group_leadership_points;
/*7956*/	uint32				raid_leadership_points;
/*7960*/	LeadershipAA_Struct	leader_abilities;
/*8088*/	uint8				unknown8088[132];
/*8220*/	uint32				air_remaining;
/*8224*/	uint32				PVPKills;
/*8228*/	uint32				PVPDeaths;
/*8232*/	uint32				PVPCurrentPoints;
/*8236*/	uint32				PVPCareerPoints;
/*8240*/	uint32				PVPBestKillStreak;
/*8244*/	uint32				PVPWorstDeathStreak;
/*8248*/	uint32				PVPCurrentKillStreak;
/*8252*/	PVPStatsEntry_Struct	PVPLastKill;
/*8340*/	PVPStatsEntry_Struct	PVPLastDeath;
/*8428*/	uint32				PVPNumberOfKillsInLast24Hours;
/*8432*/	PVPStatsEntry_Struct	PVPRecentKills[50];
/*12832*/	uint32				aapoints_spent;
/*12836*/	uint32				expAA;
/*12840*/	uint32				aapoints;			//avaliable, unspent
/*12844*/	uint8				unknown12844[36];
/*12880*/	Bandolier_Struct	bandoliers[MAX_PLAYER_BANDOLIER];
/*14160*/	uint8				unknown14160[4506];
/*18666*/	SuspendedMinion_Struct	SuspendedMinion;
/*19276*/	uint32				timeentitledonaccount;
/*19280*/	PotionBelt_Struct	potionbelt;			//there should be 3 more of these
/*19568*/	uint8				unknown19568[8];
/*19576*/	uint32				currentRadCrystals; // Current count of radiant crystals
/*19580*/	uint32				careerRadCrystals;	// Total count of radiant crystals ever
/*19584*/	uint32				currentEbonCrystals;// Current count of ebon crystals
/*19588*/	uint32				careerEbonCrystals;	// Total count of ebon crystals ever
/*19592*/	uint8				groupAutoconsent;	// 0=off, 1=on
/*19593*/	uint8				raidAutoconsent;	// 0=off, 1=on
/*19594*/	uint8				guildAutoconsent;	// 0=off, 1=on
/*19595*/	uint8				unknown19595[5];	// ***Placeholder (6/29/2005)
/*19600*/	uint32				RestTimer;
/*19604*/
};
My code reads in all of the bytes from the binary for the struct. I then use methods that take in a starting index and print out data in the specified format from that index. This works great for the first chunk of the profile, up to level 116. When I try to read anything after 220 I get strange information.

For example, if I try to read STR from 2512 I get -48.

Obviously this is not the correct value for a character's strength. Any idea why I can't read the data after 220?
Reply With Quote
  #2  
Old 09-10-2011, 10:51 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Did you account for the structs/arrays inside the player profile?
Reply With Quote
  #3  
Old 09-11-2011, 02:19 AM
jcbbjjttt
Fire Beetle
 
Join Date: Feb 2011
Posts: 7
Default

I took the binary file and created an array out of all the bytes. I then just jump to byte 220. This should ignore that bind[] right?
Reply With Quote
  #4  
Old 09-11-2011, 03:52 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Well, the problem is those numbers are wrong.

It's correct up to item_tint, but either color struct changed size at some point or whoever was numbering those fields miscounted because of the union, but it's off by 36 bytes from there on.
Reply With Quote
  #5  
Old 09-11-2011, 04:34 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Yup, you are right. When I went through readjusting for changes, I missed the union. I'll submit the right numbers in a few.
Reply With Quote
  #6  
Old 09-11-2011, 11:31 AM
jcbbjjttt
Fire Beetle
 
Join Date: Feb 2011
Posts: 7
Default

That fixed it! Thank you very much.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:08 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3