This commit is contained in:
aozhiwei 2020-12-10 11:11:02 +08:00
parent dc28d39110
commit 5de05fc59e
2 changed files with 23 additions and 0 deletions

View File

@ -146,7 +146,29 @@ void ChatMgr::ProcGuildChat(Player* hum, const cs::CMSendChatMsg& msg)
void ChatMgr::ProcTeamChat(Player* hum, const cs::CMSendChatMsg& msg)
{
++world_msg_id_;
cs::MFChatMsg* p = new cs::MFChatMsg();
p->set_msg_uuid(world_msg_id_);
hum->FillMFUserInfo(p->mutable_sender());
//p->set_receiver(world_msg_id_);
p->set_chat_channel(msg.chat_channel());
p->set_msg_type(msg.msg_type());
p->set_msg_body(msg.msg_body());
p->set_send_time(time(nullptr));
world_msgrec_.curr_id = world_msg_id_;
cs::SMChatMsgNotify notifymsg;
*notifymsg.add_msg_list() = *p;
if (notifymsg.msg_list().size() > 0) {
for (auto& member_id : msg.members()) {
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(member_id);
if (hum) {
hum->SendMsg(notifymsg);
}
}
}
delete p;
}
void ChatMgr::ProcBigHornChat(Player* hum, const cs::CMSendChatMsg& msg)

View File

@ -677,6 +677,7 @@ message CMSendChatMsg
optional string target = 2; //
optional int32 msg_type = 3; //// 0(json) 1 (json) 2:()
optional string msg_body = 4; //
repeated string members = 5; //()
}
//