This commit is contained in:
aozhiwei 2020-10-30 13:55:32 +08:00
parent 13a47d1a3d
commit eaf074bb1a
2 changed files with 21 additions and 2 deletions

View File

@ -63,6 +63,7 @@ func (this* RiskMgr) Init() *RiskMgr {
this.accessSecret = G.MetaMgr.GetAliKey().GetAccessSecret()
G.HttpServer.RegisterHandle("Analyse", "isOpen", this.__analyseIsOpen)
G.HttpServer.RegisterHandle("Ops", "dump", this.__opsDump)
return this
}
@ -149,7 +150,7 @@ func (this* RiskMgr) IsSafeZone(gameId int32, channel int32, ip string) bool {
return !this.IsBlockZone(gameId, channel, response.Country, response.Province, response.City)
}
func (this *RiskMgr) __analyseIsOpen(w http.ResponseWriter, r *http.Request) {
func (this *RiskMgr) __analyseIsOpen(w* http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
q5.ResponseInt32Ok(w, "is_open", 0)
return
@ -189,3 +190,21 @@ func (this *RiskMgr) __analyseIsOpen(w http.ResponseWriter, r *http.Request) {
return
}
}
func (this *RiskMgr) __opsDump(w* http.ResponseWriter, r *http.Request) {
this.ipWhiteListMutex.Lock()
this.ipBlackListMutex.Lock()
this.launchWhiteListMutex.Lock()
this.launchBlackListMutex.Lock()
this.blockProvinceCityHashMutex.Lock()
defer this.ipWhiteListMutex.Unlock()
defer this.ipBlackListMutex.Unlock()
defer this.launchWhiteListMutex.Unlock()
defer this.launchBlackListMutex.Unlock()
defer this.blockProvinceCityHashMutex.Unlock()
xobj := q5.NewMxoObject()
xobj.SetXValue("errcode", q5.NewXInt32(0))
xobj.SetXValue("errcode", q5.NewXString(""))
q5.Response(w, xobj.ToJsonStr())
}

2
third_party/q5 vendored

@ -1 +1 @@
Subproject commit e21d2e3b5d4f2c80ade87837c1f80ccc1e474fe6
Subproject commit 877ac12ec2c924d081a4fdc5adb99dcecf8fe180