优化notification GM
This commit is contained in:
parent
f56121d9ee
commit
7b6ed80126
@ -11,7 +11,9 @@ import (
|
|||||||
chargeCfg "server/conf/charge"
|
chargeCfg "server/conf/charge"
|
||||||
emojiCfg "server/conf/emoji"
|
emojiCfg "server/conf/emoji"
|
||||||
faceCfg "server/conf/face"
|
faceCfg "server/conf/face"
|
||||||
|
languageCfg "server/conf/language"
|
||||||
mergeDataCfg "server/conf/merge_data"
|
mergeDataCfg "server/conf/merge_data"
|
||||||
|
notification_cfg "server/conf/notification"
|
||||||
playroomCfg "server/conf/playroom"
|
playroomCfg "server/conf/playroom"
|
||||||
"server/db"
|
"server/db"
|
||||||
"server/game/mod/activity"
|
"server/game/mod/activity"
|
||||||
@ -602,6 +604,15 @@ func ReqGmCommand_(player *Player, Command string) error {
|
|||||||
NotifyPetroomGame(Id)
|
NotifyPetroomGame(Id)
|
||||||
case "notificationTest":
|
case "notificationTest":
|
||||||
Id, _ := strconv.Atoi(arg[1])
|
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.")
|
GoUtil.NotifyPlayer(Id, 1, "Test Notification", "This is a test notification from the server.")
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Player %d ReqGmCommand:%v not found", player.M_DwUin, arg)
|
return fmt.Errorf("Player %d ReqGmCommand:%v not found", player.M_DwUin, arg)
|
||||||
|
|||||||
@ -3,9 +3,12 @@ package test
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
decorateCfg "server/conf/decorate"
|
decorateCfg "server/conf/decorate"
|
||||||
|
languageCfg "server/conf/language"
|
||||||
|
notification_cfg "server/conf/notification"
|
||||||
"server/db"
|
"server/db"
|
||||||
"server/game"
|
"server/game"
|
||||||
GoUtil "server/game_util"
|
GoUtil "server/game_util"
|
||||||
|
"server/msg"
|
||||||
"server/pkg/github.com/name5566/leaf/log"
|
"server/pkg/github.com/name5566/leaf/log"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@ -96,6 +99,14 @@ func TestEndless(t *testing.T) {
|
|||||||
MailMod.BackData()
|
MailMod.BackData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 10130 10165
|
||||||
func TestNotify(t *testing.T) {
|
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