Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 02-18-2010, 12:34 AM
iRFNA
Fire Beetle
 
Join Date: Dec 2009
Posts: 23
Default

Well, assuming you start with the current code and want to insert more in this area:

Code:
struct ExtendedProfile_Struct {
	// Pet stuff
	int16				pet_id;
	int16				pet_hp;
	int16				pet_mana;
	SpellBuff_Struct	pet_buffs[BUFF_COUNT];
	int32				pet_items[MAX_MATERIALS];

	>>>here<<<

	char				pet_name[64];
	
	uint32				aa_effects;
	uint32				perAA;		//% of exp going to AAs
};
...then you just need to use a little sql to put some padding in the char profiles in that area. Here's a quick query for that:

Code:
update character_ set extprofile = concat(left(extprofile, length(extprofile) - (64 + 4 + 4)), repeat(char(0), ???), right(extprofile, 64 + 4 + 4));
The (64 + 4 + 4) corresponds to the size of the data under the big bold here marker. Just pull apart the current exp profile, fill it with a buffer of 0x00 characters (I assume 0x00 is preferable?), and put it all back together. So, however much larger you make the pet equipment array, you'll just toss that in ???. Each added int32 is 4 bytes.

From what I can see in the code, it'd be safer to add everything under the current data so that if someone's extprofile isn't updated, it won't try to use faulty data for things like AAs or their pet name. However, it'd be pretty odd and annoying to split up the pet equipment array like that.

Another option would be to update the SetExtendedProfile function in extprofile.cpp to do basically this same thing except with memcpy/memmove and SecureZeroMemory. Maybe on a special case if the length is the same as the old one, reformat its data like that or however you need it, and then do the dump into the player's ExtendedProfile_Struct. Again, I'm assuming it's preferable to fill everything new with 0x00, which I think should be the case?
Reply With Quote
  #2  
Old 02-18-2010, 09:30 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

Thanks for that. I did most of the work last night, with just a little debugging, then I'll be able to try this out. I've had to rework some things I had finished earlier, since some of the basic pet focus code had changed.
Reply With Quote
Reply

Thread Tools
Display Modes

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:58 PM.


 

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 - 2026, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3