当前位置: 首页>>代码示例>>C++>>正文


C++ AuctionHouse::LoadAuctions方法代码示例

本文整理汇总了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;
    }
}
开发者ID:Carbinfibre,项目名称:ArcPro,代码行数:43,代码来源:AuctionMgr.cpp

示例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;
	}
}
开发者ID:jameyboor,项目名称:Antrix,代码行数:36,代码来源:AuctionMgr.cpp

示例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;
	}
}
开发者ID:Goatform,项目名称:ascent,代码行数:36,代码来源:AuctionMgr.cpp


注:本文中的AuctionHouse::LoadAuctions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。