上传代码
This commit is contained in:
parent
25ff77cf73
commit
8f4a21e4cc
@ -81,7 +81,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AchieveAwardReq) (
|
||||
session.SendMsg(string(this.module.GetType()), "award", &pb.AchieveAwardResp{Id: req.Id, Award: atno})
|
||||
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "AchieveAwardReq", conf.TaskReward)
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "AchieveAwardReq", atno)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.ActivityGetRew
|
||||
})
|
||||
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "ActivityGetRewardReq", reward)
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "ActivityGetRewardReq", atno)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AddRechargeRecei
|
||||
conf *cfg.GameAccumulateData
|
||||
award []*pb.UserAssets
|
||||
err error
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
if errdata = this.ReceiveCheck(session, req); errdata != nil {
|
||||
return
|
||||
@ -59,7 +60,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AddRechargeRecei
|
||||
return
|
||||
}
|
||||
|
||||
if errdata = this.module.DispenseRes(session, conf.Reward, true); errdata != nil {
|
||||
if errdata, atno = this.module.DispenseAtno(session, conf.Reward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
award = make([]*pb.UserAssets, 0)
|
||||
@ -77,7 +78,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AddRechargeRecei
|
||||
session.SendMsg(string(this.module.GetType()), "receive", &pb.AddRechargeReceiveResp{Id: req.Id, Award: award})
|
||||
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "AddRechargeReceiveReq", award)
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "AddRechargeReceiveReq", atno)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeRe
|
||||
atns []*cfg.Gameatn = make([]*cfg.Gameatn, 0)
|
||||
award []*pb.UserAssets = make([]*pb.UserAssets, 0)
|
||||
err error
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
if errdata = this.ReceiveAllCheck(session, req); errdata != nil {
|
||||
return
|
||||
@ -63,7 +64,7 @@ func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeRe
|
||||
return
|
||||
}
|
||||
|
||||
if errdata = this.module.DispenseRes(session, atns, true); errdata != nil {
|
||||
if errdata, atno = this.module.DispenseAtno(session, atns, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
for _, v := range atns {
|
||||
@ -79,7 +80,7 @@ func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeRe
|
||||
})
|
||||
session.SendMsg(string(this.module.GetType()), "receiveall", &pb.AddRechargeReceiveAllResp{Record: info.Record, Award: award})
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "AddRechargeReceiveAllReq", award)
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "AddRechargeReceiveAllReq", atno)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
|
||||
need []*cfg.Gameatn
|
||||
maxbuy, vipbuy int32
|
||||
err error
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
if errdata = this.BuyCheck(session, req); errdata != nil {
|
||||
return
|
||||
@ -84,7 +85,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
|
||||
return
|
||||
}
|
||||
info.Buynum += req.BuyNum
|
||||
if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: req.BuyNum}}, true); errdata != nil {
|
||||
if errdata, atno = this.module.DispenseAtno(session, []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: req.BuyNum}}, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
// info.Ticket += req.BuyNum
|
||||
@ -99,7 +100,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
|
||||
session.SendMsg(string(this.module.GetType()), "buy", &pb.MoonfantasyBuyResp{Issucc: true, BattleNum: info.Buynum})
|
||||
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "MoonfantasyBuyReq", []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: req.BuyNum}})
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "MoonfantasyBuyReq", atno)
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResDelType, "MoonfantasyBuyReq", need) // 消耗资源
|
||||
})
|
||||
return
|
||||
|
@ -28,6 +28,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
|
||||
iswin bool
|
||||
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
|
||||
bReward bool
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
if errdata = this.ChallengeRewardCheck(session, req); errdata != nil {
|
||||
return
|
||||
@ -62,7 +63,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
|
||||
}
|
||||
return
|
||||
}
|
||||
if errdata = this.module.DispenseRes(session, reward.WinReward, true); errdata != nil {
|
||||
if errdata, atno = this.module.DispenseAtno(session, reward.WinReward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
bReward = true
|
||||
@ -289,7 +290,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.ModuleBuried.TriggerBuried(session, tasks...)
|
||||
if bReward {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "ArenaChallengeRewardReq", reward.WinReward)
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "ArenaChallengeRewardReq", atno)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -18,6 +18,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (er
|
||||
var (
|
||||
res []*cfg.Gameatn
|
||||
respRes []*pb.UserAssets
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
list, _ := this.module.modelPandaAtlas.getPandaAtlasList(session.GetUserId())
|
||||
for {
|
||||
@ -39,7 +40,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (er
|
||||
return
|
||||
}
|
||||
|
||||
if errdata = this.module.DispenseRes(session, res, true); errdata != nil {
|
||||
if errdata, atno = this.module.DispenseAtno(session, res, true); errdata != nil {
|
||||
buff, _ := json.Marshal(res)
|
||||
//data = &pb.ErrorData{Title: "图鉴奖励领取失败!", Datastring: string(buff)}
|
||||
errdata.Title = "图鉴奖励领取失败!"
|
||||
@ -73,7 +74,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (er
|
||||
Res: respRes,
|
||||
})
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "AtlasAwardReq", respRes)
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "AtlasAwardReq", atno)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.CanineRabbitAwardR
|
||||
session.SendMsg(string(this.module.GetType()), "award", &pb.CanineRabbitAwardResp{Type: req.Type, Awardmap: info.Award, Award: atno})
|
||||
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "CanineRabbitAwardReq", res)
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "CanineRabbitAwardReq", atno)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user