think i found the problem:
Code:
From: zone.cpp
==============================
void Zone::LoadTempMerchantData(){
LogFile->write(EQEMuLog::Status, "Loading Temporary Merchant Lists...");
char* query = 0;
uint32_breakdown workpt;
workpt.b4() = DBA_b4_Zone;
workpt.w2_3() = 0;
workpt.b1() = DBA_b1_Zone_MerchantListsTemp;
DBAsyncWork* dbaw = new DBAsyncWork(&database, &MTdbafq, workpt, DBAsync::Read);
dbaw->AddQuery(1, &query, MakeAnyLenString(&query,
"select ml.npcid,ml.slot,ml.itemid,ml.charges from "
"merchantlist_temp ml, npc_types nt, spawnentry se, "
"spawn2 s2 where nt.id=ml.npcid and nt.id=se.npcid and "
"se.spawngroupid=s2.spawngroupid and s2.zone='%s' "
"group by ml.npcid,slot order by npcid,slot asc", GetShortName()));
if (!(pQueuedMerchantsWorkID = dbasync->AddWork(&dbaw))) {
safe_delete(dbaw);
LogFile->write(EQEMuLog::Error, "dbasync->AddWork() failed adding merchant list query");
return;
}
the zone loads the temp merchant list from the database when the zone is started.
and the zone stores the temporary items like this:
Code:
From: zone.h
======================
map<uint32,std::list<TempMerchantList> > tmpmerchanttable;
which gets the list when the zone is started, but is not updated with the new items from the function below...
however... when an item is sold to the merchant it is added to the database...
Code:
From: zonedb.cpp
===========================
void ZoneDatabase::SaveMerchantTemp(int32 npcid, int32 slot, int32 item, int32 charges){
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
if (!RunQuery(query, MakeAnyLenString(&query, "replace into merchantlist_temp (npcid,slot,itemid,charges) values(%d,%d,%d,%d)", npcid, slot, item, charges), errbuf)) {
cerr << "Error in SaveMerchantTemp query '" << query << "' " << errbuf << endl;
}
safe_delete_array(query);
}
so it seems the temporary lists are being stored in a list variable in each instance of zone.exe, but the selling of an item to a merchant is being stored in the database only... i intend to do some database testing to see if in-fact rows are being inserted into the database when items are sold. i would attempt to manually insert items into the temp list... but the problem is that everything is cleared from it when the zone boots, and since my theory is that the items are loaded at zone boot... well lol there's no way to check it.
i'll be honest... i can mostly read and understand c++ but i'll be damned if i can write it very well... think of me as someone who took intro to french in high school... who is now trying to edit a french novel lol
i can look through and find the problems, but i've not the slightest idea how to correct the grammatical errors in it :p