系统优化

This commit is contained in:
hahwu 2025-03-07 15:43:44 +08:00
parent 780f501941
commit fe15155400
2 changed files with 12 additions and 20 deletions

View File

@ -6,30 +6,22 @@ import (
"fmt"
"net/http"
"server/conf"
"time"
)
const (
FEISHU_WEBHOOK = "https://open.feishu.cn/open-apis/bot/v2/hook/70e24a79-b019-434a-b4d1-4592bbf7c311"
FEISHU_WEBHOOK = "https://gadmin.bywaystudios.com/api/feishu/notify"
)
// AAqFpbuPhFSEx
func SendFeishuFatal(PlayerId int, FuncName string, msg string) error {
// 创建请求体
payload := map[string]interface{}{
"msg_type": "interactive",
"card": map[string]interface{}{
"type": "template",
"data": map[string]interface{}{
"template_id": "AAqFpbuPhFSEx",
"template_version_name": "1.0.0",
"template_variable": map[string]interface{}{
"appName": conf.Server.GameName,
"playerId": PlayerId,
"funcName": FuncName,
"fatal_msg": msg,
},
},
},
"notify_msg": fmt.Sprintf("游戏接口出错 %s:%d", conf.Server.GameName, PlayerId),
"host": FuncName,
"event_name": msg,
"severity": "High",
"alarm_time": time.Unix(time.Now().Unix(), 0).Format("2006-01-02 15:04:05"),
}
payloadBytes, err := json.Marshal(payload)
if err != nil {

View File

@ -31,11 +31,11 @@ func ReqGmCommand(player *Player, buf []byte) error {
return ReqGmCommand_(player, detail.Command)
}
func ReqGmCommand_(player *Player, Command string) error {
defer func() {
if err := recover(); err != nil {
log.Error("ReqGmCommand panic: %v", err)
}
}()
// defer func() {
// if err := recover(); err != nil {
// log.Error("ReqGmCommand panic: %v", err)
// }
// }()
arg := strings.Split(Command, " ")
switch arg[0] {
case "additem":