diff --git a/bin/json/game_global.json b/bin/json/game_global.json index 89e959207..52e01fff5 100644 --- a/bin/json/game_global.json +++ b/bin/json/game_global.json @@ -660,6 +660,7 @@ "n": 30000 } ], - "game_make_TunkNum": 5 + "game_make_TunkNum": 5, + "pandamas_tiguandiaoxiang_cd": 10 } ] \ No newline at end of file diff --git a/modules/practice/api_info.go b/modules/practice/api_info.go index 149252c45..a3c51cd4c 100644 --- a/modules/practice/api_info.go +++ b/modules/practice/api_info.go @@ -32,7 +32,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.PracticeInfoReq) (c } for i := 0; i < len(room.Statuers); { - if time.Unix(room.Statuers[i].End, 0).After(configure.Now()) { //过期 + if configure.Now().After(time.Unix(room.Statuers[i].End, 0)) { room.Statuers = append(room.Statuers[:i], room.Statuers[i+1:]...) update["statuers"] = room.Statuers } else { diff --git a/modules/practice/module.go b/modules/practice/module.go index b14a29c98..a591033b6 100644 --- a/modules/practice/module.go +++ b/modules/practice/module.go @@ -214,7 +214,7 @@ func (this *Practice) ChallengeResults(bid, red, bule string, winSide int32) { keep = false for _, v := range buleroom.Statuers { if v.Uid == red { - v.End = configure.Now().Add(time.Minute * 1).Unix() + v.End = configure.Now().Add(time.Minute * time.Duration(this.configure.GetGlobalConf().PandamasTiguandiaoxiangCd)).Unix() keep = true break } @@ -223,7 +223,7 @@ func (this *Practice) ChallengeResults(bid, red, bule string, winSide int32) { buleroom.Statuers = append(buleroom.Statuers, &pb.DBPracticeStatuer{ Uid: red, Figure: reduser.Figure, - End: configure.Now().Add(time.Minute * 1).Unix(), + End: configure.Now().Add(time.Minute * time.Duration(this.configure.GetGlobalConf().PandamasTiguandiaoxiangCd)).Unix(), }) } @@ -238,7 +238,7 @@ func (this *Practice) ChallengeResults(bid, red, bule string, winSide int32) { keep = false for _, v := range redroom.Statuers { if v.Uid == bule { - v.End = configure.Now().Add(time.Minute * 1).Unix() + v.End = configure.Now().Add(time.Minute * time.Duration(this.configure.GetGlobalConf().PandamasTiguandiaoxiangCd)).Unix() keep = true break } @@ -247,7 +247,7 @@ func (this *Practice) ChallengeResults(bid, red, bule string, winSide int32) { redroom.Statuers = append(redroom.Statuers, &pb.DBPracticeStatuer{ Uid: bule, Figure: buleuser.Figure, - End: configure.Now().Add(time.Minute * 1).Unix(), + End: configure.Now().Add(time.Minute * time.Duration(this.configure.GetGlobalConf().PandamasTiguandiaoxiangCd)).Unix(), }) } for i, v := range buleroom.Statuers { diff --git a/sys/configure/structs/game.globalData.go b/sys/configure/structs/game.globalData.go index fe75b0360..cf697bc5e 100644 --- a/sys/configure/structs/game.globalData.go +++ b/sys/configure/structs/game.globalData.go @@ -196,6 +196,7 @@ type GameGlobalData struct { PandamasRankedBelow50 int32 MrylFlushed []*Gameatn GameMakeTunkNum int32 + PandamasTiguandiaoxiangCd int32 } const TypeId_GameGlobalData = 477542761 @@ -819,6 +820,7 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) { } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["game_make_TunkNum"].(float64); !_ok_ { err = errors.New("game_make_TunkNum error"); return }; _v.GameMakeTunkNum = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["pandamas_tiguandiaoxiang_cd"].(float64); !_ok_ { err = errors.New("pandamas_tiguandiaoxiang_cd error"); return }; _v.PandamasTiguandiaoxiangCd = int32(_tempNum_) } return }