1
This commit is contained in:
parent
b282c7e56b
commit
8bab030dfb
@ -271,3 +271,43 @@ void GuildMgr::OnOneDBDone(int instance_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GuildMgr::RefreshGuild(long long guild_id)
|
||||
{
|
||||
a8::XObject conn = DBEngine::Instance()->GetConnInfo(guild_id);
|
||||
DBEngine::Instance()->ExecAsyncQuery
|
||||
(
|
||||
conn,
|
||||
"SELECT idx, gameid, guild_id, guild_name, guild_lv, guild_exp, guild_badge, guild_notice, "
|
||||
" guild_declaration, owner_id, owner_name, owner_avatar_url, "
|
||||
" creator_id, creator_name, creator_avatar_url, guild_status, createtime, modifytime "
|
||||
"FROM `guild` WHERE guild_id = %d;",
|
||||
{
|
||||
guild_id
|
||||
},
|
||||
a8::XParams()
|
||||
.SetSender(guild_id),
|
||||
[] (a8::XParams& param, const f8::DataSet* data_set)
|
||||
{
|
||||
if (data_set && !data_set->empty()) {
|
||||
for (auto& row : *data_set) {
|
||||
cs::MFGuildBasic* guild = GuildMgr::Instance()->GetGuild(a8::XValue(row[2]));
|
||||
if (guild) {
|
||||
guild->set_guild_name(row[3]);
|
||||
guild->set_guild_lv(a8::XValue(row[4]));
|
||||
guild->set_guild_exp(a8::XValue(row[5]));
|
||||
guild->set_guild_badge(a8::XValue(row[6]));
|
||||
guild->set_guild_declaration(row[8]);
|
||||
guild->set_guild_owner_id(row[9]);
|
||||
guild->set_guild_owner_name(row[10]);
|
||||
guild->set_guild_owner_avatar_url(row[11]);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[] (a8::XParams& param, int error_code, const std::string& error_msg)
|
||||
{
|
||||
abort();
|
||||
},
|
||||
guild_id);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ class GuildMgr : public a8::Singleton<GuildMgr>
|
||||
void AddGuild(cs::MFGuildBasic* guild);
|
||||
void LoadGuild(int instance_id, long long last_idx);
|
||||
void OnOneDBDone(int instance_id);
|
||||
void RefreshGuild(long long guild_id);
|
||||
|
||||
private:
|
||||
bool load_done_ = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user