diff --git a/modules/moonfantasy/api_battle.go b/modules/moonfantasy/api_battle.go index fda19da4b..467688a52 100644 --- a/modules/moonfantasy/api_battle.go +++ b/modules/moonfantasy/api_battle.go @@ -4,7 +4,6 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" - "time" "google.golang.org/protobuf/proto" ) @@ -17,14 +16,13 @@ func (this *apiComp) BattleCheck(session comm.IUserSession, req *pb.MoonfantasyB ///挑战怪物请求 func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattleReq) (code pb.ErrorCode, data proto.Message) { var ( - globalconf *cfg.GameGlobalData - boss *cfg.GameDreamlandBoosData - umfantasy *pb.DBUserMFantasy - mdata *pb.DBMoonFantasy - record *pb.DBBattleRecord - cd pb.ErrorCode - isjoin bool - err error + boss *cfg.GameDreamlandBoosData + umfantasy *pb.DBUserMFantasy + mdata *pb.DBMoonFantasy + record *pb.DBBattleRecord + cd pb.ErrorCode + isjoin bool + err error ) defer func() { @@ -96,9 +94,7 @@ func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattle return } - globalconf = this.module.configure.GetGlobalConf() - - if time.Now().Sub(time.Unix(mdata.Ctime, 0)).Seconds() >= float64(globalconf.DreamlandLimit) { + if this.module.modelDream.checkMFantasyExpiration(mdata) { //已过期 cd = pb.ErrorCode_MoonfantasyHasExpired return }