上传pve消耗挑战券

This commit is contained in:
liwei 2022-10-31 12:04:44 +08:00
parent 9b3edaaec2
commit 825889c867
2 changed files with 11 additions and 1 deletions

View File

@ -50,7 +50,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
cd = pb.ErrorCode_DBError
return
}
this.module.modelArena.recoverTicket(red)
if red.Ticket > 0 {
red.Ticket--
if red.Lastrtickettime == 0 {

View File

@ -56,6 +56,16 @@ func (this *apiComp) Plot(session comm.IUserSession, req *pb.ArenaPlotReq) (code
cd = pb.ErrorCode_DBError
return
}
this.module.modelArena.recoverTicket(info)
if info.Ticket > 0 {
info.Ticket--
if info.Lastrtickettime == 0 {
info.Lastrtickettime = time.Now().Unix()
}
} else {
code = pb.ErrorCode_ArenaTicketNotEnough
return
}
if info.Npc[req.Pid] != nil {
ndata := info.Npc[req.Pid]
if !time.Now().After(time.Unix(ndata.Cd, 0)) { //已经过了cd时间