上传月子秘境代码优化

This commit is contained in:
liwei1dao 2022-10-19 18:29:08 +08:00
parent de42696f16
commit cbf7198e4a

View File

@ -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
}