diff --git a/modules/academy/api_receive.go b/modules/academy/api_receive.go index 9e573c8be..588f59ff8 100644 --- a/modules/academy/api_receive.go +++ b/modules/academy/api_receive.go @@ -69,7 +69,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype151, 1)) + this.module.WriteUserLog(session.GetUserId(), "AcademyReceiveReq", level.Award) }) + } session.SendMsg(string(this.module.GetType()), "receive", &pb.AcademyReceiveResp{Issucc: true}) return diff --git a/modules/academy/api_teachingreceive.go b/modules/academy/api_teachingreceive.go index dbdebe468..c9962fb6a 100644 --- a/modules/academy/api_teachingreceive.go +++ b/modules/academy/api_teachingreceive.go @@ -65,6 +65,10 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT return } this.module.DispenseRes(session, level.Award, true) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "AcademyTeachingReceiveReq", level.Award) + }) } session.SendMsg(string(this.module.GetType()), "teachingreceive", &pb.AcademyTeachingReceiveResp{Issucc: true}) return diff --git a/modules/addrecharge/api_receive.go b/modules/addrecharge/api_receive.go index c2e032065..5ff97e3e5 100644 --- a/modules/addrecharge/api_receive.go +++ b/modules/addrecharge/api_receive.go @@ -75,5 +75,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AddRechargeRecei "record": info.Record, }) 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(), "AddRechargeReceiveReq", award) + }) return } diff --git a/modules/addrecharge/api_receiveall.go b/modules/addrecharge/api_receiveall.go index a7be3f2d3..dbe1b318a 100644 --- a/modules/addrecharge/api_receiveall.go +++ b/modules/addrecharge/api_receiveall.go @@ -78,5 +78,8 @@ func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeRe "record": info.Record, }) 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(), "AddRechargeReceiveAllReq", award) + }) return } diff --git a/modules/arena/api_buy.go b/modules/arena/api_buy.go index 62dfb7f61..a0fca42a6 100644 --- a/modules/arena/api_buy.go +++ b/modules/arena/api_buy.go @@ -97,5 +97,9 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat return } 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(), "MoonfantasyBuyReq", []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: req.BuyNum}}) + }) return } diff --git a/modules/arena/api_challengereward.go b/modules/arena/api_challengereward.go index e3f90bf5f..8f48fdb45 100644 --- a/modules/arena/api_challengereward.go +++ b/modules/arena/api_challengereward.go @@ -27,6 +27,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha err error iswin bool tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) + bReward bool ) if errdata = this.ChallengeRewardCheck(session, req); errdata != nil { return @@ -64,6 +65,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha if errdata = this.module.DispenseRes(session, reward.WinReward, true); errdata != nil { return } + bReward = true if req.Revengeid != "" { redstate = pb.BattleRecordState_RevengeSucceeded bulestate = pb.BattleRecordState_DefendLost @@ -286,6 +288,9 @@ 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(), "ArenaChallengeRewardReq", reward.WinReward) + } }) return diff --git a/modules/arena/api_plotreward.go b/modules/arena/api_plotreward.go index a04e19db5..320a7c123 100644 --- a/modules/arena/api_plotreward.go +++ b/modules/arena/api_plotreward.go @@ -26,6 +26,7 @@ func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewa info *pb.DBArenaUser iswin bool err error + atno []*pb.UserAtno ) if errdata = this.PlotRewardCheck(session, req); errdata != nil { @@ -65,11 +66,11 @@ func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewa } if info.Npc[req.Pid].Index != 0 { - if errdata = this.module.DispenseRes(session, npc.NpcReward, true); errdata != nil { + if errdata, atno = this.module.DispenseAtno(session, npc.NpcReward, true); errdata != nil { return } } else { - if errdata = this.module.DispenseRes(session, npc.NewNpcReward, true); errdata != nil { + if errdata, atno = this.module.DispenseAtno(session, npc.NewNpcReward, true); errdata != nil { return } } @@ -95,5 +96,9 @@ func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewa Issucc: true, Npc: info.Npc, }) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "ArenaPlotRewardReq", atno) + }) return } diff --git a/modules/atlas/api_atlasaward.go b/modules/atlas/api_atlasaward.go index 3bc7cd4b1..e3f6bd444 100644 --- a/modules/atlas/api_atlasaward.go +++ b/modules/atlas/api_atlasaward.go @@ -72,5 +72,8 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (er Data: list, Res: respRes, }) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "AtlasAwardReq", respRes) + }) return } diff --git a/modules/caravan/api_buyorsell.go b/modules/caravan/api_buyorsell.go index 0d09e4e87..5d5bc8efb 100644 --- a/modules/caravan/api_buyorsell.go +++ b/modules/caravan/api_buyorsell.go @@ -115,6 +115,9 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe if errdata = this.module.DispenseRes(session, addRes, true); errdata != nil { this.module.Errorf("获得虚拟币失败:%v", errdata) } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "troll sell", addRes) + }) this.module.ArrayBag(caravan) // 统计 收益 @@ -228,6 +231,13 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe }}, true); errdata != nil { this.module.Errorf("获得虚拟币失败:%v", errdata) } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "troll buy", []*cfg.Gameatn{{ + A: "attr", + T: "merchantmoney", + N: addScore, + }}) + }) } update["items"] = caravan.Items diff --git a/modules/caravan/module.go b/modules/caravan/module.go index acbdf9416..c0424556d 100644 --- a/modules/caravan/module.go +++ b/modules/caravan/module.go @@ -220,6 +220,10 @@ func (this *Caravan) InitCaravanTicket(session comm.IUserSession, conf *cfg.Game res = append(res, conf.Tickettop) res = append(res, conf.Moneynumtop) errdata = this.DispenseRes(session, res, true) // 推送门票和虚拟币资源 + + go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(session.GetUserId(), "InitCaravanTicket", res) + }) return } @@ -382,6 +386,9 @@ func (this *Caravan) TaskComplete(session comm.IUserSession, taskid ...int32) { this.Errorf("Caravan DispenseRes err:%v", conf.Reword) } session.SendMsg(string(this.GetType()), "taskcomplete", resp) + go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(session.GetUserId(), "TaskComplete", conf.Reword) + }) } } } diff --git a/modules/combat/api_ask.go b/modules/combat/api_ask.go index 3d699d708..f58f3ce29 100644 --- a/modules/combat/api_ask.go +++ b/modules/combat/api_ask.go @@ -23,6 +23,7 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda condis []*pb.ConIProgress ok bool err error + reward []*pb.UserAssets ) if errdata = this.AskCheck(session, req); errdata != nil { return @@ -97,6 +98,7 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda N: v.N, } } + reward = append(reward, atns...) pitem.Mainaward = atns } @@ -132,6 +134,7 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda N: v.N, } } + reward = append(reward, atns...) pitem.Peraward = atns } @@ -148,5 +151,9 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda } session.SendMsg(string(this.module.GetType()), "ask", &pb.CombatAskResp{Level: pitem}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "CombatAskReq", reward) + }) return } diff --git a/modules/combat/api_challengereceive.go b/modules/combat/api_challengereceive.go index bc0364457..a249ad4dc 100644 --- a/modules/combat/api_challengereceive.go +++ b/modules/combat/api_challengereceive.go @@ -99,7 +99,12 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC } return } + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "CombatChallengeReceiveReq", atns) + }) } session.SendMsg(string(this.module.GetType()), "challengereceive", &pb.CombatChallengeReceiveResp{Level: req.Level, Manster: req.Manster, Atns: atns}) + return } diff --git a/modules/combat/api_drop.go b/modules/combat/api_drop.go index 6e52c1d4d..c8e584e96 100644 --- a/modules/combat/api_drop.go +++ b/modules/combat/api_drop.go @@ -111,5 +111,8 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err } session.SendMsg(string(this.module.GetType()), "drop", &pb.CombatDropResp{Level: req.Level, Atns: atns}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "CombatDropReq", atns) + }) return } diff --git a/modules/dispatch/api_autoreceive.go b/modules/dispatch/api_autoreceive.go index 01f3fe301..395ef5c9e 100644 --- a/modules/dispatch/api_autoreceive.go +++ b/modules/dispatch/api_autoreceive.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) func (a *apiComp) AutoreceiveCheck(session comm.IUserSession, req *pb.DispatchAutoReceiveReq) (errdata *pb.ErrorData) { @@ -11,12 +12,13 @@ func (a *apiComp) AutoreceiveCheck(session comm.IUserSession, req *pb.DispatchAu } func (a *apiComp) Autoreceive(session comm.IUserSession, req *pb.DispatchAutoReceiveReq) (errdata *pb.ErrorData) { + var res []*cfg.Gameatn rsp := &pb.DispatchAutoReceiveResp{} d := a.module.modelDispatch.getDBDispatch(session.GetUserId()) if d == nil { errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DataNotFound, - Title: pb.ErrorCode_DataNotFound.ToString(), + Code: pb.ErrorCode_DataNotFound, + Title: pb.ErrorCode_DataNotFound.ToString(), } return } @@ -51,19 +53,25 @@ func (a *apiComp) Autoreceive(session comm.IUserSession, req *pb.DispatchAutoRec if err != nil { break } - a.module.DispenseRes(session, gd.Reward, true) - + //a.module.DispenseRes(session, gd.Reward, true) + res = append(res, gd.Reward...) rs := &pb.DispatchTaskRsp{ TaskId: t.TaskId, } if t.Exaward { rs.Exaward = t.Exaward - a.module.DispenseRes(session, gd.Rewardex, true) + res = append(res, gd.Rewardex...) + //a.module.DispenseRes(session, gd.Rewardex, true) } rss = append(rss, rs) } + a.module.DispenseRes(session, res, true) rsp.Task = rss session.SendMsg(string(a.module.GetType()), "autoreceive", rsp) + + go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + a.module.WriteUserLog(session.GetUserId(), "DispatchAutoReceiveReq", res) + }) return } diff --git a/modules/dispatch/api_notice.go b/modules/dispatch/api_notice.go index a4cfccfea..3855321d5 100644 --- a/modules/dispatch/api_notice.go +++ b/modules/dispatch/api_notice.go @@ -18,8 +18,8 @@ func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) ( d := a.module.modelDispatch.getDBDispatch(session.GetUserId()) if d == nil { errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DataNotFound, - Title: pb.ErrorCode_DataNotFound.ToString(), + Code: pb.ErrorCode_DataNotFound, + Title: pb.ErrorCode_DataNotFound.ToString(), } return } @@ -67,6 +67,10 @@ func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) ( add := limit - int32(left) atn := &cfg.Gameatn{A: "item", T: itemId, N: add} a.module.DispenseRes(session, []*cfg.Gameatn{atn}, true) + + go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + a.module.WriteUserLog(session.GetUserId(), "恢复门票", atn) + }) } } //周任务重置 diff --git a/modules/dispatch/api_receive.go b/modules/dispatch/api_receive.go index 67d0dcd6f..f3a6a30ae 100644 --- a/modules/dispatch/api_receive.go +++ b/modules/dispatch/api_receive.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) // 领取派遣奖励 @@ -19,6 +20,7 @@ func (a *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.DispatchReceiv } func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq) (errdata *pb.ErrorData) { + var res []*cfg.Gameatn if errdata = a.ReceiveCheck(session, req); errdata != nil { return } @@ -65,12 +67,13 @@ func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq) if err != nil { } - a.module.DispenseRes(session, gd.Reward, true) - + //a.module.DispenseRes(session, gd.Reward, true) + res = append(res, gd.Reward...) if oldTask.Exaward { - a.module.DispenseRes(session, gd.Rewardex, true) + res = append(res, gd.Rewardex...) + // a.module.DispenseRes(session, gd.Rewardex, true) } - + a.module.DispenseRes(session, res, true) //记录任务使用次数 if d.Completecount == nil { d.Completecount = make(map[int32]int32) @@ -90,5 +93,8 @@ func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq) } session.SendMsg(string(a.module.GetType()), "receive", rsp) + go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + a.module.WriteUserLog(session.GetUserId(), "DispatchReceiveReq", res) + }) return } diff --git a/modules/dispatch/api_week.go b/modules/dispatch/api_week.go index 8cff098cb..6db4b17c2 100644 --- a/modules/dispatch/api_week.go +++ b/modules/dispatch/api_week.go @@ -3,6 +3,7 @@ package dispatch import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) func (a *apiComp) WeekreciveCheck(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (errdata *pb.ErrorData) { @@ -16,6 +17,9 @@ func (a *apiComp) WeekreciveCheck(session comm.IUserSession, req *pb.DispatchWee } func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (errdata *pb.ErrorData) { + var ( + res []*cfg.Gameatn + ) if errdata = a.WeekreciveCheck(session, req); errdata != nil { return } @@ -24,8 +28,8 @@ func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReci d := a.module.modelDispatch.getDBDispatch(session.GetUserId()) if d == nil { errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DataNotFound, - Title: pb.ErrorCode_DataNotFound.ToString(), + Code: pb.ErrorCode_DataNotFound, + Title: pb.ErrorCode_DataNotFound.ToString(), } return } @@ -44,13 +48,20 @@ func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReci } return } - a.module.DispenseRes(session, v.G, true) + res = append(res, v.G...) + // a.module.DispenseRes(session, v.G, true) rsp.Idx = req.Idx break } } } + if len(res) > 0 { + a.module.DispenseRes(session, res, true) + go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + a.module.WriteUserLog(session.GetUserId(), "DispatchWeekReciveReq", res) + }) + } session.SendMsg(string(a.module.GetType()), "weekrecive", rsp) return } diff --git a/modules/enchant/api_challengeover.go b/modules/enchant/api_challengeover.go index 543e24fcc..727d54ebc 100644 --- a/modules/enchant/api_challengeover.go +++ b/modules/enchant/api_challengeover.go @@ -3,6 +3,7 @@ package enchant import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) //参数校验 @@ -23,6 +24,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha mapData map[string]interface{} bWin bool // 战斗是否胜利 score int32 // 通关获得分数 + res []*cfg.Gameatn ) mapData = make(map[string]interface{}, 0) // reward = make([]*cfg.Gameatn, 0) @@ -89,12 +91,18 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha if score >= v.ScoreLow && score <= v.ScoreUp { for _, v1 := range v.RewardDrop { reward := this.module.ModuleTools.GetGroupDataByLottery(v1, userinfo.Vip, userinfo.Lv) - if errdata = this.module.DispenseRes(session, reward, true); errdata != nil { - return - } + res = append(res, reward...) } } } + if len(res) > 0 { + if errdata = this.module.DispenseRes(session, res, true); errdata != nil { + return + } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "EnchantChallengeOverReq", res) + }) + } mapData["bossTime"] = enchant.BossTime mapData["boss"] = enchant.Boss diff --git a/modules/friend/api_cross_getreward.go b/modules/friend/api_cross_getreward.go index 31df92dcc..460fa3a31 100644 --- a/modules/friend/api_cross_getreward.go +++ b/modules/friend/api_cross_getreward.go @@ -60,5 +60,8 @@ func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewar session.SendMsg(string(this.module.GetType()), "getreward", rsp) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "FriendGetrewardReq", globalConf.FriendPeize) + }) return } diff --git a/modules/friend/api_cross_zan.go b/modules/friend/api_cross_zan.go index 34f5212a1..69eb240c0 100644 --- a/modules/friend/api_cross_zan.go +++ b/modules/friend/api_cross_zan.go @@ -133,6 +133,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (errda // 赠送X次友情点 go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype11, 1)) + this.module.WriteUserLog(session.GetUserId(), "FriendGetrewardReq", res) }) return } diff --git a/modules/gourmet/api_activateatlas.go b/modules/gourmet/api_activateatlas.go index 0c2c8af46..2d695cc89 100644 --- a/modules/gourmet/api_activateatlas.go +++ b/modules/gourmet/api_activateatlas.go @@ -61,5 +61,8 @@ func (this *apiComp) ActivateAtlas(session comm.IUserSession, req *pb.GourmetAct Atlas: _gourmet.Atlas, }) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "GourmetActivateAtlasReq", conf.Unlockreward) + }) return } diff --git a/modules/gourmet/api_createfood.go b/modules/gourmet/api_createfood.go index ccb8940a5..a1f8948e6 100644 --- a/modules/gourmet/api_createfood.go +++ b/modules/gourmet/api_createfood.go @@ -100,6 +100,7 @@ func (this *apiComp) CreateFood(session comm.IUserSession, req *pb.GourmetCreate }) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype150, 1)) + this.module.WriteUserLog(session.GetUserId(), "GourmetCreateFoodReq", atn) }) return } diff --git a/modules/guildgve/api_challengefinish.go b/modules/guildgve/api_challengefinish.go index e55422d2f..ce77c8387 100644 --- a/modules/guildgve/api_challengefinish.go +++ b/modules/guildgve/api_challengefinish.go @@ -205,5 +205,8 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve Score: score.Id, Boosticket: member.Boosticket, }) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "GuildGveChallengeFinishReq", award) + }) return } diff --git a/modules/guildgve/api_roulette.go b/modules/guildgve/api_roulette.go index 88e58917c..d98613851 100644 --- a/modules/guildgve/api_roulette.go +++ b/modules/guildgve/api_roulette.go @@ -71,5 +71,9 @@ func (this *apiComp) Roulette(session comm.IUserSession, req *pb.GuildGveRoulett go this.module.modelUnionroulette.roulettechangePush(req.Guildid, session.GetUserId(), user.Name, confs[index].Id, award) } session.SendMsg(string(this.module.GetType()), "roulette", &pb.GuildGveRouletteResp{Cid: confs[index].Id, Award: award}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "GuildGveRouletteReq", confs[index].Reward) + }) return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index ce4737087..a98d9d70f 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -116,6 +116,9 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr tasks = append(tasks, comm.GetBuriedParam(comm.Rtype115, 1, _hero.Star)) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, tasks...) + if len(starConf.Starup) > 0 { + this.module.WriteUserLog(session.GetUserId(), "HeroStrengthenUpStarReq", starConf.Starup) + } }) return } diff --git a/modules/hero/api_talentreset.go b/modules/hero/api_talentreset.go index 9bd84c1a8..2fa921804 100644 --- a/modules/hero/api_talentreset.go +++ b/modules/hero/api_talentreset.go @@ -72,6 +72,9 @@ func (this *apiComp) TalentReset(session comm.IUserSession, req *pb.HeroTalentRe if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil { this.module.Errorf("DispenseRes err,uid:%s,item:%v", session.GetUserId(), res) } // 返还升级的天赋点数 + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "HeroTalentResetReq", res) + }) } if len(_talent.Talent) > 0 { diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 1ec97099c..a1244a08c 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -867,6 +867,9 @@ func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, c } if len(res) > 0 { // 资源统一发放 this.module.DispenseRes(session, res, true) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "create hero", res) + }) } return } diff --git a/modules/herotask/api_receive.go b/modules/herotask/api_receive.go index a476f0777..84344f220 100644 --- a/modules/herotask/api_receive.go +++ b/modules/herotask/api_receive.go @@ -107,5 +107,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.HeroTaskReceiveR return } session.SendMsg(string(this.module.GetType()), "receive", &pb.HeroTaskReceiveResp{Hero: req.Hero, Stage: req.Stage, Award: award}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "HeroTaskReceiveReq", award) + }) + return } diff --git a/modules/horoscope/api_rest.go b/modules/horoscope/api_rest.go index ab9ef28b1..fbb9f4215 100644 --- a/modules/horoscope/api_rest.go +++ b/modules/horoscope/api_rest.go @@ -70,5 +70,9 @@ func (this *apiComp) Reset(session comm.IUserSession, req *pb.HoroscopeResetReq) return } session.SendMsg(string(this.module.GetType()), "reset", &pb.HoroscopeResetResp{Issucc: true, Info: info, Award: consume}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "HoroscopeResetReq", res) + }) + return } diff --git a/modules/items/api_potionsynthesis.go b/modules/items/api_potionsynthesis.go index 4a961dfc6..7679fc342 100644 --- a/modules/items/api_potionsynthesis.go +++ b/modules/items/api_potionsynthesis.go @@ -69,5 +69,10 @@ func (this *apiComp) PotionSynthesis(session comm.IUserSession, req *pb.ItemsPot return } session.SendMsg(string(this.module.GetType()), "potionsynthesis", &pb.ItemsPotionSynthesisResp{Succ: true, Id: req.Id, Num: req.Num}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "ItemsPotionSynthesisReq", give) + }) + return } diff --git a/modules/items/api_sellinbulk.go b/modules/items/api_sellinbulk.go index 908025670..5189521ce 100644 --- a/modules/items/api_sellinbulk.go +++ b/modules/items/api_sellinbulk.go @@ -86,5 +86,9 @@ func (this *apiComp) Sellinbulk(session comm.IUserSession, req *pb.ItemsSellinbu } this.module.itemsChangePush(session, items) session.SendMsg(string(this.module.GetType()), "sellitem", &pb.ItemsSellinbulkResp{Grids: req.Grids, Amount: req.Amount, Issucc: issucc}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "ItemsSellinbulkReq", sale) + }) return } diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index 8a3fd4691..07fb7e943 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -544,6 +544,10 @@ func (this *ModelItemsComp) buyTicket(session comm.IUserSession, buy int32) (inf "lasttimeunifiedticket": info.Lasttimeunifiedticket, "recovertimeunifiedticket": info.Recovertimeunifiedticket, }) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "buyTicket", res) + }) return } @@ -599,6 +603,9 @@ func (this *ModelItemsComp) recoverTicket(session comm.IUserSession) (errdata *p } this.module.DispenseRes(session, []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: ticketNum}}, true) info.Recovertimeunifiedticket = time.Unix(info.Recovertimeunifiedticket, 0).Add(time.Duration(ticketNum) * time.Minute).Unix() + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "recoverTicket", []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: ticketNum}}) + }) } } this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ diff --git a/modules/kftask/api_receive.go b/modules/kftask/api_receive.go index 9bb5f0d05..e92038001 100644 --- a/modules/kftask/api_receive.go +++ b/modules/kftask/api_receive.go @@ -103,5 +103,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.KFTaskReceiveReq "tasks": dtask.Tasks, }) session.SendMsg(string(this.module.GetType()), "receive", &pb.KFTaskReceiveResp{Id: req.Id, Award: award}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "KFTaskReceiveReq", award) + }) + return } diff --git a/modules/linestory/api_receive.go b/modules/linestory/api_receive.go index c98499272..539df42da 100644 --- a/modules/linestory/api_receive.go +++ b/modules/linestory/api_receive.go @@ -68,5 +68,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.LinestoryReceive UserAssets: utils.ConvertReward(conf.Reward...), } session.SendMsg(string(this.module.GetType()), LinestorySubTypeReceive, rsp) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "LinestoryReceiveReq", conf.Reward) + }) return } diff --git a/modules/mail/api_getAttachment.go b/modules/mail/api_getAttachment.go index 519b0e1c2..01bfcc1f5 100644 --- a/modules/mail/api_getAttachment.go +++ b/modules/mail/api_getAttachment.go @@ -18,7 +18,7 @@ func (this *apiComp) GetUserMailAttachmentCheck(session comm.IUserSession, req * // 领取附件 func (this *apiComp) GetUserMailAttachment(session comm.IUserSession, req *pb.MailGetUserMailAttachmentReq) (errdata *pb.ErrorData) { - + res := make([]*cfg.Gameatn, 0) if errdata = this.GetUserMailAttachmentCheck(session, req); errdata != nil { return } @@ -40,7 +40,7 @@ func (this *apiComp) GetUserMailAttachment(session comm.IUserSession, req *pb.Ma } if _data, err := this.module.modelMail.MailGetMailAttachment(req.ObjID); err == nil { if len(_data) > 0 { - res := make([]*cfg.Gameatn, 0) + for _, v := range _data { d := &cfg.Gameatn{ A: v.A, @@ -59,6 +59,10 @@ func (this *apiComp) GetUserMailAttachment(session comm.IUserSession, req *pb.Ma } session.SendMsg(string(this.module.GetType()), "getusermailattachment", &pb.MailGetUserMailAttachmentResp{Mail: mail}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "MailGetUserMailAttachmentReq", res) + }) return } diff --git a/modules/mainline/api_challengeover.go b/modules/mainline/api_challengeover.go index 299ac0029..c204fcce4 100644 --- a/modules/mainline/api_challengeover.go +++ b/modules/mainline/api_challengeover.go @@ -80,6 +80,10 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh session.SendMsg(string(this.module.GetType()), "challengeover", &pb.MainlineChallengeOverResp{ Level: req.Level, }) // 数据推送 + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "MainlineChallengeOverReq false", conf.PsConsume) + }) return } // 评星规则 diff --git a/modules/mainline/api_shopbuy.go b/modules/mainline/api_shopbuy.go index 6f4cf1270..32e1b7937 100644 --- a/modules/mainline/api_shopbuy.go +++ b/modules/mainline/api_shopbuy.go @@ -80,7 +80,7 @@ func (this *apiComp) ShopBuy(session comm.IUserSession, req *pb.MainlineShopBuyR return } if errdata, atno = this.module.DispenseAtno(session, shopConf.Itemsell, true); errdata != nil { - this.module.DispenseRes(session, shopConf.Need, true) + this.module.DispenseRes(session, shopConf.Need, true) // ????? return } this.module.modelShop.updateMainlineShopData(session.GetUserId(), info) diff --git a/modules/moonfantasy/api_receive.go b/modules/moonfantasy/api_receive.go index 00a60e59e..ad4f5fc29 100644 --- a/modules/moonfantasy/api_receive.go +++ b/modules/moonfantasy/api_receive.go @@ -43,12 +43,19 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.MoonfantasyRecei if errdata = this.module.ConsumeRes(session, boss.PsMg, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "MoonfantasyReceiveReq", boss.PsMg) + }) return } else { if errdata = this.module.ConsumeRes(session, boss.PsConsume, true); errdata != nil { return } this.module.DispenseRes(session, boss.Prize, true) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "MoonfantasyReceiveReq", boss.Prize) + }) } session.SendMsg(string(this.module.GetType()), "receive", &pb.MoonfantasyReceiveResp{Issucc: true}) diff --git a/modules/oldtimes/api_receive.go b/modules/oldtimes/api_receive.go index 5f325f622..275291714 100644 --- a/modules/oldtimes/api_receive.go +++ b/modules/oldtimes/api_receive.go @@ -3,6 +3,7 @@ package oldtimes import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.OldtimesReceiveReq) (errdata *pb.ErrorData) { @@ -16,6 +17,9 @@ func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.OldtimesRec } func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveReq) (errdata *pb.ErrorData) { + var ( + res []*cfg.Gameatn + ) if errdata = this.ReceiveCheck(session, req); errdata != nil { return } @@ -47,7 +51,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveR return } if conf, ok := gltl.GetDataMap()[req.ChapterId]; ok { - this.module.DispenseRes(session, conf.Reward, true) + res = append(res, conf.Reward...) + //this.module.DispenseRes(session, conf.Reward, true) } break } @@ -55,6 +60,13 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveR } } + if len(res) > 0 { + this.module.DispenseRes(session, res, true) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "OldtimesReceiveReq", res) + }) + } session.SendMsg(string(this.module.GetType()), "receive", rsp) + return } diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index bc921f585..97a295c41 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -192,6 +192,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleSys.CheckOpenCond(session, comm.OpencondTypePagoda, conf.Key) this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype168, pagoda.Data[conf.Tab], conf.Tab)) + this.module.WriteUserLog(session.GetUserId(), "PagodaChallengeOverReq", conf.Reward) }) return } diff --git a/modules/pay/modelActivity.go b/modules/pay/modelActivity.go index 1dabe2f39..1917a8e56 100644 --- a/modules/pay/modelActivity.go +++ b/modules/pay/modelActivity.go @@ -142,6 +142,9 @@ func (this *modelActivityComp) deliverybyid(session comm.IUserSession, id int32) if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "deliverybyid", conf.Item) + }) return } @@ -206,5 +209,8 @@ func (this *modelActivityComp) delivery(session comm.IUserSession, pid string) ( if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "delivery", conf.Item) + }) return } diff --git a/modules/pay/modelDaily.go b/modules/pay/modelDaily.go index 336656efe..ca3c21eb9 100644 --- a/modules/pay/modelDaily.go +++ b/modules/pay/modelDaily.go @@ -102,6 +102,9 @@ func (this *modelDailyComp) deliverybyid(session comm.IUserSession, id int32) (e if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "deliverybyid", conf.Item) + }) return } @@ -150,5 +153,8 @@ func (this *modelDailyComp) delivery(session comm.IUserSession, pid string) (err if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "delivery", conf.Item) + }) return } diff --git a/modules/pay/module.go b/modules/pay/module.go index 9629f9f88..5d54d3f60 100644 --- a/modules/pay/module.go +++ b/modules/pay/module.go @@ -208,6 +208,7 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.ModuleHero.RechargeMoney(args.Uid, args.Price) this.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype229, 1, conf.Pid)) + this.WriteUserLog(session.GetUserId(), "Rpc_ModulePayDelivery", res) }) return } @@ -314,7 +315,10 @@ func (this *Pay) ModulePayDelivery(session comm.IUserSession, Productid string, return } } - go this.ModuleHero.RechargeMoney(session.GetUserId(), conf.Amount) + go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(session.GetUserId(), "ModulePayDelivery", res) + this.ModuleHero.RechargeMoney(session.GetUserId(), conf.Amount) + }) return } diff --git a/modules/practice/api_unLock.go b/modules/practice/api_unLock.go index 369b83c56..7372a738a 100644 --- a/modules/practice/api_unLock.go +++ b/modules/practice/api_unLock.go @@ -3,6 +3,7 @@ package practice import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) // 参数校验 @@ -19,6 +20,7 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq pillar *pb.DBPracticePillar filed string tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) + res []*cfg.Gameatn ) if room, err = this.module.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil { errdata = &pb.ErrorData{ @@ -65,7 +67,8 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq } return } else { - if errdata = this.module.DispenseRes(session, pillarconfigure.PhotoGuideUnlocking, true); errdata != nil { + res = append(res, pillarconfigure.PhotoGuideUnlocking...) + if errdata = this.module.DispenseRes(session, res, true); errdata != nil { return } } @@ -78,6 +81,7 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, tasks...) + this.module.WriteUserLog(session.GetUserId(), "PracticeUnLockReq", res) }) return diff --git a/modules/privilege/module.go b/modules/privilege/module.go index 7c815dc71..06614b6e9 100644 --- a/modules/privilege/module.go +++ b/modules/privilege/module.go @@ -192,6 +192,9 @@ func (this *Privilege) Delivery(session comm.IUserSession, cId string) (errdata } // 推送 session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeBuyYuekaResp{Data: list}) + go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(session.GetUserId(), "PrivilegeBuyYuekaReq", items) + }) return } @@ -223,6 +226,9 @@ func (this *Privilege) RenewPrivilegeCard(session comm.IUserSession, cId string) break } session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeGetListResp{Data: list}) + go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(session.GetUserId(), "PrivilegeGetListReq", conf.DisposableReward) + }) } else { errdata = &pb.ErrorData{ Code: pb.ErrorCode_PrivilegeRenewTime, diff --git a/modules/pushgiftbag/module.go b/modules/pushgiftbag/module.go index ff9fc93bc..0b66e9502 100644 --- a/modules/pushgiftbag/module.go +++ b/modules/pushgiftbag/module.go @@ -96,6 +96,9 @@ func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdat "item": info.Item, }) session.SendMsg(string(this.GetType()), "chanage", &pb.PushGiftbagChanagePush{Item: info.Item}) + go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(session.GetUserId(), "PushGiftbagChanagePush", conf.Lbid) + }) return } diff --git a/modules/questionnaire/api_answer.go b/modules/questionnaire/api_answer.go index 897a3a58c..c8f77f70c 100644 --- a/modules/questionnaire/api_answer.go +++ b/modules/questionnaire/api_answer.go @@ -92,6 +92,9 @@ func (this *apiComp) Answer(session comm.IUserSession, req *pb.QuestionnaireAnsw }) } this.module.DispenseRes(session, groupconfig.Reward, true) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "QuestionnaireAnswerReq", groupconfig.Reward) + }) } tasks = append(tasks, comm.GetBuriedParam(comm.Rtype203, 1, req.Group)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype204, 1)) @@ -106,10 +109,10 @@ func (this *apiComp) Answer(session comm.IUserSession, req *pb.QuestionnaireAnsw } session.SendMsg(string(this.module.GetType()), "answer", &pb.QuestionnaireAnswerResp{Info: info.Group[req.Group], Group: req.Group, Complete: finish, Award: award}) - if len(tasks) > 0 { - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + if len(tasks) > 0 { this.module.ModuleBuried.TriggerBuried(session, tasks...) - }) - } + } + }) return } diff --git a/modules/reputation/module.go b/modules/reputation/module.go index fdc9df61a..6f08bad15 100644 --- a/modules/reputation/module.go +++ b/modules/reputation/module.go @@ -124,6 +124,9 @@ func (this *Reputation) Upgrade(session comm.IUserSession, raceType int32, fv in if err := this.modelReputation.updateDBReputation(uid, update); err == nil { this.DispenseRes(session, []*cfg.Gameatn{reward}, false) } + go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(session.GetUserId(), "ReputationUpgrade", reward) + }) } return c.ReputationLv diff --git a/modules/sociaty/api_cross_buy.go b/modules/sociaty/api_cross_buy.go index 0ae95f6f8..81edcc3fb 100644 --- a/modules/sociaty/api_cross_buy.go +++ b/modules/sociaty/api_cross_buy.go @@ -98,5 +98,8 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.SociatyBuyReq) (errd } session.SendMsg(string(this.module.GetType()), SociatySubTypeBuy, rsp) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "SociatyBuyReq", atn) + }) return } diff --git a/modules/stonehenge/api_bookaward.go b/modules/stonehenge/api_bookaward.go index 91383c457..353425dd4 100644 --- a/modules/stonehenge/api_bookaward.go +++ b/modules/stonehenge/api_bookaward.go @@ -93,5 +93,8 @@ func (this *apiComp) BookAward(session comm.IUserSession, req *pb.StonehengeBook } session.SendMsg(string(this.module.GetType()), "bookaward", &pb.StonehengeBookAwardResp{Btype: req.Btype, Stage: req.Stage, Award: award}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "StonehengeBookAwardReq", award) + }) return } diff --git a/modules/stonehenge/api_enterlevel.go b/modules/stonehenge/api_enterlevel.go index 9d5362fae..23064b80b 100644 --- a/modules/stonehenge/api_enterlevel.go +++ b/modules/stonehenge/api_enterlevel.go @@ -32,6 +32,7 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt err error szEvent []int32 roles []*pb.BattleRole + reward []*cfg.Gameatn ) update = make(map[string]interface{}) if errdata = this.EnterLevelCheck(session, req); errdata != nil { @@ -150,13 +151,15 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt T: strconv.Itoa(int(c.Value1)), N: c.Value2, } - if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil { - return - } + reward = append(reward, res) + } break } } + if errdata = this.module.DispenseRes(session, reward, true); errdata != nil { + return + } // stageid 赋值 stone.StageID = req.Stageid update["stageID"] = stone.StageID @@ -176,10 +179,13 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt } } - if len(tasks) > 0 { - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + if len(tasks) > 0 { this.module.ModuleBuried.TriggerBuried(session, tasks...) - }) - } + } + if len(reward) > 0 { + this.module.WriteUserLog(session.GetUserId(), "StonehengeEnterLevelReq", reward) + } + }) return } diff --git a/modules/stonehenge/api_event.go b/modules/stonehenge/api_event.go index 9e7fc2f79..7206fa37f 100644 --- a/modules/stonehenge/api_event.go +++ b/modules/stonehenge/api_event.go @@ -112,7 +112,7 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq } if lotteryward := this.module.ModuleTools.GetGroupDataByLottery(eventConf.Value1, user.Vip, user.Lv); len(lotteryward) > 0 { if errdata, reward = this.module.DispenseAtno(session, lotteryward, true); errdata != nil { - this.module.Debugf("Mline lotteryward DispenseRes err:+%v", lotteryward) + this.module.Debugf("DispenseAtno err:+%v", lotteryward) } } case EventType25: // buff 三选一 @@ -181,7 +181,7 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq } if lotteryward := this.module.ModuleTools.GetGroupDataByLottery(battleConf.RewardLottery, user.Vip, user.Lv); len(lotteryward) > 0 { if errdata, reward = this.module.DispenseAtno(session, lotteryward, true); errdata != nil { - this.module.Debugf("Mline lotteryward DispenseRes err:+%v", lotteryward) + this.module.Debugf("DispenseAtno err:+%v", lotteryward) } } } @@ -256,7 +256,7 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq if lotteryward := this.module.ModuleTools.GetGroupDataByLottery(eventConf.Value1, user.Vip, user.Lv); len(lotteryward) > 0 { if errdata, reward = this.module.DispenseAtno(session, lotteryward, true); errdata != nil { - this.module.Debugf("Mline lotteryward DispenseRes err:+%v", lotteryward) + this.module.Debugf("DispenseAtno err:+%v", lotteryward) } } stone.Rooms.Box[req.Eventid] += 1 // 更新宝箱进度 @@ -431,8 +431,8 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq T: strconv.Itoa(int(eventConf.Value2)), N: int32(n), } - if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{atn}, true); errdata != nil { - return + if errdata, reward = this.module.DispenseAtno(session, []*cfg.Gameatn{atn}, true); errdata != nil { + this.module.Debugf("DispenseAtno err:+%v", atn) } } } diff --git a/modules/stonehenge/api_taskreceive.go b/modules/stonehenge/api_taskreceive.go index f7b20bc38..721052acb 100644 --- a/modules/stonehenge/api_taskreceive.go +++ b/modules/stonehenge/api_taskreceive.go @@ -93,5 +93,11 @@ func (this *apiComp) TaskReceive(session comm.IUserSession, req *pb.StonehengeTa } session.SendMsg(string(this.module.GetType()), "taskreceive", &pb.StonehengeTaskReceiveResp{Task: info.Task, Award: award}) + if len(award) > 0 { + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "StonehengeTaskReceiveReq", award) + + }) + } return } diff --git a/modules/stonehenge/api_weekAward.go b/modules/stonehenge/api_weekAward.go index b00e783c2..ed6afc00d 100644 --- a/modules/stonehenge/api_weekAward.go +++ b/modules/stonehenge/api_weekAward.go @@ -92,5 +92,12 @@ func (this *apiComp) WeekAward(session comm.IUserSession, req *pb.StonehengeWeek } session.SendMsg(string(this.module.GetType()), "weekaward", &pb.StonehengeWeekAwardResp{Id: req.Id, Weeklyreward: info.Weeklyreward, Award: award}) + if len(award) > 0 { + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "StonehengeWeekAwardReq", award) + + }) + } + return } diff --git a/modules/storyline/api_complete.go b/modules/storyline/api_complete.go index 03845503f..6763762f5 100644 --- a/modules/storyline/api_complete.go +++ b/modules/storyline/api_complete.go @@ -188,5 +188,10 @@ func (this *apiComp) Complete(session comm.IUserSession, req *pb.StorylineComple "item": info.Item, }) session.SendMsg(string(this.module.GetType()), "complete", &pb.StorylineCompleteResp{Level: req.Level, Story: req.Story, Award: award}) + if len(award) > 0 { + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "StorylineCompleteReq", award) + }) + } return } diff --git a/modules/uigame/module.go b/modules/uigame/module.go index 3a2e0347e..1d1767018 100644 --- a/modules/uigame/module.go +++ b/modules/uigame/module.go @@ -87,6 +87,10 @@ func (this *UiGame) HDPSTodayConsum(uid string, ps int32) { N: conf.Itemget.N * sub, } this.DispenseRes(s, []*cfg.Gameatn{res}, true) + + go this.AsynHandleSession(s.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(s.GetUserId(), "HDPSTodayConsum", res) + }) } update["val"] = rst.Val @@ -135,6 +139,9 @@ func (this *UiGame) HDPSTodayConsum(uid string, ps int32) { N: conf.Itemget.N * sub, } this.DispenseRes(s, []*cfg.Gameatn{res}, true) + go this.AsynHandleSession(s.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(s.GetUserId(), "HDPSTodayConsum", res) + }) } update["val"] = rst.Val @@ -183,6 +190,9 @@ func (this *UiGame) HDPSTodayConsum(uid string, ps int32) { N: conf.Itemget.N * sub, } this.DispenseRes(s, []*cfg.Gameatn{res}, true) + go this.AsynHandleSession(s.Clone(), func(session comm.IUserSession) { + this.WriteUserLog(s.GetUserId(), "HDPSTodayConsum", res) + }) } update["val"] = rst.Val diff --git a/modules/user/api_deposit.go b/modules/user/api_deposit.go index 82649425e..f7da1c103 100644 --- a/modules/user/api_deposit.go +++ b/modules/user/api_deposit.go @@ -74,6 +74,8 @@ func (this *apiComp) Deposit(session comm.IUserSession, req *pb.UserDepositReq) N: atn.N, }, }) - + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "UserDepositReq", atn) + }) return } diff --git a/modules/user/api_puzzleaward.go b/modules/user/api_puzzleaward.go index b1b9742b4..9efe0580f 100644 --- a/modules/user/api_puzzleaward.go +++ b/modules/user/api_puzzleaward.go @@ -3,6 +3,7 @@ package user import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) //参数校验 @@ -17,6 +18,7 @@ func (this *apiComp) PuzzleAward(session comm.IUserSession, req *pb.UserPuzzleAw sign *pb.DBSign err error completeCount int32 + res []*cfg.Gameatn ) if sign, err = this.module.modelSign.GetUserSign(session.GetUserId()); err != nil { @@ -36,9 +38,10 @@ func (this *apiComp) PuzzleAward(session comm.IUserSession, req *pb.UserPuzzleAw } _data := this.module.configure.GetSignConf(req.Index, sign.Group) if _data != nil { // 发奖 - if errdata = this.module.DispenseRes(session, _data.Gamegift, true); errdata != nil { - return - } + res = append(res, _data.Gamegift...) + // if errdata = this.module.DispenseRes(session, _data.Gamegift, true); errdata != nil { + // return + // } } sign.Puzzle[req.Index] = 1 @@ -48,7 +51,11 @@ func (this *apiComp) PuzzleAward(session comm.IUserSession, req *pb.UserPuzzleAw } } if conf := this.module.configure.GetSignExtarConf(completeCount, sign.Group); conf != nil { - this.module.DispenseRes(session, conf.Extra, true) // 签到额外奖励 + //this.module.DispenseRes(session, conf.Extra, true) // 签到额外奖励 + res = append(res, conf.Extra...) + } + if errdata = this.module.DispenseRes(session, res, true); errdata != nil { + return } if err = this.module.modelSign.Change(session.GetUserId(), map[string]interface{}{ "puzzle": sign.Puzzle, @@ -63,5 +70,8 @@ func (this *apiComp) PuzzleAward(session comm.IUserSession, req *pb.UserPuzzleAw session.SendMsg(string(this.module.GetType()), "puzzleaward", &pb.UserPuzzleAwardResp{ Index: req.Index, }) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "UserPuzzleAwardReq", res) + }) return } diff --git a/modules/user/model_user.go b/modules/user/model_user.go index e13acd40f..909bc87fd 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -307,6 +307,7 @@ func (this *ModelUser) changelv(session comm.IUserSession, lv int32, exp int64, this.module.chat.SendSysChatToUser(session, comm.ChatSystem12, lv, 0, name) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypePlatlv, lv) + this.module.WriteUserLog(session.GetUserId(), "changelv", rewards) }) session.Push() diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index 872a043bb..52f2bf015 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -93,6 +93,9 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingChallengeOverResp{ Data: viking, }) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "VikingChallengeOverReq", vikingCfg.PsConsume) + }) return } diff --git a/modules/warorder/api_receive.go b/modules/warorder/api_receive.go index 38248537e..d0a058992 100644 --- a/modules/warorder/api_receive.go +++ b/modules/warorder/api_receive.go @@ -144,5 +144,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.WarorderReceiveR } session.SendMsg(string(this.module.GetType()), "receive", &pb.WarorderReceiveResp{Rtype: req.Rtype, Warorder: warorder, Dwarorder: dwarorder, Award: ads}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "WarorderReceiveReq", awards) + }) return } diff --git a/modules/weektask/api_activityreceive.go b/modules/weektask/api_activityreceive.go index 5c06615ca..c4863d05c 100644 --- a/modules/weektask/api_activityreceive.go +++ b/modules/weektask/api_activityreceive.go @@ -77,5 +77,8 @@ func (this *apiComp) ActivityReceive(session comm.IUserSession, req *pb.WeekTask "acomplete": info.Acomplete, }) session.SendMsg(string(this.module.GetType()), "activityreceive", &pb.WeekTaskActivityReceiveResp{Id: req.Id, Award: award}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "WeekTaskActivityReceiveReq", conf.Reword) + }) return } diff --git a/modules/weektask/api_receive.go b/modules/weektask/api_receive.go index 154bdaf7e..c5914ed3a 100644 --- a/modules/weektask/api_receive.go +++ b/modules/weektask/api_receive.go @@ -105,5 +105,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.WeekTaskReceiveR "tcomplete": info.Tcomplete, }) session.SendMsg(string(this.module.GetType()), "receive", &pb.WeekTaskReceiveResp{Tid: req.Tid, Activity: info.Activity, Tasks: info.Tasks, Progress: progress, Award: award}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "WeekTaskReceiveReq", award) + }) return } diff --git a/modules/wtask/api_accept.go b/modules/wtask/api_accept.go index 16ed49ff1..e132f12a0 100644 --- a/modules/wtask/api_accept.go +++ b/modules/wtask/api_accept.go @@ -109,5 +109,9 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.WTaskAcceptReq) ( } return } + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), "WTaskAcceptReq", conf.GetItem) + }) return }