上传竞技场代码
This commit is contained in:
parent
080f674ad5
commit
1016daf1be
@ -3,7 +3,6 @@ package arena
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
@ -51,11 +50,8 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
|
||||
return
|
||||
}
|
||||
this.module.modelArena.recoverTicket(red)
|
||||
if red.Ticket > 0 {
|
||||
red.Ticket--
|
||||
if red.Lastrtickettime == 0 {
|
||||
red.Lastrtickettime = configure.Now().Unix()
|
||||
}
|
||||
if red.Ticket > this.module.configure.GetGlobalConf().ArenaTicketCos {
|
||||
red.Ticket -= this.module.configure.GetGlobalConf().ArenaTicketCos
|
||||
} else {
|
||||
code = pb.ErrorCode_ArenaTicketNotEnough
|
||||
return
|
||||
|
@ -58,11 +58,8 @@ func (this *apiComp) Plot(session comm.IUserSession, req *pb.ArenaPlotReq) (code
|
||||
return
|
||||
}
|
||||
this.module.modelArena.recoverTicket(info)
|
||||
if info.Ticket > 0 {
|
||||
info.Ticket--
|
||||
if info.Lastrtickettime == 0 {
|
||||
info.Lastrtickettime = configure.Now().Unix()
|
||||
}
|
||||
if info.Ticket > this.module.configure.GetGlobalConf().ArenaTicketCos {
|
||||
info.Ticket -= this.module.configure.GetGlobalConf().ArenaTicketCos
|
||||
} else {
|
||||
code = pb.ErrorCode_ArenaTicketNotEnough
|
||||
return
|
||||
|
@ -378,10 +378,8 @@ func (this *modelArena) recoverTicket(info *pb.DBArenaUser) {
|
||||
info.Ticket += ticketNum
|
||||
if info.Ticket > global.ArenaTicketMax {
|
||||
info.Ticket = global.ArenaTicketMax
|
||||
info.Lastrtickettime = 0
|
||||
} else {
|
||||
}
|
||||
info.Lastrtickettime = time.Unix(info.Lastrtickettime, 0).Add(time.Duration(ticketNum) * time.Minute).Unix()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ func (this *modelDreamComp) trigger(session comm.IUserSession) {
|
||||
}
|
||||
// umfantasy.Mfantasys = append(umfantasy.Mfantasys, mdata.Id)
|
||||
umfantasy.TriggerNum++
|
||||
umfantasy.LastTrigger = configure.Now().Unix()
|
||||
this.module.modelUserMF.updateUserInfo(umfantasy)
|
||||
chat = &pb.DBChat{
|
||||
Ctype: pb.ChatType_Moonfantasy,
|
||||
|
@ -89,10 +89,8 @@ func (this *modelUserMF) recoverTicket(info *pb.DBUserMFantasy) {
|
||||
info.Ticket += ticketNum
|
||||
if info.Ticket > global.ArenaTicketMax {
|
||||
info.Ticket = global.ArenaTicketMax
|
||||
info.Lastrtickettime = 0
|
||||
} else {
|
||||
}
|
||||
info.Lastrtickettime = time.Unix(info.Lastrtickettime, 0).Add(time.Duration(ticketNum) * time.Minute).Unix()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user