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 01-13-2009, 09:21 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Well, I am trying to work out how to make the serialization match up with how it works now for Live (and apparently since Anniversary or so), but I can't seem to get it to send the integers followed by null (00 in hex) bits.

I copied the function (GetNextItemInstSerialNumber()) to make Item Instanced Serial Numbers similar to how live does it to use in the Item Instancing part of the Serialization. That part seems to be working properly and I will definitely keep that in the final Serialization code. It may not really be required, but it doesn't hurt to copy the way Live does it as close as possible.

I then tried making the changes noted in green below, to force it to send the integers as int32, hoping that it would send them each as 4 bits. It still seems to just be sending the integers, without the 00s after them as it needs to be doing.

Code:
sint32 NextItemInstSerialNumber = 1;
int32 MaxInstances = 2000000000;

static inline sint32 GetNextItemInstSerialNumber() {

	if(NextItemInstSerialNumber >= MaxInstances)
		NextItemInstSerialNumber = 1;
	else
		NextItemInstSerialNumber++;

	return NextItemInstSerialNumber;
}


char *SerializeItem(const ItemInst *inst, sint16 slot_id, uint32 *length, uint8 depth) {
	char *serialization = NULL;
	char *instance = NULL;
	const char *protection=(const char *)"\\\\\\\\\\";
	char *sub_items[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
	bool stackable=inst->IsStackable();
	uint32 merchant_slot=inst->GetMerchantSlot();
	sint16 charges=inst->GetCharges();
	const Item_Struct *item=inst->GetItem();
	int i;
	uint32 sub_length;
	uint32 stack = stackable ? charges : 1;
	uint32 zero = 0;
	uint32 price = inst->GetPrice();
	uint32 slot = (merchant_slot==0) ? slot_id : merchant_slot;
	uint32 merchcount = (merchant_slot==0) ? 1 : inst->GetMerchantCount();
	uint32 serialnumber = GetNextItemInstSerialNumber();
	uint32 instnodrop = inst->IsInstNoDrop() ? 1 : 0;
	uint32 typepotion = (stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? 1 : 0) : charges);

   MakeAnyLenString(&instance,
      "%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i",
      stack,
      zero,
      price,
	  slot,
      merchcount,
      zero,
      serialnumber,
      instnodrop,
      typepotion,
      zero,
      zero,
      zero,
      zero,
      zero,
      zero

   );
I also found the item_struct.h file which I hadn't seen before and it helped me understand how the serialization is working a little better. Basically, the item_struct is just handled in it's own separate file for some reason instead of being included in the eq_packet_structs.h file. So, if I understand correctly, it seems that the patch_itemfields.h files are just separate files to do basically the same thing as the encodes in the patch.cpp files.

I even noticed that the item_struct already has sizes defined for each field like int8, int32 etc just like normal structs. So, I think that I could just use that struct, and edit the field sizes where needed and add them to the anniversary_structs.h file and then do an encode of them like normal. But, I will still need to figure out how to make it send the structure as the size that it is supposed to be. The structure will vary in length slightly, because a couple fields are strings and don't have a set size limit on them. But, other than that, the rest should always be the same size.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 01-21-2009, 03:56 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

O..M..G! I finally got in game! @#$@% WOOT!

Turns out the whole time, the thing that was stopping me was sending the incorrect structure for AA tables. I simply commented out the opcodes for AA stuff in the .conf file and got in game first try! Of course, nothing really works yet, but now that I am at this point, I think things will start progressing very quickly!!! As soon as I can iron a few things out, I will get this stuff on the SVN ASAP. I will try to add new files for it so I don't just overwrite the current anniversary files. I just need to figure out how to create new patch files and I will get them up. I will knock out a few more opcodes and clean up packet structures more too though, so it is less messy than what I currently have for it.

I am VERY excited!!! I have been stuck at the same point for over a month now! I will have more updates here shortly! Things are looking bright

Code:
[Wed Jan 21 02:14:36 2009]00420:DoMainLoop: just before first while(!EverQuest.ReceievedWorldObjects).
[Wed Jan 21 02:14:36 2009]00421:Zone Connect -- Received MSG_SND_WOBJECTS_RESPONSE
[Wed Jan 21 02:14:36 2009]00422:DoMainLoop: complete after first while(!EverQuest.ReceievedWorldObjects).
[Wed Jan 21 02:14:36 2009]00423:DoMainLoop: just before second while(!ReadyEnterWorld).
[Wed Jan 21 02:14:36 2009]00424:Zone Connect -- Sending out a MSG_READY_ENTER_WORLD.
[Wed Jan 21 02:14:36 2009]00425:Zone Connect -- Received MSG_READY_ENTER_WORLD
[Wed Jan 21 02:14:36 2009]00426:DoMainLoop: completed second while(!ReadyEnterWorld).
[Wed Jan 21 02:14:36 2009]00427:Setting up models.
[Wed Jan 21 02:14:36 2009]00428:Setting up character.
[Wed Jan 21 02:14:36 2009]00429:Activating music.
[Wed Jan 21 02:14:36 2009]00430:Initialization complete.
Entering main loop.
[Wed Jan 21 02:14:36 2009]00431:Item done, MSG_WEATHER_EVENT received.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 01-21-2009 at 12:22 PM..
Reply With Quote
  #3  
Old 01-21-2009, 05:38 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Excellent work Trevius!

(I know you don't want your thread cluttered up, so feel free to delete this post ).
Reply With Quote
  #4  
Old 01-21-2009, 06:02 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

LOL, Thanks Derision! No worries about the clutter. After all of the hours it took to get past that part, I am glad to see a reply

I am still working on figuring out some of the unknown opcodes I am getting from the client atm. I may be able to have something up tomorrow night.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 01-21-2009, 07:23 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Quote:
Originally Posted by trevius View Post
LOL, Thanks Derision! No worries about the clutter. After all of the hours it took to get past that part, I am glad to see a reply

I am still working on figuring out some of the unknown opcodes I am getting from the client atm. I may be able to have something up tomorrow night.
I forgot we had message boards. I admit it.

you are a god, keep it up. If I was any good with graphic design i'd photoshop your avatar onto Jesus.

k, maybe not THAT far.

but good job!
Reply With Quote
  #6  
Old 01-21-2009, 11:16 AM
greldor
Fire Beetle
 
Join Date: Oct 2004
Posts: 7
Default

WAY TO GO!

Well done Trev, that is so exciting!
Reply With Quote
  #7  
Old 01-21-2009, 12:58 PM
Sakrateri's Avatar
Sakrateri
Dragon
 
Join Date: Mar 2004
Location: England
Posts: 776
Default

All I can think of is this.....


"I think and think for months and years. Ninety-nine times, the conclusion is false. The hundredth time I am right. "
~ Albert Einstein



Way to go and a big round of applause
__________________
KhepriGames

Game Gallery

My Forums

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 02:16 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