本文整理汇总了C++中GetGuildById函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGuildById函数的具体用法?C++ GetGuildById怎么用?C++ GetGuildById使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetGuildById函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetGuildById
Guild* GuildMgr::GetGuildByGuid(ObjectGuid guildGuid) const
{
if (!guildGuid.IsGuild())
return NULL;
return GetGuildById(guildGuid.GetCounter());
}
示例2: GetGuildNameById
std::string GuildMgr::GetGuildNameById(uint32 guildId) const
{
if (Guild* guild = GetGuildById(guildId))
return guild->GetName();
return "";
}
示例3: GetGuildNameById
std::string GuildMgr::GetGuildNameById(ObjectGuid::LowType guildId) const
{
if (Guild* guild = GetGuildById(guildId))
return guild->GetName();
return "";
}
示例4: GetGuildById
Guild* GuildMgr::GetGuildByGuid(uint64 guid) const
{
// Full guids are only used when receiving/sending data to client
// everywhere else guild id is used
if (IS_GUILD(guid))
if (uint32 guildId = GUID_LOPART(guid))
return GetGuildById(guildId);
return NULL;
}
示例5: GetGuildById
Guild* GuildMgr::GetGuildByGuid(ObjectGuid guid) const
{
// Full guids are only used when receiving/sending data to client
// everywhere else guild id is used
if (guid.IsGuild())
if (ObjectGuid::LowType guildId = guid.GetCounter())
return GetGuildById(guildId);
return NULL;
}
示例6: getMSTime
void GuildMgr::LoadGuilds()
{
// 1. Load all guilds
sLog->outString("Loading guilds definitions...");
{
uint32 oldMSTime = getMSTime();
// 0 1 2 3 4 5 6
QueryResult result = CharacterDatabase.Query("SELECT g.guildid, g.name, g.leaderguid, g.EmblemStyle, g.EmblemColor, g.BorderStyle, g.BorderColor, "
// 7 8 9 10 11 12 13 14 15
"g.BackgroundColor, g.info, g.motd, g.createdate, g.BankMoney, COUNT(gbt.guildid), xp, level , m_today_xp, m_xp_cap "
"FROM guild g LEFT JOIN guild_bank_tab gbt ON g.guildid = gbt.guildid GROUP BY g.guildid ORDER BY g.guildid ASC");
if (!result)
{
sLog->outString(">> Loaded 0 guild definitions. DB table `guild` is empty.");
sLog->outString();
return;
}
else
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
Guild* guild = new Guild();
if (!guild->LoadFromDB(fields))
{
delete guild;
continue;
}
QueryResult guildNews = CharacterDatabase.PQuery("SELECT type, date, value1, value2, source_guid, flags FROM guild_news WHERE guildid = %u ORDER BY date DESC", guild->GetId());
if (guildNews)
{
Field* fields = guildNews->Fetch();
guild->LoadGuildNewsFromDB(fields);
}
AddGuild(guild);
++count;
}
while (result->NextRow());
sLog->outString(">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
}
// 2. Load all guild ranks
sLog->outString("Loading guild ranks...");
{
uint32 oldMSTime = getMSTime();
// Delete orphaned guild rank entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gr FROM guild_rank gr LEFT JOIN guild g ON gr.guildId = g.guildId WHERE g.guildId IS NULL");
// 0 1 2 3 4
QueryResult result = CharacterDatabase.Query("SELECT guildid, rid, rname, rights, BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
if (!result)
{
sLog->outString(">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
sLog->outString();
}
else
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
uint32 guildId = fields[0].GetUInt32();
if (Guild* guild = GetGuildById(guildId))
guild->LoadRankFromDB(fields);
++count;
}
while (result->NextRow());
sLog->outString(">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
}
// 3. Load all guild members
sLog->outString("Loading guild members...");
{
uint32 oldMSTime = getMSTime();
// Delete orphaned guild member entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL");
// 0 1 2 3 4 5 6
QueryResult result = CharacterDatabase.Query("SELECT guildid, gm.guid, rank, pnote, offnote, BankResetTimeMoney, BankRemMoney, "
// 7 8 9 10 11 12
"BankResetTimeTab0, BankRemSlotsTab0, BankResetTimeTab1, BankRemSlotsTab1, BankResetTimeTab2, BankRemSlotsTab2, "
// 13 14 15 16 17 18
"BankResetTimeTab3, BankRemSlotsTab3, BankResetTimeTab4, BankRemSlotsTab4, BankResetTimeTab5, BankRemSlotsTab5, "
// 19 20 21 22
//.........这里部分代码省略.........
示例7: getMSTime
void GuildMgr::LoadGuilds()
{
// 1. Load all guilds
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guilds definitions...");
{
uint32 oldMSTime = getMSTime();
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild definitions. DB table `guild` is empty.");
return;
}
else
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
Guild* guild = new Guild();
if (!guild->LoadFromDB(fields))
{
delete guild;
continue;
}
AddGuild(guild);
++count;
}
while (result->NextRow());
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 2. Load all guild ranks
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild ranks...");
{
uint32 oldMSTime = getMSTime();
// Delete orphaned guild rank entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gr FROM guild_rank gr LEFT JOIN guild g ON gr.guildId = g.guildId WHERE g.guildId IS NULL");
// 0 1 2 3 4
QueryResult result = CharacterDatabase.Query("SELECT guildid, rid, rname, rights, BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
if (!result)
{
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
}
else
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
uint32 guildId = fields[0].GetUInt32();
if (Guild* guild = GetGuildById(guildId))
guild->LoadRankFromDB(fields);
++count;
}
while (result->NextRow());
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 3. Load all guild members
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild members...");
{
uint32 oldMSTime = getMSTime();
// Delete orphaned guild member entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL");
// 0 1 2 3 4 5 6
QueryResult result = CharacterDatabase.Query("SELECT gm.guildid, gm.guid, rank, pnote, offnote, BankResetTimeMoney, BankRemMoney, "
// 7 8 9 10 11 12
"BankResetTimeTab0, BankRemSlotsTab0, BankResetTimeTab1, BankRemSlotsTab1, BankResetTimeTab2, BankRemSlotsTab2, "
// 13 14 15 16 17 18
"BankResetTimeTab3, BankRemSlotsTab3, BankResetTimeTab4, BankRemSlotsTab4, BankResetTimeTab5, BankRemSlotsTab5, "
// 19 20 21 22
"BankResetTimeTab6, BankRemSlotsTab6, BankResetTimeTab7, BankRemSlotsTab7, "
// 23 24 25 26 27 28
"c.name, c.level, c.class, c.zone, c.account, c.logout_time "
"FROM guild_member gm LEFT JOIN characters c ON c.guid = gm.guid ORDER BY guildid ASC");
if (!result)
{
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild members. DB table `guild_member` is empty.");
}
else
{
uint32 count = 0;
//.........这里部分代码省略.........
示例8: getMSTime
void GuildMgr::LoadGuilds()
{
// 1. Load all guilds
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guilds definitions...");
{
uint32 oldMSTime = getMSTime();
// 0 1 2 3 4 5 6
QueryResult result = CharacterDatabase.Query("SELECT g.guildid, g.name, g.leaderguid, g.EmblemStyle, g.EmblemColor, g.BorderStyle, g.BorderColor, "
// 7 8 9 10 11 12 13 14 15
"g.BackgroundColor, g.info, g.motd, g.createdate, g.BankMoney, g.level, g.experience, g.todayExperience, COUNT(gbt.guildid) "
"FROM guild g LEFT JOIN guild_bank_tab gbt ON g.guildid = gbt.guildid GROUP BY g.guildid ORDER BY g.guildid ASC");
if (!result)
{
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild definitions. DB table `guild` is empty.");
return;
}
else
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
Guild* guild = new Guild();
if (!guild->LoadFromDB(fields))
{
delete guild;
continue;
}
AddGuild(guild);
++count;
}
while (result->NextRow());
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 2. Load all guild ranks
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild ranks...");
{
uint32 oldMSTime = getMSTime();
// Delete orphaned guild rank entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gr FROM guild_rank gr LEFT JOIN guild g ON gr.guildId = g.guildId WHERE g.guildId IS NULL");
// 0 1 2 3 4
QueryResult result = CharacterDatabase.Query("SELECT guildid, rid, rname, rights, BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
if (!result)
{
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
}
else
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
uint32 guildId = fields[0].GetUInt32();
if (Guild* guild = GetGuildById(guildId))
guild->LoadRankFromDB(fields);
++count;
}
while (result->NextRow());
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 3. Load all guild members
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild members...");
{
uint32 oldMSTime = getMSTime();
// Delete orphaned guild member entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL");
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member_withdraw gm LEFT JOIN guild_member g ON gm.guid = g.guid WHERE g.guid IS NULL");
// 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = CharacterDatabase.Query("SELECT gm.guildid, gm.guid, rank, pnote, offnote, w.tab0, w.tab1, w.tab2, w.tab3, w.tab4, w.tab5, "
// 11 12 13 14 15 16 17 18 19
"w.tab6, w.tab7, w.money, c.name, c.level, c.class, c.zone, c.account, c.logout_time "
"FROM guild_member gm "
"LEFT JOIN guild_member_withdraw w ON gm.guid = w.guid "
"LEFT JOIN characters c ON c.guid = gm.guid ORDER BY gm.guildid ASC");
if (!result)
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild members. DB table `guild_member` is empty.");
else
{
uint32 count = 0;
do
//.........这里部分代码省略.........
示例9: TC_LOG_INFO
void GuildMgr::LoadGuilds()
{
// 1. Load all guilds
TC_LOG_INFO("server.loading", "Loading guilds definitions...");
{
uint32 oldMSTime = getMSTime();
// 0 1 2 3 4 5 6
QueryResult result = CharacterDatabase.Query("SELECT g.guildid, g.name, g.leaderguid, g.EmblemStyle, g.EmblemColor, g.BorderStyle, g.BorderColor, "
// 7 8 9 10 11 12
"g.BackgroundColor, g.info, g.motd, g.createdate, g.BankMoney, COUNT(gbt.guildid) "
"FROM guild g LEFT JOIN guild_bank_tab gbt ON g.guildid = gbt.guildid GROUP BY g.guildid ORDER BY g.guildid ASC");
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 guild definitions. DB table `guild` is empty.");
return;
}
else
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
Guild* guild = new Guild();
if (!guild->LoadFromDB(fields))
{
delete guild;
continue;
}
AddGuild(guild);
++count;
}
while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 2. Load all guild ranks
TC_LOG_INFO("server.loading", "Loading guild ranks...");
{
uint32 oldMSTime = getMSTime();
// Delete orphaned guild rank entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gr FROM guild_rank gr LEFT JOIN guild g ON gr.guildId = g.guildId WHERE g.guildId IS NULL");
// 0 1 2 3 4
QueryResult result = CharacterDatabase.Query("SELECT guildid, rid, rname, rights, BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
}
else
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
uint64 guildId = fields[0].GetUInt64();
if (Guild* guild = GetGuildById(guildId))
guild->LoadRankFromDB(fields);
++count;
}
while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 3. Load all guild members
TC_LOG_INFO("server.loading", "Loading guild members...");
{
uint32 oldMSTime = getMSTime();
// Delete orphaned guild member entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL");
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member_withdraw gm LEFT JOIN guild_member g ON gm.guid = g.guid WHERE g.guid IS NULL");
// 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = CharacterDatabase.Query("SELECT gm.guildid, gm.guid, rank, pnote, offnote, w.tab0, w.tab1, w.tab2, w.tab3, w.tab4, w.tab5, "
// 11 12 13 14 15 16 17 18 19 20
"w.tab6, w.tab7, w.money, c.name, c.level, c.class, c.gender, c.zone, c.account, c.logout_time "
"FROM guild_member gm "
"LEFT JOIN guild_member_withdraw w ON gm.guid = w.guid "
"LEFT JOIN characters c ON c.guid = gm.guid ORDER BY gm.guildid ASC");
if (!result)
TC_LOG_INFO("server.loading", ">> Loaded 0 guild members. DB table `guild_member` is empty.");
else
{
uint32 count = 0;
do
//.........这里部分代码省略.........