上传代码

This commit is contained in:
liwei1dao 2023-05-26 18:30:18 +08:00
parent 58ed0ec845
commit 1089324677
4 changed files with 60 additions and 59 deletions

View File

@ -115,62 +115,12 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HeroBuyReq) (code pb
} }
} }
for _, v := range need { // for _, v := range need {
if v.A == comm.AttrType && (v.T == comm.ResGold || v.T == comm.ResDiamond) { // if v.A == comm.AttrType && (v.T == comm.ResGold || v.T == comm.ResDiamond) {
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype67, v.N, utils.ToInt32(v.T)) // // this.module.ModuleRtask.SendToRtask(session, comm.Rtype67, v.N, utils.ToInt32(v.T))
switch v.T { // tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, utils.ToInt32(v.T)))
case comm.ResGold: // }
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 1)) // }
break
case comm.ResExp:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 3))
break
case comm.ResDiamond:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.VipExp:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.ResTaskActive:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.ResFriend:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 4))
break
case comm.StarCoin:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 9))
break
case comm.SociatyCoin:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 8))
break
case comm.ArenaCoin:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 11))
break
case comm.ResPs:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 12))
break
case comm.Moongold:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 14))
break
case comm.Talent1:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.Talent2:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.Talent3:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.Talent4:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.Merchantmoney:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 15))
break
}
}
}
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), tasks...) go this.module.ModuleRtask.TriggerTask(session.GetUserId(), tasks...)
session.SendMsg(string(this.module.GetType()), "buy", &pb.HeroBuyResp{ session.SendMsg(string(this.module.GetType()), "buy", &pb.HeroBuyResp{
IsSucc: true, IsSucc: true,

View File

@ -28,6 +28,7 @@ func (this *apiComp) GetGymBuff(session comm.IUserSession, req *pb.PracticeGetGy
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype185, 1))
session.SendMsg(string(this.module.GetType()), "getgymbuff", &pb.PracticeGetGymBuffResp{Buffid: buff.Id}) session.SendMsg(string(this.module.GetType()), "getgymbuff", &pb.PracticeGetGymBuffResp{Buffid: buff.Id})
return return
} }

View File

@ -67,7 +67,7 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
"gymrefresh": room.Gymrefresh, "gymrefresh": room.Gymrefresh,
"lastrefresh": room.Lastrefresh, "lastrefresh": room.Lastrefresh,
}) })
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype185, 1))
session.SendMsg(string(this.module.GetType()), "gymrefresh", &pb.PracticeGymRefreshResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh}) session.SendMsg(string(this.module.GetType()), "gymrefresh", &pb.PracticeGymRefreshResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
return return
} }

View File

@ -127,8 +127,58 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (code pb
tasks = append(tasks, comm.GettaskParam(comm.Rtype66, 1, int32(req.ShopType))) tasks = append(tasks, comm.GettaskParam(comm.Rtype66, 1, int32(req.ShopType)))
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype66, 1, int32(req.ShopType)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype66, 1, int32(req.ShopType))
for _, v := range need { for _, v := range need {
if v.A == comm.AttrType && (v.T == comm.ResGold || v.T == comm.ResDiamond) { if v.A == comm.AttrType {
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, utils.ToInt32(v.T))) // tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, utils.ToInt32(v.T)))
switch v.T {
case comm.ResGold:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 1))
break
case comm.ResExp:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 3))
break
case comm.ResDiamond:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.VipExp:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.ResTaskActive:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.ResFriend:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 4))
break
case comm.StarCoin:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 9))
break
case comm.SociatyCoin:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 8))
break
case comm.ArenaCoin:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 11))
break
case comm.ResPs:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 12))
break
case comm.Moongold:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 14))
break
case comm.Talent1:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.Talent2:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.Talent3:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.Talent4:
// tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 2))
break
case comm.Merchantmoney:
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, 15))
break
}
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype67, v.N, utils.ToInt32(v.T)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype67, v.N, utils.ToInt32(v.T))
} }
} }