1
This commit is contained in:
parent
10b2c26b9d
commit
4a4e11896c
@ -248,20 +248,45 @@ func (this *RiskMgr) _opsSyncConf(c *f5.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *RiskMgr) _opsInfo(c *f5.Context) {
|
func (this *RiskMgr) _opsInfo(c *f5.Context) {
|
||||||
gameId := c.Request("gameid").GetInt32()
|
this.gameHashMutex.Lock()
|
||||||
channel := c.Request("channel").GetInt32()
|
defer this.gameHashMutex.Unlock()
|
||||||
gameConf := this.GetGameConf(gameId, channel)
|
|
||||||
if gameConf == nil {
|
|
||||||
c.ResponseErr(1, "数据不存在")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
gameConf.Active()
|
|
||||||
respObj := q5.NewMxoObject()
|
respObj := q5.NewMxoObject()
|
||||||
respObj.SetXValue("errcode", q5.NewXInt32(0))
|
respObj.SetXValue("errcode", q5.NewXInt32(0))
|
||||||
respObj.SetXValue("errmsg", q5.NewXString(""))
|
respObj.SetXValue("errmsg", q5.NewXString(""))
|
||||||
respObj.SetXObject("conf", gameConf.GetConfObj())
|
{
|
||||||
respObj.SetXObject("pass", gameConf.GetPassObj())
|
passObj := q5.NewMxoObject()
|
||||||
respObj.SetXObject("block", gameConf.GetBlockObj())
|
passObj.SetXValue("total", q5.NewXInt64(this.totalPassTimes))
|
||||||
|
respObj.SetXValue("curr", q5.NewXInt64(this.passTimes))
|
||||||
|
respObj.SetXValue("total_ip_whitelist", q5.NewXInt64(this.totalIpWhiteListPassTimes))
|
||||||
|
respObj.SetXValue("curr_ip_whitelist", q5.NewXInt64(this.ipWhiteListPassTimes))
|
||||||
|
respObj.SetXObject("pass", passObj.AsXObject())
|
||||||
|
}
|
||||||
|
{
|
||||||
|
blockObj := q5.NewMxoObject()
|
||||||
|
respObj.SetXValue("total", q5.NewXInt64(this.totalBlockTimes))
|
||||||
|
respObj.SetXValue("curr", q5.NewXInt64(this.blockTimes))
|
||||||
|
respObj.SetXValue("total_ip_blacklist", q5.NewXInt64(this.totalIpBlackListBlockTimes))
|
||||||
|
respObj.SetXValue("curr_ip_blacklist", q5.NewXInt64(this.ipBlackListBlockTimes))
|
||||||
|
respObj.SetXValue("total_http_method", q5.NewXInt64(this.totalHttpMethodBlockTimes))
|
||||||
|
respObj.SetXValue("http_method", q5.NewXInt64(this.httpMethodBlockTimes))
|
||||||
|
|
||||||
|
respObj.SetXObject("block", blockObj.AsXObject())
|
||||||
|
}
|
||||||
|
respObj.SetXValue("errcode", q5.NewXInt64(this.totalSessionErrBlockTimes))
|
||||||
|
respObj.SetXValue("errcode", q5.NewXInt64(this.totalSessionErrBlockTimes))
|
||||||
|
gameList := q5.NewMxoArray()
|
||||||
|
for _, gameConf := range this.fetchGameConfList() {
|
||||||
|
gameConf.Active()
|
||||||
|
gameObj := q5.NewMxoObject()
|
||||||
|
gameObj.SetXValue("gameid", q5.NewXInt32(gameConf.gameId))
|
||||||
|
gameObj.SetXValue("channel", q5.NewXInt32(gameConf.channel))
|
||||||
|
gameObj.SetXObject("conf", gameConf.GetConfObj())
|
||||||
|
gameObj.SetXObject("pass", gameConf.GetPassObj())
|
||||||
|
gameObj.SetXObject("block", gameConf.GetBlockObj())
|
||||||
|
gameList.PushXObject(gameObj.AsXObject())
|
||||||
|
}
|
||||||
|
respObj.SetXObject("games", gameList.AsXObject())
|
||||||
c.Response(respObj.ToJsonStr())
|
c.Response(respObj.ToJsonStr())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user