玩家信件优化

This commit is contained in:
hahwu 2026-04-01 12:30:31 +08:00
parent 7bb8e01b54
commit 2703593fcd
4 changed files with 10 additions and 2 deletions

View File

@ -626,6 +626,7 @@ func ReqGmCommand_(player *Player, Command string) error {
player.PlayMod.mod_list.Mail.TriggerMail = make([]int, 0, 8)
case "notification":
Id, _ := strconv.Atoi(arg[1])
SetFriendApplyNotification(Id, 2)
NotifyFriendApply(Id, int(player.M_DwUin))
NotifyPetroomGame(Id)
case "notificationTest":

View File

@ -555,7 +555,7 @@ func (p *Player) handle(m *msg.Msg) error {
"apply_count": info["apply_count"],
"other_count": info["other_count"],
})
if ok && len(applyUids) > 0 {
if ok && len(applyUids) >= 3 {
var faceList []int
var name string
var facebookPic []string
@ -576,7 +576,7 @@ func (p *Player) handle(m *msg.Msg) error {
})
}
otherUids, ok := info["other_uids"].([]int64)
if ok && len(otherUids) > 0 {
if ok && len(otherUids) >= 3 {
var faceList []int
var name string
var facebookPic []string

View File

@ -291,6 +291,9 @@ func PlayerLoginHandler(data *msg.Msg) (interface{}, error) {
now := GoUtil.Now()
validMessages := make([]*msg.Msg, 0, len(messages.Messages))
for _, message := range messages.Messages {
if message.HandleType != msg.HANDLE_MOD_PLAYER_MSG {
continue
}
if message.End == 0 || message.End >= now {
validMessages = append(validMessages, message)
}

View File

@ -8,6 +8,8 @@ import (
"strings"
"sync"
"time"
"gitea.bywaystudios.com/pet_home/leaf/log"
)
type VarMgr struct {
@ -261,6 +263,7 @@ func SetUserVarDataHandler(m *msg.Msg) (interface{}, error) {
ved.T = m.End
}
varData[v.Key] = ved
log.Debug("SetUserVarDataHandler: uid %d, key %s, value %v, setType %d, end %d", m.To, v.Key, v.Value, v.SetType, m.End)
SaveCacheVarData(GoUtil.GetVarKey(m.To), varData)
return nil, nil
}
@ -297,6 +300,7 @@ func SetDailyVarDataHandler(m *msg.Msg) (interface{}, error) {
varData.T = m.End
}
data.DailyVar[info.Key] = varData
log.Debug("set daily var m:%v", m)
SaveCacheVarData(GoUtil.GetVarKey(m.To), varData)
return nil, nil
}