增加日志

This commit is contained in:
hahwu 2026-04-17 16:20:59 +08:00
parent ce81961798
commit 5649f3dbe7

View File

@ -6,6 +6,8 @@ import (
notification_cfg "server/conf/notification"
GoUtil "server/game_util"
"server/msg"
"gitea.bywaystudios.com/pet_home/leaf/log"
)
const (
@ -44,19 +46,23 @@ func NotifyPetroomGame(PlayerId int) {
func NotifyFriendApply(PlayerId, FriendId int) {
PlayerSimpleData := G_GameLogicPtr.GetSimplePlayerByUid(PlayerId)
if !checkLogout(PlayerSimpleData) {
log.Debug("NotifyFriendApply checkLogout failed for PlayerId: %d", PlayerId)
return
}
FriendSimpleData := G_GameLogicPtr.GetSimplePlayerByUid(FriendId)
if FriendSimpleData == nil {
log.Debug("NotifyFriendApply GetSimplePlayerByUid failed for FriendId: %d", FriendId)
return
}
if !SetFriendApplyNotification(PlayerId) {
log.Debug("NotifyFriendApply SetFriendApplyNotification failed for PlayerId: %d", PlayerId)
return
}
titlekey, infokey := notification_cfg.GetFriendApplyNotificationMsg()
title := languageCfg.GetLanguage(msg.LANG_TYPE(PlayerSimpleData.Lang), titlekey)
info := languageCfg.GetLanguage(msg.LANG_TYPE(PlayerSimpleData.Lang), infokey)
GoUtil.NotifyPlayer(GoUtil.Int(PlayerSimpleData.Account), NOTIFY_TYPE_FRIEND_APPLY, title, fmt.Sprintf(info, FriendSimpleData.Name))
log.Debug("NotifyFriendApply sent notification for PlayerId: %d, FriendId: %d", PlayerId, FriendId)
}
/*