本文整理汇总了C++中AuctionHouse::LoadAuctions方法的典型用法代码示例。如果您正苦于以下问题:C++ AuctionHouse::LoadAuctions方法的具体用法?C++ AuctionHouse::LoadAuctions怎么用?C++ AuctionHouse::LoadAuctions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuctionHouse
的用法示例。
在下文中一共展示了AuctionHouse::LoadAuctions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadAuctionHouses
void AuctionMgr::LoadAuctionHouses()
{
Log.Notice("AuctionMgr", "Loading Auction Houses...");
QueryResult* res = CharacterDatabase.Query("SELECT MAX(auctionId) FROM auctions");
if(res)
{
maxId.SetVal(res->Fetch()[0].GetUInt32());
delete res;
}
res = WorldDatabase.Query("SELECT DISTINCT ahgroup FROM auctionhouse");
AuctionHouse* ah;
map<uint32, AuctionHouse*> tempmap;
if(res)
{
uint32 period = (res->GetRowCount() / 20) + 1;
uint32 c = 0;
do
{
ah = new AuctionHouse(res->Fetch()[0].GetUInt32());
ah->LoadAuctions();
auctionHouses.push_back(ah);
tempmap.insert(make_pair(res->Fetch()[0].GetUInt32(), ah));
if(!((++c) % period))
Log.Notice("AuctionHouse", "Done %u/%u, %u%% complete.", c, res->GetRowCount(), c * 100 / res->GetRowCount());
}
while(res->NextRow());
delete res;
}
res = WorldDatabase.Query("SELECT creature_entry, ahgroup FROM auctionhouse");
if(res)
{
do
{
auctionHouseEntryMap.insert(make_pair(res->Fetch()[0].GetUInt32(), tempmap[res->Fetch()[1].GetUInt32()]));
}
while(res->NextRow());
delete res;
}
}
示例2: LoadAuctionHouses
void AuctionMgr::LoadAuctionHouses()
{
sLog.outString("Loading Auction Houses...");
QueryResult * res = CharacterDatabase.Query("SELECT MAX(auctionId) FROM auctions");
if(res)
{
maxId = res->Fetch()[0].GetUInt32();
delete res;
}
res = WorldDatabase.Query("SELECT DISTINCT AHid FROM auctionhouse ORDER BY AHid");
AuctionHouse * ah;
map<uint32, AuctionHouse*> tempmap;
if(res)
{
do
{
ah = new AuctionHouse(res->Fetch()[0].GetUInt32());
ah->LoadAuctions();
auctionHouses.push_back(ah);
tempmap.insert( make_pair( res->Fetch()[0].GetUInt32(), ah ) );
}while(res->NextRow());
delete res;
}
res = WorldDatabase.Query("SELECT auctioneer, AHid FROM auctionhouse");
if(res)
{
do
{
auctionHouseEntryMap.insert( make_pair( res->Fetch()[0].GetUInt32(), tempmap[res->Fetch()[1].GetUInt32()] ) );
} while(res->NextRow());
delete res;
}
}
示例3: LoadAuctionHouses
void AuctionMgr::LoadAuctionHouses()
{
Log.Notice("AuctionMgr", "Loading Auction Houses...");
QueryResult * res = CharacterDatabase.Query("SELECT MAX(auctionId) FROM auctions");
if(res)
{
maxId = res->Fetch()[0].GetUInt32();
delete res;
}
res = WorldDatabase.Query("SELECT DISTINCT `group` FROM auctionhouse");
AuctionHouse * ah;
map<uint32, AuctionHouse*> tempmap;
if(res)
{
do
{
ah = new AuctionHouse(res->Fetch()[0].GetUInt32());
ah->LoadAuctions();
auctionHouses.push_back(ah);
tempmap.insert( make_pair( res->Fetch()[0].GetUInt32(), ah ) );
}while(res->NextRow());
delete res;
}
res = WorldDatabase.Query("SELECT creature_entry, `group` FROM auctionhouse");
if(res)
{
do
{
auctionHouseEntryMap.insert( make_pair( res->Fetch()[0].GetUInt32(), tempmap[res->Fetch()[1].GetUInt32()] ) );
} while(res->NextRow());
delete res;
}
}