From 404017c33ee3f6c97b9021b76a841dd95fa77248 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Tue, 30 Apr 2024 17:56:44 +0800 Subject: [PATCH] no message --- model/player.go | 1 + webapi/api.go | 11 ++++++----- worldsrv/action_welfare.go | 2 +- worldsrv/monitormgr.go | 11 ++++++----- worldsrv/playeronline.go | 7 +++++-- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/model/player.go b/model/player.go index f899d8c..e2a8baf 100644 --- a/model/player.go +++ b/model/player.go @@ -777,6 +777,7 @@ func NewPlayerData(acc string, name string, id int32, channel, platform string, UnMaxPower: 10, //初始化炮倍最小倍数 WeekCardTime: make(map[int32]int64), WeekCardAward: make(map[int32]bool), + WelfData: NewWelfareData(), } if tel != "" { diff --git a/webapi/api.go b/webapi/api.go index 7650356..ebc76b7 100644 --- a/webapi/api.go +++ b/webapi/api.go @@ -15,9 +15,10 @@ import ( "time" "google.golang.org/protobuf/proto" + "mongo.games.com/goserver/core/logger" ) -const DEFAULT_TIMEOUT = time.Duration(time.Second * 30) +const DEFAULT_TIMEOUT = time.Second * 30 var WebApiStats = new(sync.Map) @@ -81,7 +82,7 @@ func getRequest(appId, action string, params map[string]string, body proto.Messa } callUrl := MakeURL(appId, action, params, data) - //println("callurl=", callUrl) + logger.Logger.Tracef("getRequest url: %v params: %v request body: %v", callUrl, params, body) req, err := http.NewRequest("GET", callUrl, nil) if err != nil { return nil, err @@ -129,7 +130,7 @@ func getRequest(appId, action string, params map[string]string, body proto.Messa } return body, err } - println("callurl=", callUrl, "code=", resp.StatusCode) + logger.Logger.Errorf("getRequest url:%v params:%v request body:%v code:%v", callUrl, params, body, resp.StatusCode) return nil, fmt.Errorf("StatusCode:%d", resp.StatusCode) } @@ -152,7 +153,7 @@ func postRequest(appId, action string, params map[string]string, body proto.Mess } callUrl := MakeURL(appId, action, params, data) - //println("callurl=", callUrl) + logger.Logger.Tracef("postRequest url: %v request body: %v", callUrl, body) req, err := http.NewRequest("POST", callUrl, bytes.NewBuffer(data)) if err != nil { return nil, err @@ -200,7 +201,7 @@ func postRequest(appId, action string, params map[string]string, body proto.Mess } return body, err } - println("callurl=", callUrl, "code=", resp.StatusCode) + logger.Logger.Errorf("postRequest url:%v request body: %v code: %v", callUrl, body, resp.StatusCode) return nil, fmt.Errorf("StatusCode:%d", resp.StatusCode) } diff --git a/worldsrv/action_welfare.go b/worldsrv/action_welfare.go index b9631d4..7f305b6 100644 --- a/worldsrv/action_welfare.go +++ b/worldsrv/action_welfare.go @@ -357,7 +357,7 @@ func CSBindInvite(s *netlib.Session, packetid int, data interface{}, sid int64) return nil }), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { if err != nil || inviteSnId == 0 { - logger.Logger.Errorf("GetSnIdByCode err %v %v", err, inviteSnId) + logger.Logger.Tracef("GetSnIdByCode not found %v %v", err, msg.GetCode()) ret.OpRetCode = welfare.OpResultCode_OPRC_NotExist send() return diff --git a/worldsrv/monitormgr.go b/worldsrv/monitormgr.go index b1a5747..aa5e845 100644 --- a/worldsrv/monitormgr.go +++ b/worldsrv/monitormgr.go @@ -2,9 +2,8 @@ package main import ( "encoding/gob" - "mongo.games.com/game/common" - "mongo.games.com/game/model" - "mongo.games.com/game/webapi" + "time" + "mongo.games.com/goserver/core" "mongo.games.com/goserver/core/basic" "mongo.games.com/goserver/core/module" @@ -14,7 +13,10 @@ import ( "mongo.games.com/goserver/core/task" "mongo.games.com/goserver/core/transact" "mongo.games.com/goserver/core/utils" - "time" + + "mongo.games.com/game/common" + "mongo.games.com/game/model" + "mongo.games.com/game/webapi" ) var MonitorMgrSington = &MonitorMgr{} @@ -164,5 +166,4 @@ func init() { //gob registe module.RegisteModule(MonitorMgrSington, time.Minute*5, 0) - } diff --git a/worldsrv/playeronline.go b/worldsrv/playeronline.go index 31d984d..2018d43 100644 --- a/worldsrv/playeronline.go +++ b/worldsrv/playeronline.go @@ -1,8 +1,11 @@ package main import ( - "mongo.games.com/goserver/core/module" "time" + + "mongo.games.com/goserver/core/module" + + "mongo.games.com/game/model" ) var PlayerOnlineSington = &PlayerOnlineEvent{ @@ -55,7 +58,7 @@ func (p *PlayerOnlineEvent) Update() { here: p.OnlineCh = onlineCh - //LogChannelSingleton.WriteMQData(model.GenerateOnline(p.OnlineCh)) + LogChannelSingleton.WriteMQData(model.GenerateOnline(p.OnlineCh)) } func (p *PlayerOnlineEvent) Shutdown() {