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

02-03-2003, 12:23 AM
|
Dragon
|
|
Join Date: Jan 2002
Posts: 521
|
|
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!
|

02-03-2003, 04:38 AM
|
Hill Giant
|
|
Join Date: Dec 2002
Location: Wouldnt you like to know
Posts: 101
|
|
I maybe wrong but i think the limit is 28 or 30 items
|

02-03-2003, 04:52 AM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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.
|

02-03-2003, 08:52 AM
|
Fire Beetle
|
|
Join Date: Mar 2002
Posts: 0
|
|
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++)
|

02-03-2003, 08:57 AM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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.
|

02-03-2003, 10:23 AM
|
Dragon
|
|
Join Date: Jun 2002
Posts: 776
|
|
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.
|

02-03-2003, 04:29 PM
|
Hill Giant
|
|
Join Date: Dec 2002
Location: Wouldnt you like to know
Posts: 101
|
|
So it was 29 Now its more, well i was halfass right, lol
But i think Kill is right about the bazaar code
|
 |
|
 |

02-05-2003, 01:31 AM
|
Discordant
|
|
Join Date: Feb 2003
Posts: 305
|
|
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;
}
}
|
 |
|
 |

02-05-2003, 03:33 AM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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.
|

02-05-2003, 06:52 AM
|
Discordant
|
|
Join Date: Feb 2003
Posts: 305
|
|
Aye, not sure about the >= 81 check. cpi->check shouldn't/can't ever go above 80.
|

02-05-2003, 07:49 AM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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.
|

02-05-2003, 08:23 AM
|
Dragon
|
|
Join Date: Jan 2002
Posts: 521
|
|
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)
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 01:24 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |