优化notification GM
This commit is contained in:
parent
f56121d9ee
commit
7b6ed80126
@ -11,7 +11,9 @@ import (
|
||||
chargeCfg "server/conf/charge"
|
||||
emojiCfg "server/conf/emoji"
|
||||
faceCfg "server/conf/face"
|
||||
languageCfg "server/conf/language"
|
||||
mergeDataCfg "server/conf/merge_data"
|
||||
notification_cfg "server/conf/notification"
|
||||
playroomCfg "server/conf/playroom"
|
||||
"server/db"
|
||||
"server/game/mod/activity"
|
||||
@ -602,6 +604,15 @@ func ReqGmCommand_(player *Player, Command string) error {
|
||||
NotifyPetroomGame(Id)
|
||||
case "notificationTest":
|
||||
Id, _ := strconv.Atoi(arg[1])
|
||||
PlayerSimpleData := G_GameLogicPtr.GetSimplePlayerByUid(Id)
|
||||
if PlayerSimpleData == nil {
|
||||
return nil
|
||||
}
|
||||
titlekey, infokey := notification_cfg.GetFriendApplyNotificationMsg()
|
||||
title := languageCfg.GetLanguage(msg.LANG_TYPE(PlayerSimpleData.Lang), titlekey)
|
||||
info := languageCfg.GetLanguage(msg.LANG_TYPE(PlayerSimpleData.Lang), infokey)
|
||||
BaseMod := player.PlayMod.getBaseMod()
|
||||
GoUtil.NotifyPlayer(GoUtil.Int(PlayerSimpleData.Account), 2, title, fmt.Sprintf(info, BaseMod.NickName))
|
||||
GoUtil.NotifyPlayer(Id, 1, "Test Notification", "This is a test notification from the server.")
|
||||
default:
|
||||
return fmt.Errorf("Player %d ReqGmCommand:%v not found", player.M_DwUin, arg)
|
||||
|
||||
@ -3,9 +3,12 @@ package test
|
||||
import (
|
||||
"fmt"
|
||||
decorateCfg "server/conf/decorate"
|
||||
languageCfg "server/conf/language"
|
||||
notification_cfg "server/conf/notification"
|
||||
"server/db"
|
||||
"server/game"
|
||||
GoUtil "server/game_util"
|
||||
"server/msg"
|
||||
"server/pkg/github.com/name5566/leaf/log"
|
||||
"testing"
|
||||
)
|
||||
@ -96,6 +99,14 @@ func TestEndless(t *testing.T) {
|
||||
MailMod.BackData()
|
||||
}
|
||||
|
||||
// 10130 10165
|
||||
func TestNotify(t *testing.T) {
|
||||
GoUtil.NotifyPlayer(19246, 1, "Test Notification", "This is a test notification from the server.")
|
||||
titlekey, infokey := notification_cfg.GetFriendApplyNotificationMsg()
|
||||
title := languageCfg.GetLanguage(msg.LANG_TYPE(1), titlekey)
|
||||
info := languageCfg.GetLanguage(msg.LANG_TYPE(1), infokey)
|
||||
// titlekey, infokey := notification_cfg.GetPetroomGameNotificationMsg()
|
||||
// title := languageCfg.GetLanguage(msg.LANG_TYPE(1), titlekey)
|
||||
// info := languageCfg.GetLanguage(msg.LANG_TYPE(1), infokey)
|
||||
GoUtil.NotifyPlayer(10130, 2, title, fmt.Sprintf(info, "猫猫"))
|
||||
// GoUtil.NotifyPlayer(19246, 1, "Test Notification", "This is a test notification from the server.")
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user