1
This commit is contained in:
parent
dc28d39110
commit
5de05fc59e
@ -146,7 +146,29 @@ void ChatMgr::ProcGuildChat(Player* hum, const cs::CMSendChatMsg& msg)
|
|||||||
|
|
||||||
void ChatMgr::ProcTeamChat(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)
|
void ChatMgr::ProcBigHornChat(Player* hum, const cs::CMSendChatMsg& msg)
|
||||||
|
@ -677,6 +677,7 @@ message CMSendChatMsg
|
|||||||
optional string target = 2; //目标
|
optional string target = 2; //目标
|
||||||
optional int32 msg_type = 3; ////消息类型 0:文本消息(json) 1:自定义协议 (json) 2:纯文本(但是任会做屏蔽字替换)
|
optional int32 msg_type = 3; ////消息类型 0:文本消息(json) 1:自定义协议 (json) 2:纯文本(但是任会做屏蔽字替换)
|
||||||
optional string msg_body = 4; //消息内容
|
optional string msg_body = 4; //消息内容
|
||||||
|
repeated string members = 5; //小队成员列表(包含自己)
|
||||||
}
|
}
|
||||||
|
|
||||||
//读取聊天消息列表并且开启聊天通知
|
//读取聊天消息列表并且开启聊天通知
|
||||||
|
Loading…
x
Reference in New Issue
Block a user