资源明细整理

This commit is contained in:
meixiongfeng 2023-11-13 17:20:35 +08:00
parent 6ed182785c
commit 8227b25610
64 changed files with 333 additions and 46 deletions

View File

@ -69,7 +69,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe
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, comm.GetBuriedParam(comm.Rtype151, 1)) 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}) session.SendMsg(string(this.module.GetType()), "receive", &pb.AcademyReceiveResp{Issucc: true})
return return

View File

@ -65,6 +65,10 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT
return return
} }
this.module.DispenseRes(session, level.Award, true) 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}) session.SendMsg(string(this.module.GetType()), "teachingreceive", &pb.AcademyTeachingReceiveResp{Issucc: true})
return return

View File

@ -75,5 +75,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AddRechargeRecei
"record": info.Record, "record": info.Record,
}) })
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) {
this.module.WriteUserLog(session.GetUserId(), "AddRechargeReceiveReq", award)
})
return return
} }

View File

@ -78,5 +78,8 @@ func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeRe
"record": info.Record, "record": info.Record,
}) })
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) {
this.module.WriteUserLog(session.GetUserId(), "AddRechargeReceiveAllReq", award)
})
return return
} }

View File

@ -97,5 +97,9 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
return return
} }
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) {
this.module.WriteUserLog(session.GetUserId(), "MoonfantasyBuyReq", []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: req.BuyNum}})
})
return return
} }

View File

@ -27,6 +27,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
err error err error
iswin bool iswin bool
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
bReward bool
) )
if errdata = this.ChallengeRewardCheck(session, req); errdata != nil { if errdata = this.ChallengeRewardCheck(session, req); errdata != nil {
return 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 { if errdata = this.module.DispenseRes(session, reward.WinReward, true); errdata != nil {
return return
} }
bReward = true
if req.Revengeid != "" { if req.Revengeid != "" {
redstate = pb.BattleRecordState_RevengeSucceeded redstate = pb.BattleRecordState_RevengeSucceeded
bulestate = pb.BattleRecordState_DefendLost 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) { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...) this.module.ModuleBuried.TriggerBuried(session, tasks...)
if bReward {
this.module.WriteUserLog(session.GetUserId(), "ArenaChallengeRewardReq", reward.WinReward)
}
}) })
return return

View File

@ -26,6 +26,7 @@ func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewa
info *pb.DBArenaUser info *pb.DBArenaUser
iswin bool iswin bool
err error err error
atno []*pb.UserAtno
) )
if errdata = this.PlotRewardCheck(session, req); errdata != nil { 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 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 return
} }
} else { } 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 return
} }
} }
@ -95,5 +96,9 @@ func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewa
Issucc: true, Issucc: true,
Npc: info.Npc, Npc: info.Npc,
}) })
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ArenaPlotRewardReq", atno)
})
return return
} }

View File

@ -72,5 +72,8 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (er
Data: list, Data: list,
Res: respRes, Res: respRes,
}) })
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "AtlasAwardReq", respRes)
})
return return
} }

View File

@ -115,6 +115,9 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
if errdata = this.module.DispenseRes(session, addRes, true); errdata != nil { if errdata = this.module.DispenseRes(session, addRes, true); errdata != nil {
this.module.Errorf("获得虚拟币失败:%v", errdata) 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) this.module.ArrayBag(caravan)
// 统计 收益 // 统计 收益
@ -228,6 +231,13 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
}}, true); errdata != nil { }}, true); errdata != nil {
this.module.Errorf("获得虚拟币失败:%v", errdata) 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 update["items"] = caravan.Items

View File

@ -220,6 +220,10 @@ func (this *Caravan) InitCaravanTicket(session comm.IUserSession, conf *cfg.Game
res = append(res, conf.Tickettop) res = append(res, conf.Tickettop)
res = append(res, conf.Moneynumtop) res = append(res, conf.Moneynumtop)
errdata = this.DispenseRes(session, res, true) // 推送门票和虚拟币资源 errdata = this.DispenseRes(session, res, true) // 推送门票和虚拟币资源
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.WriteUserLog(session.GetUserId(), "InitCaravanTicket", res)
})
return return
} }
@ -382,6 +386,9 @@ func (this *Caravan) TaskComplete(session comm.IUserSession, taskid ...int32) {
this.Errorf("Caravan DispenseRes err:%v", conf.Reword) this.Errorf("Caravan DispenseRes err:%v", conf.Reword)
} }
session.SendMsg(string(this.GetType()), "taskcomplete", resp) session.SendMsg(string(this.GetType()), "taskcomplete", resp)
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.WriteUserLog(session.GetUserId(), "TaskComplete", conf.Reword)
})
} }
} }
} }

View File

@ -23,6 +23,7 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda
condis []*pb.ConIProgress condis []*pb.ConIProgress
ok bool ok bool
err error err error
reward []*pb.UserAssets
) )
if errdata = this.AskCheck(session, req); errdata != nil { if errdata = this.AskCheck(session, req); errdata != nil {
return return
@ -97,6 +98,7 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda
N: v.N, N: v.N,
} }
} }
reward = append(reward, atns...)
pitem.Mainaward = atns pitem.Mainaward = atns
} }
@ -132,6 +134,7 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda
N: v.N, N: v.N,
} }
} }
reward = append(reward, atns...)
pitem.Peraward = 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}) 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 return
} }

View File

@ -99,7 +99,12 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC
} }
return 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}) session.SendMsg(string(this.module.GetType()), "challengereceive", &pb.CombatChallengeReceiveResp{Level: req.Level, Manster: req.Manster, Atns: atns})
return return
} }

View File

@ -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}) 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 return
} }

View File

@ -4,6 +4,7 @@ import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
) )
func (a *apiComp) AutoreceiveCheck(session comm.IUserSession, req *pb.DispatchAutoReceiveReq) (errdata *pb.ErrorData) { 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) { func (a *apiComp) Autoreceive(session comm.IUserSession, req *pb.DispatchAutoReceiveReq) (errdata *pb.ErrorData) {
var res []*cfg.Gameatn
rsp := &pb.DispatchAutoReceiveResp{} rsp := &pb.DispatchAutoReceiveResp{}
d := a.module.modelDispatch.getDBDispatch(session.GetUserId()) d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
if d == nil { if d == nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_DataNotFound, Code: pb.ErrorCode_DataNotFound,
Title: pb.ErrorCode_DataNotFound.ToString(), Title: pb.ErrorCode_DataNotFound.ToString(),
} }
return return
} }
@ -51,19 +53,25 @@ func (a *apiComp) Autoreceive(session comm.IUserSession, req *pb.DispatchAutoRec
if err != nil { if err != nil {
break break
} }
a.module.DispenseRes(session, gd.Reward, true) //a.module.DispenseRes(session, gd.Reward, true)
res = append(res, gd.Reward...)
rs := &pb.DispatchTaskRsp{ rs := &pb.DispatchTaskRsp{
TaskId: t.TaskId, TaskId: t.TaskId,
} }
if t.Exaward { if t.Exaward {
rs.Exaward = 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) rss = append(rss, rs)
} }
a.module.DispenseRes(session, res, true)
rsp.Task = rss rsp.Task = rss
session.SendMsg(string(a.module.GetType()), "autoreceive", rsp) 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 return
} }

View File

@ -18,8 +18,8 @@ func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) (
d := a.module.modelDispatch.getDBDispatch(session.GetUserId()) d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
if d == nil { if d == nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_DataNotFound, Code: pb.ErrorCode_DataNotFound,
Title: pb.ErrorCode_DataNotFound.ToString(), Title: pb.ErrorCode_DataNotFound.ToString(),
} }
return return
} }
@ -67,6 +67,10 @@ func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) (
add := limit - int32(left) add := limit - int32(left)
atn := &cfg.Gameatn{A: "item", T: itemId, N: add} atn := &cfg.Gameatn{A: "item", T: itemId, N: add}
a.module.DispenseRes(session, []*cfg.Gameatn{atn}, true) a.module.DispenseRes(session, []*cfg.Gameatn{atn}, true)
go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
a.module.WriteUserLog(session.GetUserId(), "恢复门票", atn)
})
} }
} }
//周任务重置 //周任务重置

View File

@ -4,6 +4,7 @@ import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "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) { 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 { if errdata = a.ReceiveCheck(session, req); errdata != nil {
return return
} }
@ -65,12 +67,13 @@ func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq)
if err != nil { 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 { 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 { if d.Completecount == nil {
d.Completecount = make(map[int32]int32) 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) 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 return
} }

View File

@ -3,6 +3,7 @@ package dispatch
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
) )
func (a *apiComp) WeekreciveCheck(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (errdata *pb.ErrorData) { 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) { 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 { if errdata = a.WeekreciveCheck(session, req); errdata != nil {
return return
} }
@ -24,8 +28,8 @@ func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReci
d := a.module.modelDispatch.getDBDispatch(session.GetUserId()) d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
if d == nil { if d == nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_DataNotFound, Code: pb.ErrorCode_DataNotFound,
Title: pb.ErrorCode_DataNotFound.ToString(), Title: pb.ErrorCode_DataNotFound.ToString(),
} }
return return
} }
@ -44,13 +48,20 @@ func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReci
} }
return return
} }
a.module.DispenseRes(session, v.G, true) res = append(res, v.G...)
// a.module.DispenseRes(session, v.G, true)
rsp.Idx = req.Idx rsp.Idx = req.Idx
break 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) session.SendMsg(string(a.module.GetType()), "weekrecive", rsp)
return return
} }

View File

@ -3,6 +3,7 @@ package enchant
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "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{} mapData map[string]interface{}
bWin bool // 战斗是否胜利 bWin bool // 战斗是否胜利
score int32 // 通关获得分数 score int32 // 通关获得分数
res []*cfg.Gameatn
) )
mapData = make(map[string]interface{}, 0) mapData = make(map[string]interface{}, 0)
// reward = make([]*cfg.Gameatn, 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 { if score >= v.ScoreLow && score <= v.ScoreUp {
for _, v1 := range v.RewardDrop { for _, v1 := range v.RewardDrop {
reward := this.module.ModuleTools.GetGroupDataByLottery(v1, userinfo.Vip, userinfo.Lv) reward := this.module.ModuleTools.GetGroupDataByLottery(v1, userinfo.Vip, userinfo.Lv)
if errdata = this.module.DispenseRes(session, reward, true); errdata != nil { res = append(res, reward...)
return
}
} }
} }
} }
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["bossTime"] = enchant.BossTime
mapData["boss"] = enchant.Boss mapData["boss"] = enchant.Boss

View File

@ -60,5 +60,8 @@ func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewar
session.SendMsg(string(this.module.GetType()), "getreward", rsp) 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 return
} }

View File

@ -133,6 +133,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (errda
// 赠送X次友情点 // 赠送X次友情点
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, comm.GetBuriedParam(comm.Rtype11, 1)) this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype11, 1))
this.module.WriteUserLog(session.GetUserId(), "FriendGetrewardReq", res)
}) })
return return
} }

View File

@ -61,5 +61,8 @@ func (this *apiComp) ActivateAtlas(session comm.IUserSession, req *pb.GourmetAct
Atlas: _gourmet.Atlas, Atlas: _gourmet.Atlas,
}) })
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GourmetActivateAtlasReq", conf.Unlockreward)
})
return return
} }

View File

@ -100,6 +100,7 @@ func (this *apiComp) CreateFood(session comm.IUserSession, req *pb.GourmetCreate
}) })
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, comm.GetBuriedParam(comm.Rtype150, 1)) this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype150, 1))
this.module.WriteUserLog(session.GetUserId(), "GourmetCreateFoodReq", atn)
}) })
return return
} }

View File

@ -205,5 +205,8 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
Score: score.Id, Score: score.Id,
Boosticket: member.Boosticket, Boosticket: member.Boosticket,
}) })
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GuildGveChallengeFinishReq", award)
})
return return
} }

View File

@ -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) 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}) 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 return
} }

View File

@ -116,6 +116,9 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype115, 1, _hero.Star)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype115, 1, _hero.Star))
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 len(starConf.Starup) > 0 {
this.module.WriteUserLog(session.GetUserId(), "HeroStrengthenUpStarReq", starConf.Starup)
}
}) })
return return
} }

View File

@ -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 { if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil {
this.module.Errorf("DispenseRes err,uid:%s,item:%v", session.GetUserId(), res) 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 { if len(_talent.Talent) > 0 {

View File

@ -867,6 +867,9 @@ func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, c
} }
if len(res) > 0 { // 资源统一发放 if len(res) > 0 { // 资源统一发放
this.module.DispenseRes(session, res, true) 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 return
} }

View File

@ -107,5 +107,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.HeroTaskReceiveR
return return
} }
session.SendMsg(string(this.module.GetType()), "receive", &pb.HeroTaskReceiveResp{Hero: req.Hero, Stage: req.Stage, Award: award}) 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 return
} }

View File

@ -70,5 +70,9 @@ func (this *apiComp) Reset(session comm.IUserSession, req *pb.HoroscopeResetReq)
return return
} }
session.SendMsg(string(this.module.GetType()), "reset", &pb.HoroscopeResetResp{Issucc: true, Info: info, Award: consume}) 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 return
} }

View File

@ -69,5 +69,10 @@ func (this *apiComp) PotionSynthesis(session comm.IUserSession, req *pb.ItemsPot
return return
} }
session.SendMsg(string(this.module.GetType()), "potionsynthesis", &pb.ItemsPotionSynthesisResp{Succ: true, Id: req.Id, Num: req.Num}) 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 return
} }

View File

@ -86,5 +86,9 @@ func (this *apiComp) Sellinbulk(session comm.IUserSession, req *pb.ItemsSellinbu
} }
this.module.itemsChangePush(session, items) this.module.itemsChangePush(session, items)
session.SendMsg(string(this.module.GetType()), "sellitem", &pb.ItemsSellinbulkResp{Grids: req.Grids, Amount: req.Amount, Issucc: issucc}) 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 return
} }

View File

@ -544,6 +544,10 @@ func (this *ModelItemsComp) buyTicket(session comm.IUserSession, buy int32) (inf
"lasttimeunifiedticket": info.Lasttimeunifiedticket, "lasttimeunifiedticket": info.Lasttimeunifiedticket,
"recovertimeunifiedticket": info.Recovertimeunifiedticket, "recovertimeunifiedticket": info.Recovertimeunifiedticket,
}) })
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "buyTicket", res)
})
return 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) 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() 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{}{ this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{

View File

@ -103,5 +103,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.KFTaskReceiveReq
"tasks": dtask.Tasks, "tasks": dtask.Tasks,
}) })
session.SendMsg(string(this.module.GetType()), "receive", &pb.KFTaskReceiveResp{Id: req.Id, Award: award}) 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 return
} }

View File

@ -68,5 +68,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.LinestoryReceive
UserAssets: utils.ConvertReward(conf.Reward...), UserAssets: utils.ConvertReward(conf.Reward...),
} }
session.SendMsg(string(this.module.GetType()), LinestorySubTypeReceive, rsp) 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 return
} }

View File

@ -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) { 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 { if errdata = this.GetUserMailAttachmentCheck(session, req); errdata != nil {
return 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 _data, err := this.module.modelMail.MailGetMailAttachment(req.ObjID); err == nil {
if len(_data) > 0 { if len(_data) > 0 {
res := make([]*cfg.Gameatn, 0)
for _, v := range _data { for _, v := range _data {
d := &cfg.Gameatn{ d := &cfg.Gameatn{
A: v.A, 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}) 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 return
} }

View File

@ -80,6 +80,10 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
session.SendMsg(string(this.module.GetType()), "challengeover", &pb.MainlineChallengeOverResp{ session.SendMsg(string(this.module.GetType()), "challengeover", &pb.MainlineChallengeOverResp{
Level: req.Level, Level: req.Level,
}) // 数据推送 }) // 数据推送
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineChallengeOverReq false", conf.PsConsume)
})
return return
} }
// 评星规则 // 评星规则

View File

@ -80,7 +80,7 @@ func (this *apiComp) ShopBuy(session comm.IUserSession, req *pb.MainlineShopBuyR
return return
} }
if errdata, atno = this.module.DispenseAtno(session, shopConf.Itemsell, true); errdata != nil { 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 return
} }
this.module.modelShop.updateMainlineShopData(session.GetUserId(), info) this.module.modelShop.updateMainlineShopData(session.GetUserId(), info)

View File

@ -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 { if errdata = this.module.ConsumeRes(session, boss.PsMg, true); errdata != nil {
return return
} }
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MoonfantasyReceiveReq", boss.PsMg)
})
return return
} else { } else {
if errdata = this.module.ConsumeRes(session, boss.PsConsume, true); errdata != nil { if errdata = this.module.ConsumeRes(session, boss.PsConsume, true); errdata != nil {
return return
} }
this.module.DispenseRes(session, boss.Prize, true) 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}) session.SendMsg(string(this.module.GetType()), "receive", &pb.MoonfantasyReceiveResp{Issucc: true})

View File

@ -3,6 +3,7 @@ package oldtimes
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
) )
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.OldtimesReceiveReq) (errdata *pb.ErrorData) { 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) { 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 { if errdata = this.ReceiveCheck(session, req); errdata != nil {
return return
} }
@ -47,7 +51,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveR
return return
} }
if conf, ok := gltl.GetDataMap()[req.ChapterId]; ok { 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 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) session.SendMsg(string(this.module.GetType()), "receive", rsp)
return return
} }

View File

@ -192,6 +192,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleSys.CheckOpenCond(session, comm.OpencondTypePagoda, conf.Key) 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.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype168, pagoda.Data[conf.Tab], conf.Tab))
this.module.WriteUserLog(session.GetUserId(), "PagodaChallengeOverReq", conf.Reward)
}) })
return return
} }

View File

@ -142,6 +142,9 @@ func (this *modelActivityComp) deliverybyid(session comm.IUserSession, id int32)
if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil { if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil {
return return
} }
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "deliverybyid", conf.Item)
})
return 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 { if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil {
return return
} }
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "delivery", conf.Item)
})
return return
} }

View File

@ -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 { if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil {
return return
} }
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "deliverybyid", conf.Item)
})
return 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 { if errdata = this.module.DispenseRes(session, conf.Item, true); errdata != nil {
return return
} }
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "delivery", conf.Item)
})
return return
} }

View File

@ -208,6 +208,7 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleHero.RechargeMoney(args.Uid, args.Price) this.ModuleHero.RechargeMoney(args.Uid, args.Price)
this.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype229, 1, conf.Pid)) this.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype229, 1, conf.Pid))
this.WriteUserLog(session.GetUserId(), "Rpc_ModulePayDelivery", res)
}) })
return return
} }
@ -314,7 +315,10 @@ func (this *Pay) ModulePayDelivery(session comm.IUserSession, Productid string,
return 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 return
} }

View File

@ -3,6 +3,7 @@ package practice
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "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 pillar *pb.DBPracticePillar
filed string filed string
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
res []*cfg.Gameatn
) )
if room, err = this.module.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil { if room, err = this.module.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -65,7 +67,8 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq
} }
return return
} else { } 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 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) { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...) this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "PracticeUnLockReq", res)
}) })
return return

View File

@ -192,6 +192,9 @@ func (this *Privilege) Delivery(session comm.IUserSession, cId string) (errdata
} }
// 推送 // 推送
session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeBuyYuekaResp{Data: list}) 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 return
} }
@ -223,6 +226,9 @@ func (this *Privilege) RenewPrivilegeCard(session comm.IUserSession, cId string)
break break
} }
session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeGetListResp{Data: list}) 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 { } else {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_PrivilegeRenewTime, Code: pb.ErrorCode_PrivilegeRenewTime,

View File

@ -96,6 +96,9 @@ func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdat
"item": info.Item, "item": info.Item,
}) })
session.SendMsg(string(this.GetType()), "chanage", &pb.PushGiftbagChanagePush{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 return
} }

View File

@ -92,6 +92,9 @@ func (this *apiComp) Answer(session comm.IUserSession, req *pb.QuestionnaireAnsw
}) })
} }
this.module.DispenseRes(session, groupconfig.Reward, true) 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.Rtype203, 1, req.Group))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype204, 1)) 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}) 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...) this.module.ModuleBuried.TriggerBuried(session, tasks...)
}) }
} })
return return
} }

View File

@ -124,6 +124,9 @@ func (this *Reputation) Upgrade(session comm.IUserSession, raceType int32, fv in
if err := this.modelReputation.updateDBReputation(uid, update); err == nil { if err := this.modelReputation.updateDBReputation(uid, update); err == nil {
this.DispenseRes(session, []*cfg.Gameatn{reward}, false) 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 return c.ReputationLv

View File

@ -98,5 +98,8 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.SociatyBuyReq) (errd
} }
session.SendMsg(string(this.module.GetType()), SociatySubTypeBuy, rsp) 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 return
} }

View File

@ -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}) 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 return
} }

View File

@ -32,6 +32,7 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt
err error err error
szEvent []int32 szEvent []int32
roles []*pb.BattleRole roles []*pb.BattleRole
reward []*cfg.Gameatn
) )
update = make(map[string]interface{}) update = make(map[string]interface{})
if errdata = this.EnterLevelCheck(session, req); errdata != nil { 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)), T: strconv.Itoa(int(c.Value1)),
N: c.Value2, N: c.Value2,
} }
if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil { reward = append(reward, res)
return
}
} }
break break
} }
} }
if errdata = this.module.DispenseRes(session, reward, true); errdata != nil {
return
}
// stageid 赋值 // stageid 赋值
stone.StageID = req.Stageid stone.StageID = req.Stageid
update["stageID"] = stone.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...) this.module.ModuleBuried.TriggerBuried(session, tasks...)
}) }
} if len(reward) > 0 {
this.module.WriteUserLog(session.GetUserId(), "StonehengeEnterLevelReq", reward)
}
})
return return
} }

View File

@ -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 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 { 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 三选一 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 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 { 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 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 { 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 // 更新宝箱进度 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)), T: strconv.Itoa(int(eventConf.Value2)),
N: int32(n), N: int32(n),
} }
if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{atn}, true); errdata != nil { if errdata, reward = this.module.DispenseAtno(session, []*cfg.Gameatn{atn}, true); errdata != nil {
return this.module.Debugf("DispenseAtno err:+%v", atn)
} }
} }
} }

View File

@ -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}) 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 return
} }

View File

@ -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}) 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 return
} }

View File

@ -188,5 +188,10 @@ func (this *apiComp) Complete(session comm.IUserSession, req *pb.StorylineComple
"item": info.Item, "item": info.Item,
}) })
session.SendMsg(string(this.module.GetType()), "complete", &pb.StorylineCompleteResp{Level: req.Level, Story: req.Story, Award: award}) 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 return
} }

View File

@ -87,6 +87,10 @@ func (this *UiGame) HDPSTodayConsum(uid string, ps int32) {
N: conf.Itemget.N * sub, N: conf.Itemget.N * sub,
} }
this.DispenseRes(s, []*cfg.Gameatn{res}, true) 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 update["val"] = rst.Val
@ -135,6 +139,9 @@ func (this *UiGame) HDPSTodayConsum(uid string, ps int32) {
N: conf.Itemget.N * sub, N: conf.Itemget.N * sub,
} }
this.DispenseRes(s, []*cfg.Gameatn{res}, true) 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 update["val"] = rst.Val
@ -183,6 +190,9 @@ func (this *UiGame) HDPSTodayConsum(uid string, ps int32) {
N: conf.Itemget.N * sub, N: conf.Itemget.N * sub,
} }
this.DispenseRes(s, []*cfg.Gameatn{res}, true) 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 update["val"] = rst.Val

View File

@ -74,6 +74,8 @@ func (this *apiComp) Deposit(session comm.IUserSession, req *pb.UserDepositReq)
N: atn.N, N: atn.N,
}, },
}) })
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "UserDepositReq", atn)
})
return return
} }

View File

@ -3,6 +3,7 @@ package user
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "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 sign *pb.DBSign
err error err error
completeCount int32 completeCount int32
res []*cfg.Gameatn
) )
if sign, err = this.module.modelSign.GetUserSign(session.GetUserId()); err != nil { 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) _data := this.module.configure.GetSignConf(req.Index, sign.Group)
if _data != nil { // 发奖 if _data != nil { // 发奖
if errdata = this.module.DispenseRes(session, _data.Gamegift, true); errdata != nil { res = append(res, _data.Gamegift...)
return // if errdata = this.module.DispenseRes(session, _data.Gamegift, true); errdata != nil {
} // return
// }
} }
sign.Puzzle[req.Index] = 1 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 { 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{}{ if err = this.module.modelSign.Change(session.GetUserId(), map[string]interface{}{
"puzzle": sign.Puzzle, "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{ session.SendMsg(string(this.module.GetType()), "puzzleaward", &pb.UserPuzzleAwardResp{
Index: req.Index, Index: req.Index,
}) })
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "UserPuzzleAwardReq", res)
})
return return
} }

View File

@ -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) this.module.chat.SendSysChatToUser(session, comm.ChatSystem12, lv, 0, name)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypePlatlv, lv) this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypePlatlv, lv)
this.module.WriteUserLog(session.GetUserId(), "changelv", rewards)
}) })
session.Push() session.Push()

View File

@ -93,6 +93,9 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingChallengeOverResp{ session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingChallengeOverResp{
Data: viking, Data: viking,
}) })
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "VikingChallengeOverReq", vikingCfg.PsConsume)
})
return return
} }

View File

@ -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}) 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 return
} }

View File

@ -77,5 +77,8 @@ func (this *apiComp) ActivityReceive(session comm.IUserSession, req *pb.WeekTask
"acomplete": info.Acomplete, "acomplete": info.Acomplete,
}) })
session.SendMsg(string(this.module.GetType()), "activityreceive", &pb.WeekTaskActivityReceiveResp{Id: req.Id, Award: award}) 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 return
} }

View File

@ -105,5 +105,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.WeekTaskReceiveR
"tcomplete": info.Tcomplete, "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}) 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 return
} }

View File

@ -109,5 +109,9 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.WTaskAcceptReq) (
} }
return return
} }
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "WTaskAcceptReq", conf.GetItem)
})
return return
} }