铁匠铺图鉴获得重复英雄奖励自动转碎片
This commit is contained in:
parent
5d302312b2
commit
7836bd7531
@ -18,6 +18,8 @@ type Activity struct {
|
||||
service core.IService
|
||||
modelhdList *modelHdList
|
||||
modelhdData *modelhdData
|
||||
|
||||
warorder comm.IWarorder // 战令
|
||||
}
|
||||
|
||||
func NewModule() core.IModule {
|
||||
@ -46,7 +48,15 @@ func (this *Activity) Init(service core.IService, module core.IModule, options c
|
||||
}
|
||||
func (this *Activity) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
//this.modelhdList.getHdInfoByHdId(10002)
|
||||
if rst, err := this.modelhdList.getHdInfoByHdId(10002); err == nil {
|
||||
// 服务启动 获取活动信息
|
||||
var module core.IModule
|
||||
if module, err = this.service.GetModule(comm.ModuleWarorder); err == nil {
|
||||
this.warorder = module.(comm.IWarorder)
|
||||
this.warorder.OpenWarorder(2, rst.Stime)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
func (this *Activity) OnInstallComp() {
|
||||
|
@ -16,7 +16,8 @@ func (this *apiComp) AtlasAwardCheck(session comm.IUserSession, req *pb.SmithyAt
|
||||
func (this *apiComp) AtlasAward(session comm.IUserSession, req *pb.SmithyAtlasAwardReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
res []*cfg.Gameatn
|
||||
respRes []*pb.UserAssets
|
||||
atno []*pb.UserAtno
|
||||
Res []*pb.UserAssets
|
||||
)
|
||||
if errdata = this.AtlasAwardCheck(session, req); errdata != nil {
|
||||
return // 参数校验失败直接返回
|
||||
@ -48,26 +49,17 @@ func (this *apiComp) AtlasAward(session comm.IUserSession, req *pb.SmithyAtlasAw
|
||||
}
|
||||
return
|
||||
}
|
||||
this.module.DispenseRes(session, res, true)
|
||||
|
||||
for _, v := range res {
|
||||
bFind := false
|
||||
for _, v1 := range respRes {
|
||||
|
||||
if v1.A == v.A && v1.T == v.T {
|
||||
v1.N += v.N
|
||||
bFind = true
|
||||
if errdata, atno = this.module.DispenseAtno(session, res, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
if !bFind {
|
||||
respRes = append(respRes, &pb.UserAssets{
|
||||
for _, v := range atno {
|
||||
Res = append(Res, &pb.UserAssets{
|
||||
A: v.A,
|
||||
T: v.T,
|
||||
N: v.N,
|
||||
})
|
||||
}
|
||||
}
|
||||
//修改数据
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["award"] = atlas.Award
|
||||
@ -75,7 +67,7 @@ func (this *apiComp) AtlasAward(session comm.IUserSession, req *pb.SmithyAtlasAw
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "atlasaward", &pb.SmithyAtlasAwardResp{
|
||||
Data: atlas,
|
||||
Res: respRes,
|
||||
Res: Res,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user