This commit is contained in:
aozhiwei 2020-09-24 10:51:04 +08:00
parent d83e8d047f
commit 664807d95a
4 changed files with 6 additions and 18 deletions

View File

@ -248,17 +248,6 @@ void GuildMgr::_SS_IM_ForwardGuildCMMsg(f8::MsgHdr& hdr, const ss::SS_IM_Forward
}
}
unsigned int GuildMgr::GetGuildCrc32(long long guild_id)
{
std::string guild_id_str = a8::XValue(guild_id).GetString();
unsigned int crc32_code = a8::openssl::Crc32
(
(unsigned char*)guild_id_str.data(),
guild_id_str.size()
);
return crc32_code;
}
void GuildMgr::_CMGuildCreate(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildCreate& msg)
{
Player* hum = PlayerMgr::Instance()->GetPlayerBySocket(socket_handle);
@ -555,9 +544,9 @@ void GuildMgr::LoadGuild(long long guild_id)
}
GuildMgr::Instance()->task_hash_.erase(itr);
}
};
};
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(GetGuildCrc32(guild_id));
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(guild_id);
DBEngine::Instance()->ExecAsyncQuery
(
conn_info,
@ -573,7 +562,7 @@ void GuildMgr::LoadGuild(long long guild_id)
.SetSender(guild_id),
on_ok,
on_error,
GetGuildCrc32(guild_id)
guild_id
);
}

View File

@ -39,7 +39,6 @@ class GuildMgr : public a8::Singleton<GuildMgr>
int msgid,
const ::google::protobuf::Message& smmsg);
void _SS_IM_ForwardGuildCMMsg(f8::MsgHdr& hdr, const ss::SS_IM_ForwardGuildCMMsg& msg);
unsigned int GetGuildCrc32(long long guild_id);
private:
void _CMGuildCreate(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildCreate& msg);

View File

@ -858,14 +858,14 @@ void Player::ForwardGroupCMMsg(f8::MsgHdr& hdr, long long hash_code)
MSConnMgr::Instance()->SendMsg(msg, hash_code);
}
void Player::ForwardGuildCMMsg(f8::MsgHdr& hdr, long long hash_code)
void Player::ForwardGuildCMMsg(f8::MsgHdr& hdr, long long guild_id)
{
ss::SS_IM_ForwardGuildCMMsg msg;
FillIMMsgConext(msg.mutable_context());
if (hdr.buflen > 0) {
msg.mutable_payload()->assign(hdr.buf, hdr.buflen);
}
MSConnMgr::Instance()->SendMsg(msg, hash_code);
SyncHelper::Instance()->SendIMConnMsg(0, msg);
}
void Player::FillMFUserInfo(cs::MFUserInfo* user_info)

View File

@ -134,7 +134,7 @@ private:
void FillFriendList(::google::protobuf::RepeatedPtrField< ::cs::MFUserInfo >* friend_list);
void FillBlackList(::google::protobuf::RepeatedPtrField< ::cs::MFUserInfo >* black_list);
void ForwardGroupCMMsg(f8::MsgHdr& hdr, long long hash_code);
void ForwardGuildCMMsg(f8::MsgHdr& hdr, long long hash_code);
void ForwardGuildCMMsg(f8::MsgHdr& hdr, long long guild_id);
void SaveToDB(a8::XParams param, f8::AsyncDBOnOkFunc on_ok, f8::AsyncDBOnErrorFunc on_error);
void FillApplyList(const cs::MFPaging& paging, cs::SMFriendApplyList& respmsg);
void MarkDirty();