This commit is contained in:
aozhiwei 2020-10-15 14:06:52 +08:00
parent accc93a36b
commit 4fafae4a84
14 changed files with 74 additions and 3 deletions

View File

@ -81,6 +81,8 @@ const char* const PROJ_ROOT_FMT = "/data/logs/%s";
const char* const EVENT_FRIEND_AGREE = "friend.agree";
const char* const EVENT_FRIEND_DELETE = "friend.delete";
const char* const EVENT_GUILD_REFUSE = "guild.refuse";
const int MAX_INSTANCE_ID = 1023;
const int MAX_FRIEND_NUM = 30;

View File

@ -688,6 +688,7 @@ void Guild::_CMGuildMemberList(f8::MsgHdr& hdr, const cs::CMGuildMemberList& msg
ss::SS_IM_ForwardGuildCMMsg *forward_msg = (ss::SS_IM_ForwardGuildCMMsg*)hdr.user_data;
cs::SMGuildMemberList respmsg;
respmsg.set_guild_lv(guild_lv_);
*respmsg.mutable_paging() = msg.paging();
if (respmsg.paging().page_size() <= 0) {
respmsg.mutable_paging()->set_page_size(10);
@ -764,6 +765,7 @@ void Guild::_CMGuildApplyList(f8::MsgHdr& hdr, const cs::CMGuildApplyList& msg)
}
}
cs::SMGuildApplyList respmsg;
respmsg.set_guild_lv(guild->GuildLv());
guild->FillApplyList(forward_msg->context().user_info().base_data().account_id(),
*paging,
respmsg);
@ -782,7 +784,7 @@ void Guild::_CMGuildApplyList(f8::MsgHdr& hdr, const cs::CMGuildApplyList& msg)
ss::SS_IM_ForwardGuildCMMsg* forward_msg = (ss::SS_IM_ForwardGuildCMMsg*)
param.param3.GetUserData();
cs::SMGuildJoin respmsg;
cs::SMGuildApplyList respmsg;
GuildMgr::Instance()->ForwardGuildSMMsg(param.param1,
forward_msg->context(),
respmsg);

View File

@ -30,6 +30,7 @@ public:
void _CMGuildAgreeInvite(f8::MsgHdr& hdr, const cs::CMGuildAgreeInvite& msg);
long long GuildId() { return guild_id_; }
int GuildLv() { return guild_lv_; }
const std::string GuildName() { return guild_name_; }
int GetMemberJob(const std::string& account_id);
int Status() { return guild_status_; }

View File

@ -9,6 +9,7 @@ namespace ss
class SS_IM_PushGuildUserOnlineState;
class SS_IM_GuildRecalcRedPoint;
class SS_IM_GuildNewApply;
class SS_IM_ApplyChangeResponse;
}
class Guild;

View File

@ -44,10 +44,12 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&immsghandler, &SyncHelper::_SS_IM_FriendDeleteResponse);
RegisterNetMsgHandler(&immsghandler, &SyncHelper::_SS_IM_GuildMemberQuitResponse);
RegisterNetMsgHandler(&immsghandler, &SyncHelper::_SS_IM_GuildMemberUpdateResponse);
RegisterNetMsgHandler(&immsghandler, &SyncHelper::_SS_IM_ApplyChangeResponse);
RegisterNetMsgHandler(&immsghandler, &PlayerMgr::_SS_IM_PushUserOnlineState);
RegisterNetMsgHandler(&immsghandler, &PlayerMgr::_SS_IM_RandomUsersResponse);
RegisterNetMsgHandler(&immsghandler, &PlayerMgr::_SS_GS_QueryGuildUserOnlineState);
RegisterNetMsgHandler(&immsghandler, &PlayerMgr::_SS_GS_PushGuildRedPoint);
RegisterNetMsgHandler(&immsghandler, &PlayerMgr::_SS_GS_ApplyChangeRequest);
RegisterNetMsgHandler(&immsghandler, &GuildMgr::_SS_IM_ForwardGuildSMMsg);
RegisterNetMsgHandler(&mscmsghandler, &PlayerMgr::_SS_MS_PushUserList);

View File

@ -114,6 +114,9 @@ void Player::Deserialize(const ss::MFUserDB& user_db)
role_data.today_create_guild_times = user_db.role_data().today_create_guild_times();
role_data.save_count = user_db.role_data().save_count();
role_data.last_save_time = user_db.role_data().last_save_time();
for (auto& pair : user_db.role_data().applyed_guild_list()) {
applyed_guild_hash_[pair.key()] = pair.val();
}
}
void Player::Serialize(ss::MFUserDB& user_db)

View File

@ -210,4 +210,5 @@ private:
std::map<std::string, Friend*> friend_hash_;
std::map<std::string, Friend*> black_hash_;
std::map<long long, FriendApply*> apply_hash_;
std::map<long long, long long> applyed_guild_hash_;
};

View File

@ -260,6 +260,11 @@ void PlayerMgr::_SS_GS_PushGuildRedPoint(f8::MsgHdr& hdr, const ss::SS_GS_PushGu
}
}
void PlayerMgr::_SS_GS_ApplyChangeRequest(f8::MsgHdr& hdr, const ss::SS_GS_ApplyChangeRequest& msg)
{
}
void PlayerMgr::_CMLoginOld(f8::MsgHdr& hdr, const cs::CMLoginOld& msg)
{
cs::CMLogin new_msg;

View File

@ -28,6 +28,7 @@ namespace ss
class SS_IM_GuildMemberUpdateResponse;
class SS_GS_QueryGuildUserOnlineState;
class SS_GS_PushGuildRedPoint;
class SS_GS_ApplyChangeRequest;
}
class Player;
@ -64,6 +65,7 @@ class PlayerMgr : public a8::Singleton<PlayerMgr>
void _SS_GS_QueryGuildUserOnlineState(f8::MsgHdr& hdr, const ss::SS_GS_QueryGuildUserOnlineState& msg);
void _SS_GS_PushGuildRedPoint(f8::MsgHdr& hdr, const ss::SS_GS_PushGuildRedPoint& msg);
void _SS_GS_ApplyChangeRequest(f8::MsgHdr& hdr, const ss::SS_GS_ApplyChangeRequest& msg);
void _CMLoginOld(f8::MsgHdr& hdr, const cs::CMLoginOld& msg);
void _CMLogin(f8::MsgHdr& hdr, const cs::CMLogin& msg);

View File

@ -194,6 +194,11 @@ void SyncHelper::_SS_IM_GuildMemberUpdateResponse(f8::MsgHdr& hdr, const ss::SS_
}
}
void SyncHelper::_SS_IM_ApplyChangeResponse(f8::MsgHdr& hdr, const ss::SS_IM_ApplyChangeResponse& msg)
{
}
void SyncHelper::RemovePendingRequest(long long seqid)
{
pending_request_hash_.erase(seqid);
@ -344,3 +349,17 @@ void SyncHelper::InternalSyncGuildMemberQuit(Guild* guild,
);
}
}
void SyncHelper::SyncGuildApplyed(Guild* guild,
const std::string& target_id
)
{
}
void SyncHelper::SyncGuildRefuse(Guild* guild,
const std::string& target_id
)
{
}

View File

@ -12,6 +12,7 @@ namespace ss
class SS_IM_GuildMemberQuitResponse;
class SS_IM_GuildMemberUpdateRequest;
class SS_IM_GuildMemberUpdateResponse;
class SS_IM_ApplyChangeResponse;
}
class Guild;
@ -52,10 +53,18 @@ public:
const std::string& target_id,
int reason);
void SyncGuildApplyed(Guild* guild,
const std::string& target_id
);
void SyncGuildRefuse(Guild* guild,
const std::string& target_id
);
void _SS_IM_FriendAgreeResponse(f8::MsgHdr& hdr, const ss::SS_IM_FriendAgreeResponse& msg);
void _SS_IM_FriendDeleteResponse(f8::MsgHdr& hdr, const ss::SS_IM_FriendDeleteResponse& msg);
void _SS_IM_GuildMemberQuitResponse(f8::MsgHdr& hdr, const ss::SS_IM_GuildMemberQuitResponse& msg);
void _SS_IM_GuildMemberUpdateResponse(f8::MsgHdr& hdr, const ss::SS_IM_GuildMemberUpdateResponse& msg);
void _SS_IM_ApplyChangeResponse(f8::MsgHdr& hdr, const ss::SS_IM_ApplyChangeResponse& msg);
private:

View File

@ -21,6 +21,13 @@ message MFStringTuple
repeated string values = 1; //values
}
//int64 pair
message MFPairInt64
{
optional int64 key = 1; //key
optional int64 val = 2; //val
}
//
message MFPaging
{
@ -554,6 +561,7 @@ message SMGuildMemberList
optional string errmsg = 2; //
optional MFPaging paging = 3; //
repeated MFUserInfo member_list = 4; //
optional int32 guild_lv = 5; //
}
//
@ -568,6 +576,7 @@ message SMGuildApplyList
optional string errmsg = 2; //
optional MFPaging paging = 3; //
repeated MFGuildApply apply_list = 4; //
optional int32 guild_lv = 5; //
}
//()

View File

@ -53,4 +53,6 @@ enum SSMessageId_e
_SS_IM_GuildRecalcRedPoint = 1038;
_SS_GS_PushGuildRedPoint = 1039;
_SS_IM_GuildNewApply = 1041;
_SS_GS_ApplyChangeRequest = 1042;
_SS_IM_ApplyChangeResponse = 1043;
}

View File

@ -61,7 +61,7 @@ message MFRole
optional int32 last_save_time = 3;
optional int32 today_apply_guild_times = 4;
optional int32 today_create_guild_times = 5;
repeated int64 applyed_guild_list = 6;
repeated cs.MFPairInt64 applyed_guild_list = 6;
}
message MFGroupMemberDB
@ -393,4 +393,17 @@ message SS_IM_GuildNewApply
{
optional MFIMMsgConext context = 1;
optional int64 guild_id = 2;
}
}
message SS_GS_ApplyChangeRequest
{
optional int64 seqid = 1;
optional int64 guild_id = 2;
optional string account_id = 3;
optional int32 is_refuse = 4;
}
message SS_IM_ApplyChangeResponse
{
optional int64 seqid = 1;
}