上传竞技场npc cd代码
This commit is contained in:
parent
716d9585a4
commit
7413511ab5
@ -8,7 +8,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
// 参数校验
|
||||||
func (this *apiComp) PlotRewardCheck(session comm.IUserSession, req *pb.ArenaPlotRewardReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) PlotRewardCheck(session comm.IUserSession, req *pb.ArenaPlotRewardReq) (errdata *pb.ErrorData) {
|
||||||
if req.Pid == 0 || req.Report == nil {
|
if req.Pid == 0 || req.Report == nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
@ -19,7 +19,7 @@ func (this *apiComp) PlotRewardCheck(session comm.IUserSession, req *pb.ArenaPlo
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
///领取战斗奖励
|
// /领取战斗奖励
|
||||||
func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewardReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewardReq) (errdata *pb.ErrorData) {
|
||||||
var (
|
var (
|
||||||
npc *cfg.GameArenaChallengeNpcData
|
npc *cfg.GameArenaChallengeNpcData
|
||||||
@ -66,7 +66,7 @@ func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewa
|
|||||||
if len(npc.MonsterformatId) > int(info.Npc[req.Pid].Index+1) {
|
if len(npc.MonsterformatId) > int(info.Npc[req.Pid].Index+1) {
|
||||||
info.Npc[req.Pid].Index++
|
info.Npc[req.Pid].Index++
|
||||||
}
|
}
|
||||||
info.Npc[req.Pid].Cd = configure.Now().Add(time.Minute * time.Duration(npc.ReviveCd)).Unix()
|
info.Npc[req.Pid].Cd = configure.Now().Add(time.Hour * time.Duration(npc.ReviveCd)).Unix()
|
||||||
if err = this.module.modelArena.Change(info.Uid, map[string]interface{}{
|
if err = this.module.modelArena.Change(info.Uid, map[string]interface{}{
|
||||||
"npc": info.Npc,
|
"npc": info.Npc,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user