本文整理汇总了C++中Guild::GetAchievementMgr方法的典型用法代码示例。如果您正苦于以下问题:C++ Guild::GetAchievementMgr方法的具体用法?C++ Guild::GetAchievementMgr怎么用?C++ Guild::GetAchievementMgr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guild
的用法示例。
在下文中一共展示了Guild::GetAchievementMgr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleGuildFinderBrowse
void WorldSession::HandleGuildFinderBrowse(WorldPacket& recvPacket)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_BROWSE");
uint32 classRoles = 0;
uint32 availability = 0;
uint32 guildInterests = 0;
uint32 playerLevel = 0; // Raw player level (1-90), do they use MAX_FINDER_LEVEL when on level 90 ?
recvPacket >> playerLevel >> availability >> classRoles >> guildInterests;
Player* player = GetPlayer();
LFGuildPlayer settings(player->GetGUIDLow(), classRoles, availability, guildInterests, ANY_FINDER_LEVEL);
LFGuildStore guildList = sGuildFinderMgr->GetGuildsMatchingSetting(settings, player->GetTeamId());
uint32 guildCount = guildList.size();
if (guildCount == 0)
{
WorldPacket packet(SMSG_LF_GUILD_BROWSE_UPDATED);
packet.WriteBits(0, 18);
player->SendDirectMessage(&packet);
return;
}
bool returned = false;
if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES)
returned = true;
if (!(availability & ALL_WEEK) || availability > ALL_WEEK)
returned = true;
if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS)
returned = true;
if (playerLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || playerLevel < 1)
returned = true;
if (returned)
{
WorldPacket packet(SMSG_LF_GUILD_BROWSE_UPDATED);
packet.WriteBits(0, 18);
player->SendDirectMessage(&packet);
return;
}
ByteBuffer bufferData;
WorldPacket data(SMSG_LF_GUILD_BROWSE_UPDATED);
data.WriteBits(guildCount, 18);
for (LFGuildStore::const_iterator itr = guildList.begin(); itr != guildList.end(); ++itr)
{
LFGuildSettings guildSettings = itr->second;
Guild* guild = sGuildMgr->GetGuildById(itr->first);
ObjectGuid guildGUID = ObjectGuid(guild->GetGUID());
data.WriteBit(guildGUID[6]);
data.WriteBit(guildGUID[5]);
data.WriteBit(guildGUID[4]);
data.WriteBit(guildGUID[0]);
data.WriteBit(guildGUID[1]);
data.WriteBits(guildSettings.GetComment().size(), 10);
data.WriteBit(guildGUID[3]);
data.WriteBits(guild->GetName().size(), 7);
data.WriteBit(guildGUID[7]);
data.WriteBit(guildGUID[2]);
bufferData.WriteByteSeq(guildGUID[3]);
bufferData << uint32(guild->GetEmblemInfo().GetStyle());
bufferData << uint8(sGuildFinderMgr->HasRequest(player->GetGUIDLow(), guild->GetGUID()));
bufferData.WriteByteSeq(guildGUID[0]);
bufferData << uint32(guild->GetAchievementMgr().GetAchievementPoints());
bufferData.WriteByteSeq(guildGUID[2]);
bufferData << uint32(guildSettings.GetInterests());
bufferData << int32(guild->GetEmblemInfo().GetBackgroundColor());
bufferData << guild->GetLevel();
bufferData << uint32(guildSettings.GetAvailability());
bufferData << uint32(guildSettings.GetClassRoles());
bufferData.WriteByteSeq(guildGUID[5]);
bufferData << uint32(0); // Unk
if (guild->GetName().size() > 0)
bufferData.append(guild->GetName().c_str(), guild->GetName().size());
bufferData << uint32(0); // Unk
bufferData << uint32(guild->GetEmblemInfo().GetBorderStyle());
bufferData.WriteByteSeq(guildGUID[7]);
bufferData << uint32(guild->GetEmblemInfo().GetColor());
bufferData.WriteByteSeq(guildGUID[6]);
bufferData << uint32(0); // Unk
if (guildSettings.GetComment().size() > 0)
bufferData.append(guildSettings.GetComment().c_str(), guildSettings.GetComment().size());
//.........这里部分代码省略.........
示例2: HandleGuildFinderBrowse
void WorldSession::HandleGuildFinderBrowse(WorldPacket& recvPacket)
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_LF_GUILD_BROWSE");
uint32 classRoles = 0;
uint32 availability = 0;
uint32 guildInterests = 0;
uint32 playerLevel = 0; // Raw player level (1-85), do they use MAX_FINDER_LEVEL when on level 85 ?
recvPacket >> classRoles >> availability >> guildInterests >> playerLevel;
if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES)
return;
if (!(availability & AVAILABILITY_ALWAYS) || availability > AVAILABILITY_ALWAYS)
return;
if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS)
return;
if (playerLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || playerLevel < 1)
return;
Player* player = GetPlayer();
LFGuildPlayer settings(player->GetGUIDLow(), classRoles, availability, guildInterests, ANY_FINDER_LEVEL);
LFGuildStore guildList = sGuildFinderMgr->GetGuildsMatchingSetting(settings, player->GetTeamId());
uint32 guildCount = guildList.size();
if (guildCount == 0)
{
WorldPacket packet(SMSG_LF_GUILD_BROWSE_UPDATED, 0);
player->SendDirectMessage(&packet);
return;
}
ByteBuffer bufferData(65 * guildCount);
WorldPacket data(SMSG_LF_GUILD_BROWSE_UPDATED, 3 + guildCount * 65); // Estimated size
data.WriteBits(guildCount, 19);
for (LFGuildStore::const_iterator itr = guildList.begin(); itr != guildList.end(); ++itr)
{
LFGuildSettings guildSettings = itr->second;
Guild* guild = sGuildMgr->GetGuildById(itr->first);
ObjectGuid guildGUID = ObjectGuid(guild->GetGUID());
data.WriteBit(guildGUID[7]);
data.WriteBit(guildGUID[5]);
data.WriteBits(guild->GetName().size(), 8);
data.WriteBit(guildGUID[0]);
data.WriteBits(guildSettings.GetComment().size(), 11);
data.WriteBit(guildGUID[4]);
data.WriteBit(guildGUID[1]);
data.WriteBit(guildGUID[2]);
data.WriteBit(guildGUID[6]);
data.WriteBit(guildGUID[3]);
bufferData << uint32(guild->GetEmblemInfo().GetColor());
bufferData << uint32(guild->GetEmblemInfo().GetBorderStyle()); // Guessed
bufferData << uint32(guild->GetEmblemInfo().GetStyle());
bufferData.WriteString(guildSettings.GetComment());
bufferData << uint8(0); // Unk
bufferData.WriteByteSeq(guildGUID[5]);
bufferData << uint32(guildSettings.GetInterests());
bufferData.WriteByteSeq(guildGUID[6]);
bufferData.WriteByteSeq(guildGUID[4]);
bufferData << uint32(guild->GetLevel());
bufferData.WriteString(guild->GetName());
bufferData << uint32(guild->GetAchievementMgr().GetAchievementPoints());
bufferData.WriteByteSeq(guildGUID[7]);
bufferData << uint8(sGuildFinderMgr->HasRequest(player->GetGUIDLow(), guild->GetGUID())); // Request pending
bufferData.WriteByteSeq(guildGUID[2]);
bufferData.WriteByteSeq(guildGUID[0]);
bufferData << uint32(guildSettings.GetAvailability());
bufferData.WriteByteSeq(guildGUID[1]);
bufferData << uint32(guild->GetEmblemInfo().GetBackgroundColor());
bufferData << uint32(0); // Unk Int 2 (+ 128) // Always 0 or 1
bufferData << uint32(guild->GetEmblemInfo().GetBorderColor());
bufferData << uint32(guildSettings.GetClassRoles());
bufferData.WriteByteSeq(guildGUID[3]);
bufferData << uint32(guild->GetMembersCount());
}
data.FlushBits();
data.append(bufferData);
player->SendDirectMessage(&data);
}
示例3: HandleGuildFinderBrowse
void WorldSession::HandleGuildFinderBrowse(WorldPacket& recvPacket)
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_LF_GUILD_BROWSE");
uint32 classRoles = 0;
uint32 availability = 0;
uint32 guildInterests = 0;
uint32 playerLevel = 0;
recvPacket >> playerLevel >> guildInterests >> availability >> classRoles;
Player* player = GetPlayer();
LFGuildPlayer settings(player->GetGUIDLow(), classRoles, availability, guildInterests, ANY_FINDER_LEVEL);
LFGuildStore guildList = sGuildFinderMgr->GetGuildsMatchingSetting(settings, player->GetTeamId());
uint32 guildCount = guildList.size();
if (guildCount == 0)
{
WorldPacket packet(SMSG_LF_GUILD_BROWSE_UPDATED);
packet.WriteBits(0, 18);
packet.FlushBits();
player->SendDirectMessage(&packet);
return;
}
bool returned = false;
if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES)
returned = true;
if (!(availability & ALL_WEEK) || availability > ALL_WEEK)
returned = true;
if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS)
returned = true;
if (playerLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || playerLevel < 1)
returned = true;
if (returned)
{
WorldPacket packet(SMSG_LF_GUILD_BROWSE_UPDATED);
packet.WriteBits(0, 18);
packet.FlushBits();
player->SendDirectMessage(&packet);
return;
}
ByteBuffer bufferData;
WorldPacket data(SMSG_LF_GUILD_BROWSE_UPDATED);
data.WriteBits(guildCount, 18);
for (LFGuildStore::const_iterator itr = guildList.begin(); itr != guildList.end(); ++itr)
{
LFGuildSettings guildSettings = itr->second;
Guild* guild = sGuildMgr->GetGuildById(itr->first);
ObjectGuid guildGUID = ObjectGuid(guild->GetGUID());
data.WriteBitSeq<4>(guildGUID);
data.WriteBits(guild->GetName().size(), 7);
data.WriteBitSeq<0, 1>(guildGUID);
data.WriteBits(guildSettings.GetComment().size(), 10);
data.WriteBitSeq<2, 7, 3, 6, 5>(guildGUID);
bufferData << uint8(sGuildFinderMgr->HasRequest(player->GetGUIDLow(), guild->GetGUID()));
bufferData << uint32(guild->GetLevel());
bufferData << uint32(guildSettings.GetInterests());
bufferData << uint32(0); // Unk
bufferData << uint32(guild->GetEmblemInfo().GetBorderStyle());
bufferData.WriteByteSeq<1, 4>(guildGUID);
bufferData << uint32(guild->GetEmblemInfo().GetStyle());
bufferData.WriteByteSeq<3>(guildGUID);
bufferData << uint32(50397223); // Unk Flags
bufferData << uint32(guild->GetEmblemInfo().GetColor());
bufferData.WriteString(guild->GetName());
bufferData << uint32(guildSettings.GetClassRoles());
bufferData << uint32(guildSettings.GetAvailability());
bufferData.WriteString(guildSettings.GetComment());
bufferData.WriteByteSeq<6, 7>(guildGUID);
bufferData << uint8(0); // Cached
bufferData.WriteByteSeq<5, 0>(guildGUID);
bufferData << uint32(guild->GetEmblemInfo().GetBorderColor());
bufferData << uint32(guild->GetMembersCount());
bufferData << uint32(guild->GetAchievementMgr().GetAchievementPoints());
bufferData.WriteByteSeq<2>(guildGUID);
bufferData << int32(guild->GetEmblemInfo().GetBackgroundColor());
}
data.FlushBits();
data.append(bufferData);
player->SendDirectMessage(&data);
}
示例4: LoadGuilds
void GuildMgr::LoadGuilds()
{
uint32 count = 0;
// 0 1 2 3 4 5 6
QueryResult *result = CharacterDatabase.PQuery("SELECT guild.guildid,guild.name,leaderguid,EmblemStyle,EmblemColor,BorderStyle,BorderColor,"
// 7 8 9 10 11 12 13 14 15
"BackgroundColor,info,motd,createdate,BankMoney,level,experience,todayExperience,(SELECT COUNT(guild_bank_tab.guildid) FROM guild_bank_tab WHERE guild_bank_tab.guildid = guild.guildid) "
"FROM guild ORDER BY guildid ASC");
if (!result)
{
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded %u guild definitions", count);
return;
}
// load guild ranks
// 0 1 2 3 4
QueryResult* guildRanksResult = CharacterDatabase.Query("SELECT guildid,rid,rname,rights,BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
// load guild members
// 0 1 2 3 4 5 6
QueryResult* guildMembersResult = CharacterDatabase.PQuery("SELECT guildid,guild_member.guid,rank,pnote,offnote,BankResetTimeMoney,BankRemMoney,"
// 7 8 9 10 11 12
"BankResetTimeTab0,BankRemSlotsTab0,BankResetTimeTab1,BankRemSlotsTab1,BankResetTimeTab2,BankRemSlotsTab2,"
// 13 14 15 16 17 18 19 20 21 22
"BankResetTimeTab3,BankRemSlotsTab3,BankResetTimeTab4,BankRemSlotsTab4,BankResetTimeTab5,BankRemSlotsTab5,BankResetTimeTab6,BankRemSlotsTab6,BankResetTimeTab7,BankRemSlotsTab7,"
// 23 24 25 26 27 28 29
"characters.name, characters.level, characters.class, characters.zone, characters.logout_time, characters.account, thisWeekReputation, "
// 30 30 32 33 34 35 36
"achievementPoints, firstProfessionId, firstProfessionRank, firstProfessionValue, secondProfessionId, secondProfessionRank, secondProfessionValue "
"FROM guild_member LEFT JOIN characters ON characters.guid = guild_member.guid ORDER BY guildid ASC");
// load guild bank tab rights
// 0 1 2 3 4
QueryResult* guildBankTabRightsResult = CharacterDatabase.Query("SELECT guildid,TabId,rid,gbright,SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC");
BarGoLink bar(result->GetRowCount());
do
{
// Field *fields = result->Fetch();
bar.step();
++count;
Guild* newGuild = new Guild;
if (!newGuild->LoadGuildFromDB(result) ||
!newGuild->LoadRanksFromDB(guildRanksResult) ||
!newGuild->LoadMembersFromDB(guildMembersResult) ||
!newGuild->LoadBankRightsFromDB(guildBankTabRightsResult) ||
!newGuild->CheckGuildStructure())
{
newGuild->Disband();
delete newGuild;
continue;
}
newGuild->LoadGuildNewsEventLogFromDB();
QueryResult* achievementResult = CharacterDatabase.PQuery("SELECT achievement, date, guids FROM guild_achievement WHERE guildId = %u", newGuild->GetId());
QueryResult* criteriaResult = CharacterDatabase.PQuery("SELECT criteria, counter, date, completedGuid FROM guild_achievement_progress WHERE guildId = %u", newGuild->GetId());
newGuild->GetAchievementMgr().LoadFromDB(achievementResult, criteriaResult);
AddGuild(newGuild);
}
while (result->NextRow());
delete result;
delete guildRanksResult;
delete guildMembersResult;
delete guildBankTabRightsResult;
// delete unused LogGuid records in guild_eventlog and guild_bank_eventlog table
// you can comment these lines if you don't plan to change CONFIG_UINT32_GUILD_EVENT_LOG_COUNT and CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT
CharacterDatabase.PExecute("DELETE FROM guild_news_eventlog WHERE LogGuid > '%u'", GUILD_NEWS_MAX_LOGS);
CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT));
CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT));
sLog.outString();
sLog.outString(">> Loaded %u guild definitions", count);
}