Loading Items question

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Loading Items question

Post by John Adams » Fri Jul 24, 2009 4:17 pm

LE, forgive my noobness here ;) but I have a question about how World is loading items.

In net.cpp, I see where database.LoadItemList() gets called - so I follow that rabbit down the hole... where it then calls all these functions:

Code: Select all

void WorldDatabase::LoadItemList(){
	LoadBags();
	LoadFoods();
	LoadWeapons();
	LoadArmor();
	LoadShields();
	LoadSkillItems();
Let's go into each one of these individually.

LoadBags() : I am in a while loop for every Bag item in the database (314). Each while also executes LoadItemCommonData(id)

Code: Select all

Item* item = LoadItemCommonData(id);
LoadItemCommonData(id) : Runs a query --

Code: Select all

SELECT id, name, icon, count, tier, weight, description, show_name, attuneable, artifact, lore, temporary, notrade, novalue, nozone, nodestroy, crafted, good_only, evil_only, skill_id_req, skill_id_req2, skill_min, skill_max, slots, sell_price, stack_count, collectable, offers_quest_id, part_of_quest_id, recommended_level, adventure_default_level, max_charges, tradeskill_default_level, adventure_classes, tradeskill_classes from items
...with no "WHERE id = %li" or anything limiting the query to just the 1 bag item we're loading.

We do that for every single item we load, which from my uneducated view, appears like we are loading all 111,085 items for every item we're loading!

Is that true? Or am I missing out on some C++ magic somewhere?

I was looking into why item_details_skills were not being used, when I noticed this and had to ask. :)

Thanks for your patience.
John Adams
EQ2Emulator - Project Ghost
"Everything should work now, except the stuff that doesn't" ~Xinux

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Loading Items question

Post by LethalEncounter » Fri Jul 24, 2009 6:41 pm

hehe, you are missing some the if statement :) It only does the query if the tmp_item_list list is empty.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Loading Items question

Post by John Adams » Fri Jul 24, 2009 7:12 pm

Oh is that what that means? tee :oops:

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests