notification优化
This commit is contained in:
parent
3de1b738a3
commit
532dba9873
@ -362,10 +362,22 @@ func CenterPlayerMsgHandler(data *msg.Msg) (interface{}, error) {
|
||||
SendMsgToNodeAsync(data, node)
|
||||
} else {
|
||||
// 不在线则存储消息
|
||||
applycount := 0
|
||||
if !GoUtil.InArray(data.Type, notify_msg_type) {
|
||||
messages := getMessge(PlayerId)
|
||||
messages.mu.Lock()
|
||||
messages.Messages = append(messages.Messages, data)
|
||||
for _, msgItem := range messages.Messages {
|
||||
if msgItem == nil {
|
||||
continue
|
||||
}
|
||||
if msgItem.Type == msg.HANDLE_TYPE_APPLY {
|
||||
applycount++
|
||||
}
|
||||
}
|
||||
if applycount > 1 && data.Type == msg.HANDLE_TYPE_APPLY {
|
||||
NotifyFriendApply(data.To, data.From)
|
||||
}
|
||||
messages.mu.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user