1
This commit is contained in:
parent
13a47d1a3d
commit
eaf074bb1a
@ -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
2
third_party/q5
vendored
@ -1 +1 @@
|
||||
Subproject commit e21d2e3b5d4f2c80ade87837c1f80ccc1e474fe6
|
||||
Subproject commit 877ac12ec2c924d081a4fdc5adb99dcecf8fe180
|
Loading…
x
Reference in New Issue
Block a user