上传月子秘境代码优化
This commit is contained in:
parent
de42696f16
commit
cbf7198e4a
@ -4,7 +4,6 @@ import (
|
|||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
"time"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"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) {
|
func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattleReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
var (
|
var (
|
||||||
globalconf *cfg.GameGlobalData
|
boss *cfg.GameDreamlandBoosData
|
||||||
boss *cfg.GameDreamlandBoosData
|
umfantasy *pb.DBUserMFantasy
|
||||||
umfantasy *pb.DBUserMFantasy
|
mdata *pb.DBMoonFantasy
|
||||||
mdata *pb.DBMoonFantasy
|
record *pb.DBBattleRecord
|
||||||
record *pb.DBBattleRecord
|
cd pb.ErrorCode
|
||||||
cd pb.ErrorCode
|
isjoin bool
|
||||||
isjoin bool
|
err error
|
||||||
err error
|
|
||||||
)
|
)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -96,9 +94,7 @@ func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattle
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
globalconf = this.module.configure.GetGlobalConf()
|
if this.module.modelDream.checkMFantasyExpiration(mdata) { //已过期
|
||||||
|
|
||||||
if time.Now().Sub(time.Unix(mdata.Ctime, 0)).Seconds() >= float64(globalconf.DreamlandLimit) {
|
|
||||||
cd = pb.ErrorCode_MoonfantasyHasExpired
|
cd = pb.ErrorCode_MoonfantasyHasExpired
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user