From 84bf1a5669b2a5e573ba5736f79f6dabd7fead7a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 3 Nov 2020 17:24:39 +0800 Subject: [PATCH] 1 --- server/analyseapi/riskmgr.go | 6 ++++-- third_party/q5 | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server/analyseapi/riskmgr.go b/server/analyseapi/riskmgr.go index 3af8ef3..ea3a2eb 100644 --- a/server/analyseapi/riskmgr.go +++ b/server/analyseapi/riskmgr.go @@ -217,7 +217,7 @@ func (this* RiskMgr) GetBlockObj() *q5.XObject { return blockObj.AsXObject() } -func (this* RiskMgr) IsSafeZone(gameId int32, channel int32, ip string) bool { +func (this* RiskMgr) IsSafeZone(gameId int32, channel int32, ip string, response_str* string) bool { accessKeyId := "" accessSecret := "" this.GetSdkInfo(&accessKeyId, &accessSecret) @@ -236,10 +236,12 @@ func (this* RiskMgr) IsSafeZone(gameId int32, channel int32, ip string) bool { f5.SysLog().Warning("Ipv4Location error %s", err.Error()) return false } + *response_str = q5.EncodeJson(response) return !this.IsBlockZone(gameId, channel, response.Country, response.Province, response.City) } func (this *RiskMgr) __analyseIsOpen(w* http.ResponseWriter, r *http.Request) { + response_str := "" isPass := func () bool { if r.Method != "POST" { atomic.AddInt64(&this.totalHttpMethodBlockTimes, 1) @@ -281,7 +283,7 @@ func (this *RiskMgr) __analyseIsOpen(w* http.ResponseWriter, r *http.Request) { atomic.AddInt64(&this.launchBlackListBlockTimes, 1) return false } - if G.RiskMgr.IsSafeZone(gameId, channel, remoteAddr) { + if G.RiskMgr.IsSafeZone(gameId, channel, remoteAddr, &response_str) { atomic.AddInt64(&this.totalSafeZonePassTimes, 1) atomic.AddInt64(&this.safeZonePassTimes, 1) return true diff --git a/third_party/q5 b/third_party/q5 index 80edf5b..1e70d9f 160000 --- a/third_party/q5 +++ b/third_party/q5 @@ -1 +1 @@ -Subproject commit 80edf5bfe52f6e19594d4390a5ab83af8bc0302a +Subproject commit 1e70d9f8938d42dfff11538792c4aa5bf9045ba1