From 6533a253fa58fc34b944eba8cbefd229c5b1e3f9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 16 Nov 2020 13:33:21 +0800 Subject: [PATCH] 1 --- server/analyseapi/riskmgr.go | 12 +++++++++++- server/analyseapi/types.go | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/server/analyseapi/riskmgr.go b/server/analyseapi/riskmgr.go index 02e49cd..e9ef9d7 100644 --- a/server/analyseapi/riskmgr.go +++ b/server/analyseapi/riskmgr.go @@ -59,7 +59,11 @@ func (this* RiskMgr) Init() *RiskMgr { func (params* q5.XParams) { this.OutputLog() }) - + f5.App.RegisterIMMsgHandle(IM_GAMECONF_CREATE, func (msgId int16, params *q5.XParams) { + G.RiskMgr.OnGameConfCreate( + params.Sender.GetInt32(), + params.Param1.GetInt32()) + }) return this } @@ -246,3 +250,9 @@ func (this *RiskMgr) __opsInfo(w* http.ResponseWriter, r *http.Request) { respObj.SetXObject("block", gameConf.GetBlockObj()) q5.Response(w, respObj.ToJsonStr()) } + +/* +安装定时器定时更新逻辑 +*/ +func (this *RiskMgr) OnGameConfCreate(gameId int32, channel int32) { +} diff --git a/server/analyseapi/types.go b/server/analyseapi/types.go index 00199ae..2edf9a8 100644 --- a/server/analyseapi/types.go +++ b/server/analyseapi/types.go @@ -155,6 +155,10 @@ func (this* GameConf) Init() { this.blockProvinceCityHash[val] = 1 } this.lastActiveTime = f5.App.NowUnix() + f5.App.AddIMMsg(IM_GAMECONF_CREATE, new(q5.XParams).Init(func (params* q5.XParams) { + params.Sender.SetInt32(this.gameId) + params.Param1.SetInt32(this.channel) + })) } func (this* GameConf) IsBlockZone(country string, province string, city string) bool {