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

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-03-2003, 12:23 AM
Drawde
Dragon
 
Join Date: Jan 2002
Posts: 521
Default Are merchant lists with more than 28 items possible?

Currently in EQEmu if a merchant's item list has more than 28 items, it will appear blank.
Merchants on the EQ live servers often have many more items than this (usually when players sell things to them), so it must be possible somehow.
Being able to have more than 28 items per list would be VERY handy for tradeskill item merchants, which
I'm working on ATM. There are so many different moulds, patterns etc. that there aren't enough merchants
for the number of lists needed!
Reply With Quote
  #2  
Old 02-03-2003, 04:38 AM
Divide
Hill Giant
 
Join Date: Dec 2002
Location: Wouldnt you like to know
Posts: 101
Default

I maybe wrong but i think the limit is 28 or 30 items
__________________
Divide the Kindhearted
<the Item Dev Queen>
Read this before asking for help!
Reply With Quote
  #3  
Old 02-03-2003, 04:52 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Heres where we send the number of items

int cpisize = sizeof(MerchantItem_Struct) + (29 * sizeof(MerchantItemD_S
truct));^M
MerchantItem_Struct* cpi = (MerchantItem_Struct*) new uchar[cpisize];^M
memset(cpi, 0, cpisize);^M

const Item_Struct *item;
for (unsigned int i=0;i<database.GetMerchantListNumb(merchant_id) && i <
29; i++)

Im not much of a packet mangler, so
Im not sure if we can just up this number, but we can always check..

I'll see if I can up it to 36 tonight and see if it works.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #4  
Old 02-03-2003, 08:52 AM
Lyenu X`Arie
Fire Beetle
 
Join Date: Mar 2002
Posts: 0
Default

Do this:

int cpisize = sizeof(MerchantItem_Struct) + (36 * sizeof(MerchantItemD_S
truct));
MerchantItem_Struct* cpi = (MerchantItem_Struct*) new uchar[cpisize];
memset(cpi, 0, cpisize);

const Item_Struct *item;
for (unsigned int i=0;i<database.GetMerchantListNumb(merchant_id) && i <
36; i++)

Although I'm pretty sure you could make it dynamic by doing something like this...

int32 numitems = database.GetMerchantListNumb(merchant_id);
int cpisize = sizeof(MerchantItem_Struct) + (numitems * sizeof(MerchantItemD_Struct));
MerchantItem_Struct* cpi = (MerchantItem_Struct*) new uchar[cpisize];
memset(cpi, 0, cpisize);

const Item_Struct *item;
for (unsigned int i=0; i <
numitems; i++)
Reply With Quote
  #5  
Old 02-03-2003, 08:57 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Probably a better idea.. Be alot more flexible to do it that way..
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #6  
Old 02-03-2003, 10:23 AM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

EQlive merchant max atm is 80 items. They did this so it would allow bazaar traders to sell more items, since I believe that code is based off of merchant code.
Reply With Quote
  #7  
Old 02-03-2003, 04:29 PM
Divide
Hill Giant
 
Join Date: Dec 2002
Location: Wouldnt you like to know
Posts: 101
Default

So it was 29 Now its more, well i was halfass right, lol
But i think Kill is right about the bazaar code
__________________
Divide the Kindhearted
<the Item Dev Queen>
Read this before asking for help!
Reply With Quote
  #8  
Old 02-05-2003, 01:31 AM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

EQLive does send an 80 item list, however the server side merchant list is > 80.

Code:
--- ../../../cvs/NightDumps/Source/zone/client_process.cpp	2003-02-03 08:38:21.000000000 -0700
+++ client_process.cpp	2003-02-05 05:24:38.000000000 -0700
@@ -5287,12 +5287,12 @@
 
 void Client::BulkSendMerchantInventory(int merchant_id, int16 npcid) {
 	const Item_Struct* handyitem = NULL;
-	int cpisize = sizeof(MerchantItem_Struct) + (29 * sizeof(MerchantItemD_Struct));
+	int cpisize = sizeof(MerchantItem_Struct) + (80 * sizeof(MerchantItemD_Struct));
 	MerchantItem_Struct* cpi = (MerchantItem_Struct*) new uchar[cpisize];
 	memset(cpi, 0, cpisize);
 
 	const Item_Struct *item;
-	for (unsigned int i=0;i<database.GetMerchantListNumb(merchant_id) && i < 29; i++)
+	for (unsigned int i=0;i<database.GetMerchantListNumb(merchant_id) && i < 80; i++)
 	{
 		item=database.GetItem(database.GetMerchantData(merchant_id,i+1));
 		if (item)
@@ -5301,9 +5301,9 @@
 			memcpy(&cpi->packets[cpi->count].item, item, sizeof(Item_Struct));
 			cpi->packets[cpi->count].item.equipSlot = i;
 			cpi->count++;
-			if (cpi->count >= 29)
+			if (cpi->count >= 81)
 			{
-				cout << "ERROR: cpi->count>=29 in BulkSendMerchantInventory()" << endl;
+				cout << "ERROR: cpi->count>=81 in BulkSendMerchantInventory()" << endl;
 				return;
 			}
 		}
Reply With Quote
  #9  
Old 02-05-2003, 03:33 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Have you been able to test this out? If it works ok, I'll look into rolling it into the code.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #10  
Old 02-05-2003, 06:52 AM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

Aye, not sure about the >= 81 check. cpi->check shouldn't/can't ever go above 80.
Reply With Quote
  #11  
Old 02-05-2003, 07:49 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

I think 80 items is more than enough...

I might try to do it dynamiclly like Lyn suggested that way we only pass what we need to pass, and just put a cap on it at 80 like you did.

I'll try to tinker with it tonight.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #12  
Old 02-05-2003, 08:23 AM
Drawde
Dragon
 
Join Date: Jan 2002
Posts: 521
Default

That would be really useful, especially for merchants selling spell scrolls or tradeskill supplies.
80 items is more than enough (probably about 40-50 items is the max that you'd ever need), larger numbers might cause too much lag anyway (clicking on a merchant with a lot of items often causes brief server lag whilst the item data is loaded from the DB)
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 05:23 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3