道具获得消耗来源记录

This commit is contained in:
meixiongfeng 2023-11-10 10:27:32 +08:00
parent 7201854d7c
commit b344f1b983
46 changed files with 158 additions and 7 deletions

View File

@ -73,10 +73,15 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AchieveAwardReq) (
if errdata, atno = this.module.DispenseAtno(session, conf.TaskReward, true); errdata != nil {
return
}
info.Receive[req.Id] = true
this.module.model.Change(session.GetUserId(), map[string]interface{}{
"receive": info.Receive,
})
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(), "AchieveAwardReq", conf.TaskReward)
})
return
}

View File

@ -96,5 +96,9 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.ActivityGetRew
Data: data,
Atno: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ActivityGetRewardReq", reward)
})
return
}

View File

@ -61,5 +61,9 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.CanineRabbitAwardR
"award": info.Award,
})
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(), "CanineRabbitAwardReq", res)
})
return
}

View File

@ -70,5 +70,8 @@ func (this *apiComp) AllWeekReward(session comm.IUserSession, req *pb.Captureshe
return
}
session.SendMsg(string(this.module.GetType()), "allweekreward", &pb.CapturesheepAllWeekRewardResp{Weekreward: info.Weekreward, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepAllWeekRewardReq", award)
})
return
}

View File

@ -132,5 +132,9 @@ func (this *apiComp) Over(session comm.IUserSession, req *pb.CapturesheepOverReq
Dan: info.Dan,
Award: award,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepOverReq", award)
})
return
}

View File

@ -72,5 +72,9 @@ func (this *apiComp) WeekReward(session comm.IUserSession, req *pb.CapturesheepW
return
}
session.SendMsg(string(this.module.GetType()), "weekreward", &pb.CapturesheepWeekRewardResp{Id: req.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepWeekRewardReq", award)
})
return
}

View File

@ -97,5 +97,9 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.CaravanGetRewa
Reward: caravan.Reward,
Anto: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CaravanGetRewardReq", atno)
})
return
}

View File

@ -52,5 +52,9 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.CatchbugsAwardReq)
"award": info.Awards,
})
session.SendMsg(string(this.module.GetType()), "award", &pb.CatchbugsAwardResp{Awardmap: info.Awards, Award: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CatchbugsAwardReq", atno)
})
return
}

View File

@ -56,5 +56,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.DailytaskReceive
return
}
session.SendMsg(string(this.module.GetType()), "receive", &pb.DailytaskReceiveResp{Award: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "DailytaskReceiveReq", atno)
})
return
}

View File

@ -79,5 +79,9 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.DColorAwardReq) (e
"weektime": info.Weektime,
})
session.SendMsg(string(this.module.GetType()), "award", &pb.DColorAwardResp{Atype: req.Atype, Award: atno, Awardmap: awards})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "DColorAwardReq", atno)
})
return
}

View File

@ -170,6 +170,7 @@ func (this *apiComp) Train(session comm.IUserSession, req *pb.DragonTrainReq) (e
if curLv > preLv { // 升级后统计任务
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype235, dragon.Lv, utils.ToInt32(dragon.Dragonid)))
this.module.WriteUserLog(session.GetUserId(), "DragonTrainReq", atno)
})
}
return

View File

@ -33,5 +33,8 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.EgghuntAwardReq) (
}
session.SendMsg(string(this.module.GetType()), "info", &pb.EgghuntAwardResp{Id: req.Id, Award: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EgghuntAwardReq", atno)
})
return
}

View File

@ -86,5 +86,9 @@ func (this *apiComp) BoxReward(session comm.IUserSession, req *pb.EntertainBoxRe
Box: list.Box,
Reward: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EntertainBoxRewardReq", atno)
})
return
}

View File

@ -64,5 +64,9 @@ func (this *apiComp) Reward(session comm.IUserSession, req *pb.EntertainRewardRe
Data: list,
Reward: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EntertainRewardReq", atno)
})
return
}

View File

@ -581,6 +581,9 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) {
if errdata, atno = this.module.DispenseAtno(this.szSession[winindex], res, true); errdata != nil {
return
}
go this.module.AsynHandleSession(this.szSession[winindex], func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "xxlGame", atno)
})
this.szSession[winindex].Push()
}
}

View File

@ -109,5 +109,8 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.EquipmentSellReq) (
return
}
session.SendMsg(string(this.module.GetType()), "sell", &pb.EquipmentSellResp{IsSucc: true, Reward: reward})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EquipmentSellReq", reward)
})
return
}

View File

@ -416,6 +416,10 @@ func (this *Equipment) SellEquipments(session comm.IUserSession, equs []string)
if errdata = this.DelEquipments(session, equs, true); errdata != nil {
return
}
go func() {
this.WriteUserLog(session.GetUserId(), "SellEquipments", atno)
}()
return
}
@ -510,6 +514,9 @@ func (this *Equipment) RecycleEquipments(session comm.IUserSession, equs []strin
if errdata = this.DelEquipments(session, equs, true); errdata != nil {
return
}
go func() {
this.WriteUserLog(session.GetUserId(), "RecycleEquipments", atno)
}()
return
}

View File

@ -114,5 +114,9 @@ func (this *apiComp) Advreceive(session comm.IUserSession, req *pb.GrowtaskAdvRe
TaskType: req.TaskType,
Reward: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GrowtaskAdvReceiveReq", atno)
})
return
}

View File

@ -75,5 +75,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.GrowtaskReceiveR
TaskId: req.TaskId,
Reward: reward,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GrowtaskReceiveReq", reward)
})
return
}

View File

@ -370,5 +370,9 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
session.SendMsg(string(this.module.GetType()), DrawCard, rsp)
// 任务统计
this.module.SendTaskMsg(session, szStar, req.DrawCount, req.DrawType)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "HeroDrawCardReq", atno)
})
return
}

View File

@ -98,5 +98,9 @@ func (this *apiComp) PeachReward(session comm.IUserSession, req *pb.HeroPeachRew
}
rsp.Peach = heroRecord.Peach
session.SendMsg(string(this.module.GetType()), HeroPeachRewardReq, rsp)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "HeroPeachRewardReq", reward)
})
return
}

View File

@ -933,8 +933,9 @@ func (this *ModelHero) CheckDrawCardRes(session comm.IUserSession, drawConf *cfg
}
func (this *ModelHero) GetDrawCardReward(session comm.IUserSession, szCards []string) (wish *pb.UserAtno, szStar []int32, rsp []*pb.AtnoData, errdata *pb.ErrorData) {
for _, heroId := range szCards {
var reward []*cfg.Gameatn
for _, heroId := range szCards {
if c, err := this.module.configure.GetHeroConfig(heroId); err != nil {
szStar = append(szStar, c.Star) // 获得许愿石
var tmp *cfg.Gameatn
@ -962,10 +963,14 @@ func (this *ModelHero) GetDrawCardReward(session comm.IUserSession, szCards []st
T: heroId,
N: 1,
})
}
var atno []*pb.UserAtno
if errdata, atno = this.module.DispenseAtno(session, reward, true); errdata == nil {
rsp = append(rsp, &pb.AtnoData{Atno: atno})
}
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GetDrawCardReward", rsp)
})
return
}

View File

@ -204,6 +204,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype200, 1))
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "HuntingChallengeOverReq", szAtno)
})
return
}

View File

@ -91,5 +91,9 @@ func (this *apiComp) Complete(session comm.IUserSession, req *pb.IsLandCompleteR
"islands": info.Islands,
})
session.SendMsg(string(this.module.GetType()), "complete", &pb.IsLandCompleteResp{Level: req.Level, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "IsLandCompleteReq", award)
})
return
}

View File

@ -68,5 +68,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.IsLandReceiveReq
"payprogress": info.Payprogress,
})
session.SendMsg(string(this.module.GetType()), "receive", &pb.IsLandReceiveResp{Info: info, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "IsLandReceiveReq", award)
})
return
}

View File

@ -108,5 +108,8 @@ func (this *apiComp) BuyPhysical(session comm.IUserSession, req *pb.ItemsBuyPhys
"physicalbuyLasttime": user.PhysicalbuyLasttime,
})
session.SendMsg(string(this.module.GetType()), "buyphysical", &pb.ItemsBuyPhysicalResp{Issucc: true, PhysicalBuyNum: user.Physicalbuynum, Asets: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ItemsBuyPhysicalReq", atno)
})
return
}

View File

@ -90,5 +90,9 @@ func (this *apiComp) Decompose(session comm.IUserSession, req *pb.ItemsDecompose
return
}
session.SendMsg(string(this.module.GetType()), "decompose", &pb.ItemsDecomposeResp{GridId: req.GridId, Amount: req.Amount, Issucc: true, Asets: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ItemsDecomposeReq", atno)
})
return
}

View File

@ -72,5 +72,8 @@ func (this *apiComp) SellItem(session comm.IUserSession, req *pb.ItemsSellItemRe
return
}
session.SendMsg(string(this.module.GetType()), "sellitem", &pb.ItemsSellItemResp{GridId: req.GridId, Amount: req.Amount, Issucc: true, Asets: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ItemsSellItemReq", atno)
})
return
}

View File

@ -820,5 +820,9 @@ func (this *ModelItemsComp) useitem(session comm.IUserSession, gid string, amoun
}
return
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "useitem", atno)
})
return
}

View File

@ -364,6 +364,9 @@ func (this *Items) SellItem(session comm.IUserSession, items map[string]int32, b
if len(change) > 0 && bPush {
this.itemsChangePush(session, change) //推送道具背包变化
}
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.WriteUserLog(session.GetUserId(), "SellItem", atno)
})
return
}

View File

@ -90,5 +90,9 @@ func (this *apiComp) Reward(session comm.IUserSession, req *pb.JielongRewardReq)
Data: list,
Res: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "JielongRewardReq", atno)
})
return
}

View File

@ -106,5 +106,9 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
Data: _heroFetter,
Reward: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "LibraryGetStoryRewardReq", atno)
})
return
}

View File

@ -72,5 +72,8 @@ func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvReward
Data: _heroFetter,
Reward: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "LibraryLvRewardReq", atno)
})
return
}

View File

@ -119,5 +119,8 @@ func (this *apiComp) GetAllMailAttachment(session comm.IUserSession, req *pb.Mai
Reward: atno,
Ids: mailIds,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MailGetAllMailAttachmentReq", atno)
})
return
}

View File

@ -86,6 +86,8 @@ func (this *apiComp) BoosChallengeOver(session comm.IUserSession, req *pb.Mainli
Boosid: req.Boosid,
Reward: aeward,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineBoosChallengeOverReq", aeward)
})
return
}

View File

@ -193,6 +193,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.ModuleSys.CheckOpenCond(session, comm.OpencondTypeMaxmapid, req.Level)
this.module.WriteUserLog(session.GetUserId(), "MainlineChallengeOverReq", reward)
})
return
}

View File

@ -137,6 +137,7 @@ func (this *apiComp) LevelPass(session comm.IUserSession, req *pb.MainlineLevelP
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "MainlineLevelPassReq", aeward)
})
return
}

View File

@ -154,5 +154,9 @@ func (this *apiComp) ReceiveAward(session comm.IUserSession, req *pb.MainlineRec
Stage: req.Stage,
Reward: reward,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineReceiveAwardReq", reward)
})
return
}

View File

@ -92,6 +92,7 @@ func (this *apiComp) ShopBuy(session comm.IUserSession, req *pb.MainlineShopBuyR
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "MainlineShopBuyReq", atno)
})
return
}

View File

@ -94,5 +94,9 @@ func (this *apiComp) TaskChapteReward(session comm.IUserSession, req *pb.Mainlin
Task: dtask,
Award: award,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineTaskChapteRewardReq", award)
})
return
}

View File

@ -76,5 +76,9 @@ func (this *apiComp) TaskReceive(session comm.IUserSession, req *pb.MainlineTask
"tasks": dtask.Tasks,
})
session.SendMsg(string(this.module.GetType()), "taskreceive", &pb.MainlineTaskReceiveResp{Id: req.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineTaskReceiveReq", award)
})
return
}

View File

@ -902,7 +902,6 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea
this.Debugf("发放三消卡片资源资源: %v errdata: %v", xxl, errdata)
}
this.WriteUserLog(session.GetUserId(), "userlog", res)
return
}

View File

@ -67,6 +67,9 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.PagodaGetRewar
Data: pagoda,
Atno: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "PagodaGetRewardReq", atno)
})
}
return
}

View File

@ -188,6 +188,7 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "PagodaChallengeRaceOverReq", atno)
})
return
}

View File

@ -70,5 +70,8 @@ func (this *apiComp) AllWeekReward(session comm.IUserSession, req *pb.ParkourAll
return
}
session.SendMsg(string(this.module.GetType()), "allweekreward", &pb.CapturesheepAllWeekRewardResp{Weekreward: info.Weekreward, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepAllWeekRewardReq", award)
})
return
}

View File

@ -122,6 +122,8 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e
if len(tasks) > 0 {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
}
this.module.WriteUserLog(session.GetUserId(), "UserCreateReq", res)
})
return
}