This commit is contained in:
aozhiwei 2020-06-15 19:56:31 +08:00
parent 692aed8c05
commit 67ce877009
4 changed files with 31 additions and 9 deletions

View File

@ -624,5 +624,8 @@ void Player::InternalUpdateUserInfo()
void Player::NotifyUserInfoUpdate(Friend* friend_data)
{
cs::SMUserInfoUpdate msg;
auto p = msg.add_user_infos();
TypeConvert::Convert(friend_data->base_data, *p->mutable_base_data());
TypeConvert::Convert(friend_data->temp_custom_data, *p->mutable_temp_custom_data());
SendMsg(msg);
}

View File

@ -32,12 +32,28 @@ void PlayerMgr::_SS_MS_PushUserList(f8::MsgHdr& hdr, const ss::SS_MS_PushUserLis
void PlayerMgr::_SS_IM_SendChatMsg(f8::MsgHdr& hdr, const ss::SS_IM_SendChatMsg& msg)
{
Player* hum = GetPlayerByAccountId(msg.target());
if (hum) {
cs::SMChatMsgNotify notifymsg;
notifymsg.set_sender(msg.context().account_id());
notifymsg.set_chat_channel(msg.chat_channel());
notifymsg.set_msg(msg.msg());
hum->SendMsg(notifymsg);
}
}
void PlayerMgr::_SS_IM_SendCustomMsg(f8::MsgHdr& hdr, const ss::SS_IM_SendCustomMsg& msg)
{
Player* hum = GetPlayerByAccountId(msg.target());
if (hum) {
cs::SMCustomMsgNotify notifymsg;
notifymsg.set_sender(msg.context().account_id());
notifymsg.set_msg(msg.msg());
notifymsg.set_param1(msg.param1());
notifymsg.set_param2(msg.param2());
notifymsg.set_param3(msg.param3());
hum->SendMsg(notifymsg);
}
}
void PlayerMgr::_SS_IM_UpdateUserInfo(f8::MsgHdr& hdr, const ss::SS_IM_UpdateUserInfo& msg)

View File

@ -20,5 +20,6 @@ class TypeConvert
static void Convert(const BaseUserData& base_data, ss::MFBaseUserDataDB& base_data_pb);
static void Convert(const ss::MFBaseUserDataDB& base_data_pb, const BaseUserData& base_data);
static void Convert(const BaseUserData& base_data, cs::MFBaseUserData& base_data_pb);
static void Convert(const UserTempCustomData& temp_custom_data, cs::MFUserTempCustomData& tmpe_custom_data_pb);
static void Convert(const UserTempCustomData& temp_custom_data,
cs::MFUserTempCustomData& tmpe_custom_data_pb);
};

View File

@ -154,17 +154,19 @@ message SS_MS_PushUserList
message SS_IM_SendChatMsg
{
optional MFIMMsgConext context = 1;
optional int32 chat_channel = 2;
optional string msg = 3;
optional string target = 2;
optional int32 chat_channel = 3;
optional string msg = 4;
}
message SS_IM_SendCustomMsg
{
optional MFIMMsgConext context = 1;
optional string msg = 2;
optional int64 param1 = 3;
optional int64 param2 = 4;
optional int64 param3 = 5;
optional string target = 2;
optional string msg = 3;
optional int64 param1 = 4;
optional int64 param2 = 5;
optional int64 param3 = 6;
}
message SS_IM_IMServerList