1
This commit is contained in:
parent
13b48a5a91
commit
e5c90e2642
@ -27,6 +27,9 @@ void Guild::UnInit()
|
||||
}
|
||||
member_hash_.clear();
|
||||
A8_SAFE_DELETE(logdb_);
|
||||
for (auto& pair : apply_hash_) {
|
||||
delete pair.second;
|
||||
}
|
||||
}
|
||||
|
||||
GuildMember* Guild::GetMember(const std::string& account_id)
|
||||
@ -168,6 +171,14 @@ void Guild::_CMGuildAgree(f8::MsgHdr& hdr, const cs::CMGuildAgree& msg)
|
||||
GuildMember* member = new GuildMember();
|
||||
TypeConvert::Convert(forward_msg->context().user_info().base_data(), *member);
|
||||
AddMember(member);
|
||||
|
||||
DBHelper::Instance()->SetGuildApplyStatus
|
||||
(
|
||||
msg.apply().base_data().account_id(),
|
||||
guild_id,
|
||||
1
|
||||
);
|
||||
ClearApplyBySenderId(msg.apply().base_data().account_id());
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,3 +531,25 @@ void Guild::FillApplyList(const std::string& account_id, cs::MFPaging& paging, c
|
||||
respmsg.mutable_paging()->set__total_page(1);
|
||||
}
|
||||
}
|
||||
|
||||
void Guild::ClearApplyBySenderId(const std::string& sender_id)
|
||||
{
|
||||
std::vector<long long> deleted_applys;
|
||||
for (auto& pair : apply_hash_) {
|
||||
if (pair.second->base_data.account_id == sender_id) {
|
||||
deleted_applys.push_back(pair.first);
|
||||
}
|
||||
}
|
||||
for (auto idx : deleted_applys) {
|
||||
ClearApplyByIdx(idx);
|
||||
}
|
||||
}
|
||||
|
||||
void Guild::ClearApplyByIdx(long long idx)
|
||||
{
|
||||
auto itr = apply_hash_.find(idx);
|
||||
if (itr != apply_hash_.end()) {
|
||||
delete itr->second;
|
||||
apply_hash_.erase(itr);
|
||||
}
|
||||
}
|
||||
|
@ -84,6 +84,8 @@ private:
|
||||
void GenSortedMembers();
|
||||
int GetMemberNum();
|
||||
void FillApplyList(const std::string& account_id, cs::MFPaging& paging, cs::SMGuildApplyList& respmsg);
|
||||
void ClearApplyBySenderId(const std::string& sender_id);
|
||||
void ClearApplyByIdx(long long idx);
|
||||
|
||||
private:
|
||||
bool dirty_ = false;
|
||||
|
@ -390,6 +390,7 @@ message SMGuildJoin
|
||||
//同意加公会
|
||||
message CMGuildAgree
|
||||
{
|
||||
optional MFGuildApply apply = 1; //申请信息
|
||||
}
|
||||
message SMGuildAgree
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user