Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2009, 11:32 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Ok, I think I got the conversion functions written properly, but it might not hurt to have them double-checked:

Code:
// Converts Titanium Slot IDs to SoF Slot IDs for use in Encodes
static inline int32 TitaniumToSoFSlot(int32 TitaniumSlot) {
	int32 SoFSlot = 0;

	if(TitaniumSlot >= 21 && TitaniumSlot <= 50)	// Cursor/Ammo/Power Source and Normal Inventory Slots
	{
		SoFSlot = TitaniumSlot + 1;
	}
	else if(TitaniumSlot >= 251 && TitaniumSlot <= 340)		// Bag Slots for Normal Inventory and Cursor 
	{
		SoFSlot = TitaniumSlot + 11;
	}
	else if(TitaniumSlot >= 2031 && TitaniumSlot <= 2270)	// Bank Bag Slots
	{
		SoFSlot = TitaniumSlot + 1;
	}
	else if(TitaniumSlot >= 2531 && TitaniumSlot <= 2550)	// Shared Bank Bag Slots
	{
		SoFSlot = TitaniumSlot + 1;
	}
	else if(TitaniumSlot == 9999)	//Unused slot ID to give a place to save Power Slot
	{
		SoFSlot = 21;
	}
	else
	{
		SoFSlot = TitaniumSlot;
	}	
	
	return SoFSlot;
}

// Converts Sof Slot IDs to Titanium Slot IDs for use in Decodes
static inline int32 SoFToTitaniumSlot(int32 SoFSlot) {
	int32 TitaniumSlot = 0;
	
	if(SoFSlot >= 22 && SoFSlot <= 51)	// Cursor/Ammo/Power Source and Normal Inventory Slots
	{
		TitaniumSlot = SoFSlot - 1;
	}
	else if(SoFSlot >= 262 && SoFSlot <= 351)	// Bag Slots for Normal Inventory and Cursor 
	{
		TitaniumSlot = SoFSlot - 11;
	}
	else if(SoFSlot >= 2032 && SoFSlot <= 2271)	// Bank Bag Slots
	{
		TitaniumSlot = SoFSlot - 1;
	}
	else if(SoFSlot >= 2532 && SoFSlot <= 2551)	// Shared Bank Bag Slots
	{
		TitaniumSlot = SoFSlot - 1;
	}
	else if(SoFSlot == 21)
	{
		TitaniumSlot = 9999;	//Unused slot ID to give a place to save Power Slot
	}
	else
	{
		TitaniumSlot = SoFSlot;
	}

	return TitaniumSlot;
}
When working on that, I noticed that there were a couple of issues with the current slot move related stuff in the encodes and decodes that could cause items to be lost if stored in certain slots. Right now, I think those would include:

1. The last slot in a 10 slot bag that is on your cursor.
2. The last slot in the last bag of your bank in SoF.
3. The last slot in the last bag in you shared bank.

This conversion should fix all of that once it is working. Hopefully it will also make it easy to for us to add in any more conversions for slots without having to go through each encode/decode and adjusting them 1 by 1. I will try this out later and see how well it works. Seems like it should be ok.

I am not completely sure what uses slot 31 to 50 in Titanium, but maybe that is how stacked items are stored on the cursor when being moved. If so, we might need to increase that from 50 to at least 130, so it could account for stacks up to 100.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 06-08-2009 at 07:37 AM..
Reply With Quote
  #2  
Old 06-07-2009, 11:33 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Well thanks for looking at it, that was quick ?
Reply With Quote
  #3  
Old 06-08-2009, 12:34 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Note: I have found that after zoning, the erroneously eaten/drunk food/drink return. Even if the slots are displaying as empty, the items are back upon zoning.

Weird, eh?

- Shendare
Reply With Quote
  #4  
Old 06-08-2009, 12:54 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

That is probably because the SoF client is removing the items thinking you are eating them but the server knows better. When you zone, you get a fresh copy of the data from the server so you have the proper amount again.

This makes it merely a cosmetic bug in communicating to the client under most circumstances. However, I wonder what happens if you try to pick up the items and move them to another slot. I wonder if the server amount or the client amount will be what is used.
Reply With Quote
  #5  
Old 06-08-2009, 01:10 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

I tried that.

If I have 18 left in a stack, and the server eats that down to 10, and I move 5 out into another slot, upon zoning I now have 13 in the first stack and 5 in the second.

If I let a stack completely disappear and move something else into it, upon zoning the "vanished" items appear on my cursor.

The server does appear to be keeping track of everything properly. It is indeed purely cosmetic, down to the "You are thirsty, you are out of drink" messages.

- Shendare
Reply With Quote
  #6  
Old 06-08-2009, 08:28 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I got the new conversion functions into SoF.cpp and they seem to work just fine. It should correct at least a few possible issues with slots in some of the encodes. If there are still issues, it may be due to some other structure that needs to have slot encoded for it that I am not thinking of.

This fix won't fix the consuming food/drink too fast issue, BTW. It will just correct possible issues with normal items inside of bags.

BTW, those errors in the log of the Original Post here aren't actually errors at all. They are just poorly named. Those are the slot IDs of the move before the slots get converted.

This:
Code:
[Debug] [NET__ERROR] Moved item from 31 to 324
Really means this instead:
Code:
[Debug] [INVENTORY__SLOTS] SoF Client moved item from slot 31 to slot 324
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 06-08-2009 at 04:33 PM..
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 09:02 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3