添加聊天全局红点
This commit is contained in:
parent
f08ce2b8e2
commit
0ebc307758
@ -176,6 +176,10 @@ void ChatMgr::ProcTeamChat(Player* hum, const cs::CMSendChatMsg& msg)
|
|||||||
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(member_id);
|
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(member_id);
|
||||||
if (hum) {
|
if (hum) {
|
||||||
hum->SendMsg(notifymsg);
|
hum->SendMsg(notifymsg);
|
||||||
|
if (hum->chat_channel == kCCTeam) {
|
||||||
|
a8::SetBitFlag(hum->red_point_flags_, RPF_FriendApply);
|
||||||
|
hum->SyncRedPoint();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete p;
|
delete p;
|
||||||
@ -269,6 +273,8 @@ void ChatMgr::SyncPrivateChatMsg(Player* hum)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hum->MarkNewMsg();
|
hum->MarkNewMsg();
|
||||||
|
a8::SetBitFlag(hum->red_point_flags_, RPF_FriendApply);
|
||||||
|
hum->SyncRedPoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,6 +298,8 @@ void ChatMgr::SyncGuildChatMsg(Player* hum)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hum->MarkNewMsg();
|
hum->MarkNewMsg();
|
||||||
|
a8::SetBitFlag(hum->red_point_flags_, RPF_FriendApply);
|
||||||
|
hum->SyncRedPoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,8 @@ enum NetHandler_e
|
|||||||
enum ReadPointFlag
|
enum ReadPointFlag
|
||||||
{
|
{
|
||||||
RPF_FriendApply = 0,
|
RPF_FriendApply = 0,
|
||||||
RPF_GuildApply = 1
|
RPF_GuildApply = 1,
|
||||||
|
RPF_Chat = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum GuildMemberQuitReason
|
enum GuildMemberQuitReason
|
||||||
|
@ -632,6 +632,9 @@ void Player::_CMReadMsgAndOpenChatNotify(f8::MsgHdr& hdr, const cs::CMReadMsgAnd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a8::UnSetBitFlag(red_point_flags_, RPF_Chat);
|
||||||
|
SyncRedPoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ class Player
|
|||||||
int channel = 0;
|
int channel = 0;
|
||||||
long ip_saddr = 0;
|
long ip_saddr = 0;
|
||||||
int account_registertime = 0;
|
int account_registertime = 0;
|
||||||
|
int red_point_flags_ = 0;
|
||||||
|
|
||||||
int chat_channel = -1;
|
int chat_channel = -1;
|
||||||
std::string private_target;
|
std::string private_target;
|
||||||
@ -167,6 +168,7 @@ class Player
|
|||||||
|
|
||||||
void SaveToDB(a8::XParams param, f8::AsyncDBOnOkFunc on_ok, f8::AsyncDBOnErrorFunc on_error);
|
void SaveToDB(a8::XParams param, f8::AsyncDBOnOkFunc on_ok, f8::AsyncDBOnErrorFunc on_error);
|
||||||
void MarkNewMsg();
|
void MarkNewMsg();
|
||||||
|
void SyncRedPoint();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void FillFriendList(::google::protobuf::RepeatedPtrField< ::cs::MFUserInfo >* friend_list);
|
void FillFriendList(::google::protobuf::RepeatedPtrField< ::cs::MFUserInfo >* friend_list);
|
||||||
@ -195,7 +197,6 @@ private:
|
|||||||
void OnFriendDeleteEvent(Event& event);
|
void OnFriendDeleteEvent(Event& event);
|
||||||
void OnGuildRefuseEvent(Event& event);
|
void OnGuildRefuseEvent(Event& event);
|
||||||
bool CanAddFriend(const std::string& account_id);
|
bool CanAddFriend(const std::string& account_id);
|
||||||
void SyncRedPoint();
|
|
||||||
void OnDailyReset();
|
void OnDailyReset();
|
||||||
void RecalcRedPoint();
|
void RecalcRedPoint();
|
||||||
void ClearApplyByIdx(long long idx);
|
void ClearApplyByIdx(long long idx);
|
||||||
@ -223,7 +224,6 @@ private:
|
|||||||
bool event_fetching_ = false;
|
bool event_fetching_ = false;
|
||||||
long long last_run_tick_ = 0;
|
long long last_run_tick_ = 0;
|
||||||
std::map<long long, Event> event_hash_;
|
std::map<long long, Event> event_hash_;
|
||||||
int red_point_flags_ = 0;
|
|
||||||
std::set<std::string> exclude_account_ids_;
|
std::set<std::string> exclude_account_ids_;
|
||||||
std::string user_sign_;
|
std::string user_sign_;
|
||||||
int last_create_guild_time_ = 0;
|
int last_create_guild_time_ = 0;
|
||||||
|
@ -814,7 +814,7 @@ message SMUpdateAccountInfo
|
|||||||
//更新红点信息
|
//更新红点信息
|
||||||
message SMUpdateRedPointNotify
|
message SMUpdateRedPointNotify
|
||||||
{
|
{
|
||||||
optional int32 red_point_flags = 1; //红点信息 1<<0:好友申请 1<<1:公会申请
|
optional int32 red_point_flags = 1; //红点信息 1<<0:好友申请 1<<1:公会申请 1<<2:聊天红点
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新聊天红点信息
|
//更新聊天红点信息
|
||||||
|
Loading…
x
Reference in New Issue
Block a user