上传代码
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})
|
session.SendMsg(string(this.module.GetType()), "award", &pb.AchieveAwardResp{Id: req.Id, Award: atno})
|
||||||
|
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
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
|
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) {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AddRechargeRecei
|
|||||||
conf *cfg.GameAccumulateData
|
conf *cfg.GameAccumulateData
|
||||||
award []*pb.UserAssets
|
award []*pb.UserAssets
|
||||||
err error
|
err error
|
||||||
|
atno []*pb.UserAtno
|
||||||
)
|
)
|
||||||
if errdata = this.ReceiveCheck(session, req); errdata != nil {
|
if errdata = this.ReceiveCheck(session, req); errdata != nil {
|
||||||
return
|
return
|
||||||
@ -59,7 +60,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AddRechargeRecei
|
|||||||
return
|
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
|
return
|
||||||
}
|
}
|
||||||
award = make([]*pb.UserAssets, 0)
|
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})
|
session.SendMsg(string(this.module.GetType()), "receive", &pb.AddRechargeReceiveResp{Id: req.Id, Award: award})
|
||||||
|
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeRe
|
|||||||
atns []*cfg.Gameatn = make([]*cfg.Gameatn, 0)
|
atns []*cfg.Gameatn = make([]*cfg.Gameatn, 0)
|
||||||
award []*pb.UserAssets = make([]*pb.UserAssets, 0)
|
award []*pb.UserAssets = make([]*pb.UserAssets, 0)
|
||||||
err error
|
err error
|
||||||
|
atno []*pb.UserAtno
|
||||||
)
|
)
|
||||||
if errdata = this.ReceiveAllCheck(session, req); errdata != nil {
|
if errdata = this.ReceiveAllCheck(session, req); errdata != nil {
|
||||||
return
|
return
|
||||||
@ -63,7 +64,7 @@ func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeRe
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if errdata = this.module.DispenseRes(session, atns, true); errdata != nil {
|
if errdata, atno = this.module.DispenseAtno(session, atns, true); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, v := range atns {
|
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})
|
session.SendMsg(string(this.module.GetType()), "receiveall", &pb.AddRechargeReceiveAllResp{Record: info.Record, Award: award})
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
|
|||||||
need []*cfg.Gameatn
|
need []*cfg.Gameatn
|
||||||
maxbuy, vipbuy int32
|
maxbuy, vipbuy int32
|
||||||
err error
|
err error
|
||||||
|
atno []*pb.UserAtno
|
||||||
)
|
)
|
||||||
if errdata = this.BuyCheck(session, req); errdata != nil {
|
if errdata = this.BuyCheck(session, req); errdata != nil {
|
||||||
return
|
return
|
||||||
@ -84,7 +85,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
info.Buynum += req.BuyNum
|
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
|
return
|
||||||
}
|
}
|
||||||
// info.Ticket += req.BuyNum
|
// 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})
|
session.SendMsg(string(this.module.GetType()), "buy", &pb.MoonfantasyBuyResp{Issucc: true, BattleNum: info.Buynum})
|
||||||
|
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
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) // 消耗资源
|
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResDelType, "MoonfantasyBuyReq", need) // 消耗资源
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
@ -28,6 +28,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
|
|||||||
iswin bool
|
iswin bool
|
||||||
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
|
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
|
||||||
bReward bool
|
bReward bool
|
||||||
|
atno []*pb.UserAtno
|
||||||
)
|
)
|
||||||
if errdata = this.ChallengeRewardCheck(session, req); errdata != nil {
|
if errdata = this.ChallengeRewardCheck(session, req); errdata != nil {
|
||||||
return
|
return
|
||||||
@ -62,7 +63,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
|
|||||||
}
|
}
|
||||||
return
|
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
|
return
|
||||||
}
|
}
|
||||||
bReward = true
|
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) {
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
this.module.ModuleBuried.TriggerBuried(session, tasks...)
|
this.module.ModuleBuried.TriggerBuried(session, tasks...)
|
||||||
if bReward {
|
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 (
|
var (
|
||||||
res []*cfg.Gameatn
|
res []*cfg.Gameatn
|
||||||
respRes []*pb.UserAssets
|
respRes []*pb.UserAssets
|
||||||
|
atno []*pb.UserAtno
|
||||||
)
|
)
|
||||||
list, _ := this.module.modelPandaAtlas.getPandaAtlasList(session.GetUserId())
|
list, _ := this.module.modelPandaAtlas.getPandaAtlasList(session.GetUserId())
|
||||||
for {
|
for {
|
||||||
@ -39,7 +40,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (er
|
|||||||
return
|
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)
|
buff, _ := json.Marshal(res)
|
||||||
//data = &pb.ErrorData{Title: "图鉴奖励领取失败!", Datastring: string(buff)}
|
//data = &pb.ErrorData{Title: "图鉴奖励领取失败!", Datastring: string(buff)}
|
||||||
errdata.Title = "图鉴奖励领取失败!"
|
errdata.Title = "图鉴奖励领取失败!"
|
||||||
@ -73,7 +74,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (er
|
|||||||
Res: respRes,
|
Res: respRes,
|
||||||
})
|
})
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
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
|
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})
|
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) {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user