所有发给game的消息都转发一份到金蚕
This commit is contained in:
parent
de4d07ecd6
commit
0d0ca89b46
@ -45,7 +45,7 @@ func HGamePreOrder(w http.ResponseWriter, r *http.Request) {
|
||||
uid := r.PostFormValue("uid")
|
||||
sid := r.PostFormValue("server")
|
||||
|
||||
if !redis.HExists("game_info", sid) {
|
||||
if !redis.IsValidServerId(util.StringToUint32(sid)) {
|
||||
log.Error("not Found server ", r.Form.Encode())
|
||||
return
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ func HuaweiPreOrder(w http.ResponseWriter, r *http.Request) {
|
||||
sid := r.PostFormValue("server")
|
||||
log.Debugf("HuaweiPreOrder Param %+v", r.Form)
|
||||
|
||||
if !redis.HExists("game_info", sid) {
|
||||
if !redis.IsValidServerId(util.StringToUint32(sid)) {
|
||||
log.Error("not Found server ", r.Form.Encode())
|
||||
return
|
||||
}
|
||||
|
@ -185,9 +185,7 @@ func (srv *PayServer) TestGameProxy(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (srv *PayServer) SendMsgToGame(sid int, urlPath string, msg interface{}, name string) (respData []byte, e error) {
|
||||
if sid >= 100 {
|
||||
return srv.forwardKsGame(sid, urlPath, msg, name)
|
||||
}
|
||||
srv.forwardKsGame(sid, urlPath, msg, name)
|
||||
info := redis.HGet("game_info", sid)
|
||||
if info == "" {
|
||||
log.Debug("SendMsgToGame info=nil")
|
||||
|
@ -52,7 +52,7 @@ func XiaomiPreOrder(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if !redis.HExists("game_info", sid) {
|
||||
if !redis.IsValidServerId(util.StringToUint32(sid)) {
|
||||
log.Error("not Found server ", r.Form.Encode())
|
||||
return
|
||||
}
|
||||
|
@ -69,3 +69,7 @@ func initPool() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func IsValidServerId(sid uint32) (bool) {
|
||||
return sid > 0 && sid < 200;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user