This commit is contained in:
meixiongfeng 2023-09-12 18:32:17 +08:00
commit 482112158b
69 changed files with 817 additions and 538 deletions

View File

@ -66,7 +66,10 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe
} }
this.module.DispenseRes(session, level.Award, true) this.module.DispenseRes(session, level.Award, true)
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype151, 1))
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype151, 1))
})
} }
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

@ -26,6 +26,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
bulestate pb.BattleRecordState bulestate pb.BattleRecordState
err error err error
iswin bool iswin bool
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
if errdata = this.ChallengeRewardCheck(session, req); errdata != nil { if errdata = this.ChallengeRewardCheck(session, req); errdata != nil {
return return
@ -288,8 +289,13 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
return return
} }
} }
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype128, red.Integral))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype129, red.Dan))
session.SendMsg(string(this.module.GetType()), "challengereward", &pb.ArenaChallengeRewardResp{Issucc: true, Integral: info.Integral, Dan: info.Dan}) session.SendMsg(string(this.module.GetType()), "challengereward", &pb.ArenaChallengeRewardResp{Issucc: true, Integral: info.Integral, Dan: info.Dan})
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype128, red.Integral), comm.GetBuriedParam(comm.Rtype129, red.Dan))
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -134,9 +134,10 @@ func (this *Battle) CreateEveBattle(session comm.IUserSession, req *pb.BattleEVE
// 创建pve战斗 // 创建pve战斗
func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVEReq) (errdata *pb.ErrorData, record *pb.DBBattleRecord) { func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVEReq) (errdata *pb.ErrorData, record *pb.DBBattleRecord) {
var ( var (
conf *cfg.GameBattleReadyData conf *cfg.GameBattleReadyData
conn *db.DBConn conn *db.DBConn
err error err error
tasks []*pb.BuriedParam
) )
if !this.IsCross() { if !this.IsCross() {
conn, err = db.Local() conn, err = db.Local()
@ -177,7 +178,7 @@ func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVE
for _, v := range req.Format.Friendformat { for _, v := range req.Format.Friendformat {
if v != "" { if v != "" {
flag = true flag = true
go this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype108, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype108, 1))
break break
} }
} }
@ -186,8 +187,15 @@ func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVE
return return
} }
if flag { if flag {
go this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype12, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype12, 1))
} }
if len(tasks) > 0 {
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }
@ -316,9 +324,10 @@ func (this *Battle) CreateRtPvpBattle(req *pb.BattleRTPVPReq) (errdata *pb.Error
// 创建连续战斗 // 创建连续战斗
func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLPVEReq) (errdata *pb.ErrorData, record *pb.DBBattleRecord) { func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLPVEReq) (errdata *pb.ErrorData, record *pb.DBBattleRecord) {
var ( var (
conf *cfg.GameBattleReadyData conf *cfg.GameBattleReadyData
conn *db.DBConn conn *db.DBConn
err error err error
tasks []*pb.BuriedParam
) )
if !this.IsCross() { if !this.IsCross() {
conn, err = db.Local() conn, err = db.Local()
@ -352,7 +361,7 @@ func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLP
if v != "" { if v != "" {
flag = true flag = true
// this.ModuleBuried.SendToRtask(session, comm.Rtype108, 1) // this.ModuleBuried.SendToRtask(session, comm.Rtype108, 1)
go this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype108, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype108, 1))
break break
} }
} }
@ -368,8 +377,16 @@ func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLP
return return
} }
if flag { if flag {
go this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype12, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype12, 1))
} }
if len(tasks) > 0 {
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }
@ -486,6 +503,7 @@ func (this *Battle) CheckBattleReport(session comm.IUserSession, report *pb.Batt
reply *pb.BattleCheckResults reply *pb.BattleCheckResults
ctx context.Context ctx context.Context
err error err error
tasks []*pb.BuriedParam
) )
if report == nil { if report == nil {
iswin = false iswin = false
@ -514,8 +532,13 @@ func (this *Battle) CheckBattleReport(session comm.IUserSession, report *pb.Batt
} }
this.moonfantasy.Trigger(session, report) this.moonfantasy.Trigger(session, report)
for _, v := range report.Completetask { for _, v := range report.Completetask {
// this.ModuleBuried.SendToRtask(session, comm.Rtype157, int32(report.Info.Ptype), v) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype157, int32(report.Info.Ptype), v))
go this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype157, int32(report.Info.Ptype), v)) }
if len(tasks) > 0 {
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
if (report.WinSide == 1 && report.Info.RedCompId == session.GetUserId()) || (report.WinSide == 2 && report.Info.BlueCompId == session.GetUserId()) { if (report.WinSide == 1 && report.Info.RedCompId == session.GetUserId()) || (report.WinSide == 2 && report.Info.BlueCompId == session.GetUserId()) {

View File

@ -557,8 +557,8 @@ func (this *Buried) TriggerBuried(session comm.IUserSession, burieds ...*pb.Buri
} else { } else {
this.trigger(session, burieds...) this.trigger(session, burieds...)
} }
session.Push() // session.Push()
this.service.PutUserSession(session) // this.service.PutUserSession(session)
} }
func (this *Buried) trigger(session comm.IUserSession, burieds ...*pb.BuriedParam) { func (this *Buried) trigger(session comm.IUserSession, burieds ...*pb.BuriedParam) {

View File

@ -230,7 +230,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
}) })
// 任务统计 // 任务统计
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
if req.IsBuy { if req.IsBuy {
// 209购买指定城市的急需货物X个 // 209购买指定城市的急需货物X个
@ -238,7 +238,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
for _, v1 := range v.Exspecial { // 急需的货物 for _, v1 := range v.Exspecial { // 急需的货物
for k2, v2 := range req.Items { for k2, v2 := range req.Items {
if k2 == v1 { if k2 == v1 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype209, v2, k)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype209, v2, k))
break break
} }
} }
@ -247,11 +247,12 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
// szTask = append(szTask, comm.GetBuriedParam(comm.Rtype209, req.City, opCount)) // szTask = append(szTask, comm.GetBuriedParam(comm.Rtype209, req.City, opCount))
} else { // 卖 } else { // 卖
//向指定X城市贩卖货物贩卖货物价值需要X虚拟币以上 //向指定X城市贩卖货物贩卖货物价值需要X虚拟币以上
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype210, req.City, sellValue)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype210, req.City, sellValue))
// Rtype211 TaskType = 211 // 向指定X城市贩卖价值X虚拟币以上的对应城市急需货物 // Rtype211 TaskType = 211 // 向指定X城市贩卖价值X虚拟币以上的对应城市急需货物
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype211, req.City, sellSpValue)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype211, req.City, sellSpValue))
} }
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -128,8 +128,11 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity
resp.Newtask = bNewTask resp.Newtask = bNewTask
session.SendMsg(string(this.module.GetType()), "gotocity", resp) session.SendMsg(string(this.module.GetType()), "gotocity", resp)
// 任务统计 // 任务统计
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype212, req.City)) // 接取任务后,商队抵达指定城市 tasks = append(tasks, comm.GetBuriedParam(comm.Rtype212, req.City)) // 接取任务后,商队抵达指定城市
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -80,10 +80,11 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (errda
if msg.Ctype == pb.ChatType_Text { //过滤敏感词 if msg.Ctype == pb.ChatType_Text { //过滤敏感词
msg.Content = wordfilter.Replace(msg.Content, '*') msg.Content = wordfilter.Replace(msg.Content, '*')
} }
go func(_session comm.IUserSession) {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.modelChat.sendChatToWorld(msg, max_chat) this.module.modelChat.sendChatToWorld(msg, max_chat)
this.module.ModuleBuried.TriggerBuried(_session, comm.GetBuriedParam(comm.Rtype62, 1)) this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype62, 1))
}(session.Clone()) })
break break
case pb.ChatChannel_Union: case pb.ChatChannel_Union:
if msg.Ctype == pb.ChatType_Text { //过滤敏感词 if msg.Ctype == pb.ChatType_Text { //过滤敏感词
@ -120,10 +121,10 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (errda
return return
} }
msg.ChannelId = userexpand.Chatchannel //指定频道 msg.ChannelId = userexpand.Chatchannel //指定频道
go func() { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.modelChat.sendChatToCrossServer(msg, max_chat) this.module.modelChat.sendChatToCrossServer(msg, max_chat)
this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype106, 1)) this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype106, 1))
}() })
break break
default: default:
this.module.Errorf("不存在的聊天频道类型channel:%d ", req.Channel) this.module.Errorf("不存在的聊天频道类型channel:%d ", req.Channel)

View File

@ -83,8 +83,6 @@ func (this *apiComp) Do(session comm.IUserSession, req *pb.DispatchDoReq) (errda
return return
} }
rsp := &pb.DispatchDoResp{}
if err := this.module.modelDispatch.dispatch(session.GetUserId(), req.TaskId, req.HeroIds, d); err != nil { if err := this.module.modelDispatch.dispatch(session.GetUserId(), req.TaskId, req.HeroIds, d); err != nil {
var errCustom = new(comm.CustomError) var errCustom = new(comm.CustomError)
var code pb.ErrorCode var code pb.ErrorCode
@ -106,12 +104,15 @@ func (this *apiComp) Do(session comm.IUserSession, req *pb.DispatchDoReq) (errda
return return
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype186, 1))
//扣除门票 //扣除门票
this.module.ConsumeRes(session, []*cfg.Gameatn{ticketAtn}, true) this.module.ConsumeRes(session, []*cfg.Gameatn{ticketAtn}, true)
rsp.IsSucc = true session.SendMsg(string(this.module.GetType()), "do", &pb.DispatchDoResp{
session.SendMsg(string(this.module.GetType()), "do", rsp) IsSucc: true,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype186, 1))
})
return return
} }

View File

@ -111,8 +111,11 @@ func (this *apiComp) Ench(session comm.IUserSession, req *pb.EquipmentEnchReq) (
return return
} }
} }
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype94, 1)
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype94, 1))
session.SendMsg(string(this.module.GetType()), "ench", &pb.EquipmentEnchResp{Issucc: true, Equipment: equip}) session.SendMsg(string(this.module.GetType()), "ench", &pb.EquipmentEnchResp{Issucc: true, Equipment: equip})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype94, 1))
})
return return
} }

View File

@ -213,10 +213,12 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype42, equipNum, minstar)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype42, equipNum, minstar))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype5, equipNum, utils.ToInt32(hero.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype5, equipNum, utils.ToInt32(hero.HeroID)))
if len(tasks) > 0 {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
}
session.SendMsg(string(this.module.GetType()), "equip", &pb.EquipmentEquipResp{Equipments: updatequipment, Suits: suits}) session.SendMsg(string(this.module.GetType()), "equip", &pb.EquipmentEquipResp{Equipments: updatequipment, Suits: suits})
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype95, 1))
})
}
return return
} }

View File

@ -288,9 +288,13 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype96, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype96, 1))
} }
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype92, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype92, 1))
if len(tasks) > 0 {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
}
session.SendMsg(string(this.module.GetType()), "upgrade", &pb.EquipmentUpgradeResp{IsSucc: issucc, Equipment: modifyequipments}) session.SendMsg(string(this.module.GetType()), "upgrade", &pb.EquipmentUpgradeResp{IsSucc: issucc, Equipment: modifyequipments})
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype95, 1))
})
}
return return
} }

View File

@ -78,8 +78,11 @@ func (this *apiComp) Wash(session comm.IUserSession, req *pb.EquipmentWashReq) (
break break
} }
} }
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype95, 1)
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype95, 1))
session.SendMsg(string(this.module.GetType()), "wash", &pb.EquipmentWashResp{Eid: req.Eid, AdverbEntry: adverbEntry}) session.SendMsg(string(this.module.GetType()), "wash", &pb.EquipmentWashResp{Eid: req.Eid, AdverbEntry: adverbEntry})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype95, 1))
})
return return
} }

View File

@ -137,7 +137,9 @@ func (this *modelEquipmentComp) AddEquipments(session comm.IUserSession, cIds ma
//异步出发任务启动 //异步出发任务启动
if len(tasks) > 0 { if len(tasks) > 0 {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
if len(add) > 0 { if len(add) > 0 {

View File

@ -266,8 +266,10 @@ func (this *Equipment) AddEquipment(session comm.IUserSession, equip *pb.DB_Equi
} else if configure.Pos == 6 { } else if configure.Pos == 6 {
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype101, 1, configure.Color)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype101, 1, configure.Color))
} }
go this.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
this.equipmentsChangePush(session, []*pb.DB_Equipment{equip}) this.equipmentsChangePush(session, []*pb.DB_Equipment{equip})
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -171,15 +171,20 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (e
go this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypeFriend, int32(len(self.FriendIds))) go this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypeFriend, int32(len(self.FriendIds)))
// 拥有xx个好友 // 拥有xx个好友
// this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype10, int32(len(agreeIds))) // this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype10, int32(len(agreeIds)))
var sz []*pb.BuriedParam var tasks []*pb.BuriedParam
for _, v := range req.FriendIds { for _, v := range req.FriendIds {
sz = append(sz, comm.GetBuriedParam2(comm.Rtype10, v)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype10, v))
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), sz...)
resp := &pb.FriendAgreeResp{ resp := &pb.FriendAgreeResp{
Num: optNum, Num: optNum,
} }
session.SendMsg(string(this.module.GetType()), FriendSubTypeAgree, resp) session.SendMsg(string(this.module.GetType()), FriendSubTypeAgree, resp)
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -112,7 +112,8 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
} }
// 随机任务Rtype13 // 随机任务Rtype13
// this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype13, 1) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype13, 1)) this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype13, 1))
})
return return
} }

View File

@ -131,7 +131,8 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (errda
session.SendMsg(string(this.module.GetType()), FriendSubTypeZan, rsp) session.SendMsg(string(this.module.GetType()), FriendSubTypeZan, rsp)
// 赠送X次友情点 // 赠送X次友情点
// this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype11, 1) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype11, 1)) this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype11, 1))
})
return return
} }

View File

@ -94,6 +94,8 @@ func (this *apiComp) CreateFood(session comm.IUserSession, req *pb.GourmetCreate
Cid: curFood, Cid: curFood,
FirstGet: bFirst, FirstGet: bFirst,
}) })
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype150, 1)) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype150, 1))
})
return return
} }

View File

@ -101,15 +101,15 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (e
} else { } else {
this.module.Errorf("no found userdata uid:%s", session.GetUserId()) this.module.Errorf("no found userdata uid:%s", session.GetUserId())
} }
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype34, _hero.HeroID, _hero.JuexingLv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype34, _hero.HeroID, _hero.JuexingLv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype119, 1, utils.ToInt32(_hero.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype119, 1, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype118, _hero.Lv, _hero.JuexingLv)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype118, _hero.Lv, _hero.JuexingLv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype120, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype120, 1))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype122, _hero.JuexingLv, _hero.Star)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype122, _hero.JuexingLv, _hero.Star))
cfg, err := this.module.configure.GetHeroConfig(_hero.HeroID) cfg, err := this.module.configure.GetHeroConfig(_hero.HeroID)
if err == nil { if err == nil {
@ -127,13 +127,13 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (e
if this.module.configure.GetHeroTalentMaxLv(_hero.HeroID) == _l { if this.module.configure.GetHeroTalentMaxLv(_hero.HeroID) == _l {
bManAwaken = true bManAwaken = true
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype121, 1, cfg.Race)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype121, 1, cfg.Race))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype36, _hero.HeroID, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype36, _hero.HeroID, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv))
_, err = this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1) _, err = this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)
if err != nil { // 达到满级觉醒 if err != nil { // 达到满级觉醒
if _hero.Lv == this.module.configure.GetHeroMaxLv(_hero.Star) && bManAwaken { if _hero.Lv == this.module.configure.GetHeroMaxLv(_hero.Star) && bManAwaken {
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype38, _hero.HeroID)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype38, _hero.HeroID))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype37, _hero.HeroID, cfg.Color)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, _hero.HeroID, cfg.Color))
} }
} }
@ -145,6 +145,8 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (e
return return
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -128,9 +128,9 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
} }
// 推送 世界任务消息 // 推送 世界任务消息
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype52, 1, utils.ToInt32(_hero.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype52, 1, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype53, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype53, 1))
// 检查是不是满级技能 // 检查是不是满级技能
maxLv := true maxLv := true
@ -142,17 +142,19 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
} }
} }
if maxLv { if maxLv {
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype54, _hero.HeroID)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype54, _hero.HeroID))
//szTask = append(szTask, comm.GetBuriedParam(comm.Rtype57, 1)) //szTask = append(szTask, comm.GetBuriedParam(comm.Rtype57, 1))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype174, 1, _hero.Star)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype174, 1, _hero.Star))
} }
if cfg, err := this.module.configure.GetHeroConfig(_hero.HeroID); err == nil { if cfg, err := this.module.configure.GetHeroConfig(_hero.HeroID); err == nil {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype55, 1, cfg.Color)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype55, 1, cfg.Color))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype56, 1, 1, cfg.Job)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype56, 1, 1, cfg.Job))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype116, lvUpCount, cfg.Race)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype116, lvUpCount, cfg.Race))
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype117, lvUpCount, utils.ToInt32(_hero.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype117, lvUpCount, utils.ToInt32(_hero.HeroID)))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -101,19 +101,21 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
} }
// 推送 世界任务消息 // 推送 世界任务消息
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype6, _hero.Star, utils.ToInt32(_hero.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype6, _hero.Star, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype25, _hero.HeroID, _hero.Star)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype25, _hero.HeroID, _hero.Star))
if _hero.Star == 4 { if _hero.Star == 4 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype26, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype26, 1))
} else if _hero.Star == 5 { } else if _hero.Star == 5 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype27, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype27, 1))
} else if _hero.Star == 6 { } else if _hero.Star == 6 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype28, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype28, 1))
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype114, _hero.Star, utils.ToInt32(_hero.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype114, _hero.Star, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype115, 1, _hero.Star)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype115, 1, _hero.Star))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -188,35 +188,37 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe
// 查询英雄相关信息 // 查询英雄相关信息
if heroObj := this.module.QueryHeroByConfId(session.GetUserId(), talent.HeroId); heroObj != nil { if heroObj := this.module.QueryHeroByConfId(session.GetUserId(), talent.HeroId); heroObj != nil {
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype123, heroObj.HeroID, heroObj.Star)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype123, heroObj.HeroID, heroObj.Star))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype124, heroObj.HeroID)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype124, heroObj.HeroID))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype123, 1, int32(len(talent.Talent)), heroObj.Star)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype123, 1, int32(len(talent.Talent)), heroObj.Star))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype124, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype124, 1))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype125, 1, utils.ToInt32(heroObj.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype125, 1, utils.ToInt32(heroObj.HeroID)))
cfg, err := this.module.configure.GetHeroConfig(heroObj.HeroID) cfg, err := this.module.configure.GetHeroConfig(heroObj.HeroID)
if err == nil { if err == nil {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype126, 1, cfg.Race)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype126, 1, cfg.Race))
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype127, 1, heroObj.Star)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype127, 1, heroObj.Star))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype40, 1, int32(len(talent.Talent)))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype40, 1, int32(len(talent.Talent))))
_, err = this.module.configure.GetHeroAwakenConfig(heroObj.HeroID, heroObj.JuexingLv+1) _, err = this.module.configure.GetHeroAwakenConfig(heroObj.HeroID, heroObj.JuexingLv+1)
if err != nil { // 达到满级觉醒 if err != nil { // 达到满级觉醒
if heroObj.Lv == this.module.configure.GetHeroMaxLv(heroObj.Star) { if heroObj.Lv == this.module.configure.GetHeroMaxLv(heroObj.Star) {
if this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID) == int32(len(talent.Talent)) { if this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID) == int32(len(talent.Talent)) {
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype37, heroObj.HeroID, cfg.Color)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, heroObj.HeroID, cfg.Color))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype38, heroObj.HeroID)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype38, heroObj.HeroID))
} }
} }
} }
// 满回响 // 满回响
if this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID) == int32(len(talent.Talent)) { if this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID) == int32(len(talent.Talent)) {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype128, 1, cfg.Race)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype128, 1, cfg.Race))
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype199, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype199, 1))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
return return

View File

@ -478,120 +478,128 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex
} }
_data := this.module.configure.GetHeroLv(curLv) _data := this.module.configure.GetHeroLv(curLv)
if _data != nil { if _data == nil {
var maxExp int32 errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
}
return
}
var maxExp int32
maxExp = _data.Heroexp
if maxLv <= curLv && curExp >= maxExp { // 加经验之前校验是否达到最大等级
curAddExp = 0 // 已经满级的时候
//code = pb.ErrorCode_HeroMaxLv //
this.module.Debugf("英雄已经满级 不需要升级heroid:%s,addexp:%d", hero.Id, exp)
return
}
curExp += exp // 先把经验加上
for { // 死循环判断一键升级
if _data.Heroexp == 0 {
curAddExp = exp - (curExp - maxExp) // 减去超过部分的经验
curExp = 0
break
}
maxExp = _data.Heroexp maxExp = _data.Heroexp
if maxLv <= curLv && curExp >= maxExp { // 加经验之前校验是否达到最大等级 if maxLv <= curLv && curExp >= maxExp { // 设置最大经验和等级
curAddExp = 0 // 已经满级的时候 curAddExp = exp - (curExp - maxExp) // 减去超过部分的经验
//code = pb.ErrorCode_HeroMaxLv // curLv = maxLv
this.module.Debugf("英雄已经满级 不需要升级heroid:%s,addexp:%d", hero.Id, exp) curExp = maxExp
return break
} }
curExp += exp // 先把经验加上 if maxExp > curExp { // 经验不够升级则不能执行升级操作
for { // 死循环判断一键升级 break
if _data.Heroexp == 0 { } else { // 升级操作
curAddExp = exp - (curExp - maxExp) // 减去超过部分的经验 curExp -= maxExp
curExp = 0 curLv += 1 // 经验够了 那么等级+1
_data = this.module.configure.GetHeroLv(curLv)
if _data == nil { // 等级加失败了 回到原来的等级
curLv -= 1
break break
} }
maxExp = _data.Heroexp }
if maxLv <= curLv && curExp >= maxExp { // 设置最大经验和等级 }
curAddExp = exp - (curExp - maxExp) // 减去超过部分的经验
curLv = maxLv if curAddExp != 0 {
curExp = maxExp curAddExp = exp // 真正加的经验
break }
}
if maxExp > curExp { // 经验不够升级则不能执行升级操作 this.module.Debugf("add hero exp :old lv:%d,old exp:%d,new lv:%d,new exp:%d,addexp:%d", hero.Lv, hero.Exp, curLv, curExp, exp)
break update["lv"] = curLv
} else { // 升级操作 update["exp"] = curExp
curExp -= maxExp
curLv += 1 // 经验够了 那么等级+1 hero.Lv = curLv
_data = this.module.configure.GetHeroLv(curLv) hero.Exp = curExp
if _data == nil { // 等级加失败了 回到原来的等级 if curLv-preLv > 0 { // 升级了 统计任务
curLv -= 1 this.PropertyCompute(hero)
break update["property"] = hero.Property
} update["horoscopeProperty"] = hero.HoroscopeProperty
update["talentProperty"] = hero.TalentProperty
update["juexProperty"] = hero.JuexProperty
}
if model != nil {
if err := model.ChangeList(session.GetUserId(), hero.Id, update); err != nil {
this.module.Errorf("add hero exp failed ChangeList %v", err)
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
} }
} }
} else {
if curAddExp != 0 { if err := this.ChangeList(session.GetUserId(), hero.Id, update); err != nil {
curAddExp = exp // 真正加的经验 this.module.Errorf("add hero exp failed ChangeList %v", err)
} errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
this.module.Debugf("add hero exp :old lv:%d,old exp:%d,new lv:%d,new exp:%d,addexp:%d", hero.Lv, hero.Exp, curLv, curExp, exp) Title: pb.ErrorCode_DBError.ToString(),
update["lv"] = curLv Message: err.Error(),
update["exp"] = curExp
hero.Lv = curLv
hero.Exp = curExp
if curLv-preLv > 0 { // 升级了 统计任务
this.PropertyCompute(hero)
update["property"] = hero.Property
update["horoscopeProperty"] = hero.HoroscopeProperty
update["talentProperty"] = hero.TalentProperty
update["juexProperty"] = hero.JuexProperty
}
if model != nil {
if err := model.ChangeList(session.GetUserId(), hero.Id, update); err != nil {
this.module.Errorf("add hero exp failed ChangeList %v", err)
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
}
} else {
if err := this.ChangeList(session.GetUserId(), hero.Id, update); err != nil {
this.module.Errorf("add hero exp failed ChangeList %v", err)
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
} }
} }
}
if curLv-preLv > 0 { // 升级了 统计任务 if curLv-preLv > 0 { // 升级了 统计任务
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype147, utils.ToInt32(hero.HeroID), curLv-preLv)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype147, utils.ToInt32(hero.HeroID), curLv-preLv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype113, curLv)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype113, curLv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype4, hero.Lv, utils.ToInt32(hero.HeroID))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype4, hero.Lv, utils.ToInt32(hero.HeroID)))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype23, hero.HeroID, hero.Star, hero.Lv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype23, hero.HeroID, hero.Star, hero.Lv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype24, curLv-preLv)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype24, curLv-preLv))
// szTask = append(szTask, comm.GetBuriedParam(comm.Rtype29, 1, hero.Lv, utils.ToInt32(hero.HeroID))) // szTask = append(szTask, comm.GetBuriedParam(comm.Rtype29, 1, hero.Lv, utils.ToInt32(hero.HeroID)))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype23, hero.HeroID, hero.Star, hero.Lv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype23, hero.HeroID, hero.Star, hero.Lv))
if cfg, _ := this.module.configure.GetHeroConfig(hero.HeroID); cfg != nil { if cfg, _ := this.module.configure.GetHeroConfig(hero.HeroID); cfg != nil {
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype32, hero.HeroID, cfg.Color, hero.Lv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype32, hero.HeroID, cfg.Color, hero.Lv))
//xx英雄满级、共鸣、觉醒至最高状态 //xx英雄满级、共鸣、觉醒至最高状态
nextAwaken, _ := this.module.configure.GetHeroAwakenConfig(hero.HeroID, hero.JuexingLv+1) nextAwaken, _ := this.module.configure.GetHeroAwakenConfig(hero.HeroID, hero.JuexingLv+1)
if nextAwaken == nil { // 达到满级觉醒 if nextAwaken == nil { // 达到满级觉醒
if hero.Lv == this.module.configure.GetHeroMaxLv(hero.Star) { if hero.Lv == this.module.configure.GetHeroMaxLv(hero.Star) {
var _l int32 var _l int32
talent, err := this.module.modelTalent.GetHerotalent(session.GetUserId()) talent, err := this.module.modelTalent.GetHerotalent(session.GetUserId())
if err == nil { if err == nil {
for _, v := range talent { for _, v := range talent {
if v.HeroId == hero.HeroID { if v.HeroId == hero.HeroID {
_l = int32(len(v.Talent)) _l = int32(len(v.Talent))
break break
}
} }
} }
if this.module.configure.GetHeroTalentMaxLv(hero.HeroID) == _l { }
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype37, hero.HeroID, cfg.Color)) if this.module.configure.GetHeroTalentMaxLv(hero.HeroID) == _l {
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype38, hero.HeroID)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, hero.HeroID, cfg.Color))
} tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype38, hero.HeroID))
} }
} }
} }
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype111, hero.HeroID, hero.Lv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype112, 1, hero.Lv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype113, hero.Lv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype33, 1, 1, hero.Lv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype118, hero.Lv, hero.JuexingLv))
go this.module.passon.HeroUpLv(session.Clone(), hero.HeroID, curLv)
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
} }
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype111, hero.HeroID, hero.Lv))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype112, 1, hero.Lv))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype113, hero.Lv))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype33, 1, 1, hero.Lv))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype118, hero.Lv, hero.JuexingLv))
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.passon.HeroUpLv(session.Clone(), hero.HeroID, curLv)
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
return return
} }

View File

@ -92,9 +92,9 @@ func (this *Hero) Start() (err error) {
// 创建单个叠加英雄 // 创建单个叠加英雄
func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, num int32) (hero *pb.DBHero, bFirst bool, atno []*pb.UserAtno, errdata *pb.ErrorData) { func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, num int32) (hero *pb.DBHero, bFirst bool, atno []*pb.UserAtno, errdata *pb.ErrorData) {
var ( var (
err error err error
szTask []*pb.BuriedParam tasks []*pb.BuriedParam
cfg *cfg.GameHeroData cfg *cfg.GameHeroData
) )
if cfg, err = this.configure.GetHeroConfig(heroCfgId); err != nil { if cfg, err = this.configure.GetHeroConfig(heroCfgId); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -106,7 +106,7 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string,
hero, bFirst, atno, err = this.modelHero.createHero(session, heroCfgId, num) hero, bFirst, atno, err = this.modelHero.createHero(session, heroCfgId, num)
if err == nil && bFirst { if err == nil && bFirst {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype228, cfg.Star)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype228, cfg.Star))
return return
} }
if err != nil { if err != nil {
@ -116,10 +116,12 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string,
Message: err.Error(), Message: err.Error(),
} }
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype1, 1, utils.ToInt32(heroCfgId))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype1, 1, utils.ToInt32(heroCfgId)))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype30, heroCfgId, cfg.Color)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype30, heroCfgId, cfg.Color))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype31, num, cfg.Color)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype31, num, cfg.Color))
go this.ModuleBuried.TriggerBuried(session.Clone(), szTask...) go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }
@ -659,7 +661,7 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession, bTalent bool) (errdat
func (this *Hero) SendTaskMsg(session comm.IUserSession, szStar []int32, drawCount int32, drawtype int32) { func (this *Hero) SendTaskMsg(session comm.IUserSession, szStar []int32, drawCount int32, drawtype int32) {
// 任务统计 // 任务统计
var ( var (
szTask []*pb.BuriedParam tasks []*pb.BuriedParam
) )
if drawtype == comm.DrawCardType0 { //普通招募 if drawtype == comm.DrawCardType0 { //普通招募
@ -669,33 +671,35 @@ func (this *Hero) SendTaskMsg(session comm.IUserSession, szStar []int32, drawCou
sz[star]++ sz[star]++
} }
for k := range sz { for k := range sz {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype17, 1, k)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype17, 1, k))
} }
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype14, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype14, drawCount))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype18, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype18, drawCount))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype141, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype141, drawCount))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype143, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype143, drawCount))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype145, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype145, drawCount))
} else { // 阵营招募 } else { // 阵营招募
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype15, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype15, drawCount))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype19, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype19, drawCount))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype142, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype142, drawCount))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype144, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype144, drawCount))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype146, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype146, drawCount))
if drawCount == 10 { if drawCount == 10 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype91, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype91, 1))
} }
} }
for _, star := range szStar { for _, star := range szStar {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype16, star, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype16, star, 1))
} }
if drawCount == 10 { if drawCount == 10 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype90, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype90, 1))
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype89, drawCount)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype89, drawCount))
go this.ModuleBuried.TriggerBuried(session.Clone(), szTask...) go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid []string, fulllvenr int32) (errdata *pb.ErrorData) { func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid []string, fulllvenr int32) (errdata *pb.ErrorData) {

View File

@ -20,6 +20,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.HoroscopeUpgrade
front *cfg.GameHoroscopeData front *cfg.GameHoroscopeData
ok bool ok bool
err error err error
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
if errdata = this.UpgradeCheck(session, req); errdata != nil { if errdata = this.UpgradeCheck(session, req); errdata != nil {
return return
@ -72,7 +73,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.HoroscopeUpgrade
} }
info.Nodes[conf.NodeId] = conf.Lv + 1 info.Nodes[conf.NodeId] = conf.Lv + 1
if info.Nodes[conf.NodeId] == 1 { //解锁 if info.Nodes[conf.NodeId] == 1 { //解锁
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype173, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype173, 1))
} }
for _, v := range conf.CostItem { for _, v := range conf.CostItem {
@ -102,5 +103,11 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.HoroscopeUpgrade
} }
session.SendMsg(string(this.module.GetType()), "upgrade", &pb.HoroscopeUpgradeResp{Nid: conf.NodeId, Lv: conf.Lv + 1}) session.SendMsg(string(this.module.GetType()), "upgrade", &pb.HoroscopeUpgradeResp{Nid: conf.NodeId, Lv: conf.Lv + 1})
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -200,6 +200,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype83, 1, req.BossType, req.Difficulty)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype83, 1, req.BossType, req.Difficulty))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype202, consumPs)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype202, consumPs))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype200, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype200, 1))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -234,7 +234,9 @@ func (this *Items) AddItems(session comm.IUserSession, items map[string]int32, b
} }
} }
if len(tasks) > 0 { if len(tasks) > 0 {
go this.ModuleBuried.TriggerBuried(session.Clone(), tasks...) go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
return return
} }

View File

@ -30,6 +30,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
likeStates int32 // 0 普通食物 1 喜欢 2 不喜欢 likeStates int32 // 0 普通食物 1 喜欢 2 不喜欢
addExp int32 // 获得的经验 addExp int32 // 获得的经验
sCount int32 // 赠送开始次数 sCount int32 // 赠送开始次数
tasks []*pb.BuriedParam
) )
attenuation = make(map[int32]int32, 0) attenuation = make(map[int32]int32, 0)
if errdata = this.UseGiftCheck(session, req); errdata != nil { if errdata = this.UseGiftCheck(session, req); errdata != nil {
@ -190,12 +191,15 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
return return
} }
} }
var szTask []*pb.BuriedParam tasks = append(tasks, comm.GetBuriedParam(comm.Rtype132, 1, _heroObj.Favorlv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype132, 1, _heroObj.Favorlv)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype133, _heroObj.Favorlv, utils.ToInt32(_heroObj.Heroid)))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype133, _heroObj.Favorlv, utils.ToInt32(_heroObj.Heroid))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype134, upLv))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype134, upLv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype132, _heroObj.Heroid, _heroObj.Favorlv))
szTask = append(szTask, comm.GetBuriedParam2(comm.Rtype132, _heroObj.Heroid, _heroObj.Favorlv)) }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
return return

View File

@ -180,7 +180,10 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype60, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype60, 1))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype61, 1, int32(req.Level))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype61, 1, int32(req.Level)))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
go this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypeMaxmapid, req.Level) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.ModuleSys.CheckOpenCond(session, comm.OpencondTypeMaxmapid, req.Level)
})
return return
} }

View File

@ -132,6 +132,9 @@ func (this *apiComp) LevelPass(session comm.IUserSession, req *pb.MainlineLevelP
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype60, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype60, 1))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype61, 1, int32(req.Level))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype61, 1, int32(req.Level)))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -256,8 +256,10 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
} }
} }
} }
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype160, allStar)
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype160, allStar, stageConf.Chapterid)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype160, allStar, stageConf.Chapterid))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -851,3 +851,10 @@ func (this *ModuleBase) FormatRes(res []*cfg.Gameatn) (ret []*cfg.Gameatn) {
} }
return return
} }
//异步调用用户处理流
func (this *ModuleBase) AsynHandleSession(session comm.IUserSession, handle func(session comm.IUserSession)) {
handle(session)
session.Push()
this.PutUserSession(session)
}

View File

@ -133,6 +133,8 @@ func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattle
Tasks: record.Tasks, Tasks: record.Tasks,
}, },
}) })
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype88, 1)) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype88, 1))
})
return return
} }

View File

@ -135,7 +135,9 @@ func (this *modelDreamComp) trigger(session comm.IUserSession) {
this.module.modelDream.noticeuserfriend(session, mdata.Id, chat) this.module.modelDream.noticeuserfriend(session, mdata.Id, chat)
session.SendMsg(string(this.module.GetType()), "trigger", &pb.MoonfantasyTriggerPush{Issucc: true, Mid: mdata.Id, Monster: mdata.Monster}) session.SendMsg(string(this.module.GetType()), "trigger", &pb.MoonfantasyTriggerPush{Issucc: true, Mid: mdata.Id, Monster: mdata.Monster})
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype87, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype87, 1)
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype87, 1)) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype87, 1))
})
return return
} }
@ -188,8 +190,9 @@ func (this *modelDreamComp) triggerbyid(session comm.IUserSession, boosid string
} }
this.module.modelDream.noticeuserfriend(session, mdata.Id, chat) this.module.modelDream.noticeuserfriend(session, mdata.Id, chat)
session.SendMsg(string(this.module.GetType()), "trigger", &pb.MoonfantasyTriggerPush{Issucc: true, Mid: mdata.Id, Monster: mdata.Monster}) session.SendMsg(string(this.module.GetType()), "trigger", &pb.MoonfantasyTriggerPush{Issucc: true, Mid: mdata.Id, Monster: mdata.Monster})
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype87, 1) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype87, 1)) this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype87, 1))
})
return return
} }

View File

@ -182,13 +182,15 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
this.module.SetPagodaRankList("pagodaList"+strconv.Itoa(int(newData.PagodaId)), pagoda.PagodaId, newData.Id) this.module.SetPagodaRankList("pagodaList"+strconv.Itoa(int(newData.PagodaId)), pagoda.PagodaId, newData.Id)
} }
go this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypePagoda, conf.Key)
// 通关奖励 // 通关奖励
errdata = this.module.DispenseRes(session, conf.Reward, true) errdata = this.module.DispenseRes(session, conf.Reward, true)
if errdata != nil { if errdata != nil {
return return
} }
// 任务相关
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype168, pagoda.Data[conf.Tab], conf.Tab)) 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))
})
return return
} }

View File

@ -179,12 +179,14 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
this.module.SetRacePagodaRankList("race"+strconv.Itoa(int(conf.Restriction)), race.Race[conf.Restriction].Curfloor, session.GetUserId(), newData.Id) this.module.SetRacePagodaRankList("race"+strconv.Itoa(int(conf.Restriction)), race.Race[conf.Restriction].Curfloor, session.GetUserId(), newData.Id)
} }
// 任务相关 // 任务相关
var sz []*pb.BuriedParam var tasks []*pb.BuriedParam
sz = append(sz, comm.GetBuriedParam(comm.Rtype232, conf.Restriction, conf.Floors)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype232, conf.Restriction, conf.Floors))
if conf.Restriction >= 10 { if conf.Restriction >= 10 {
sz = append(sz, comm.GetBuriedParam(comm.Rtype231, conf.Floors)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype231, conf.Floors))
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), sz...) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -200,11 +200,11 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
return return
} }
} }
go func(_session comm.IUserSession) {
this.ModuleHero.RechargeMoney(args.Uid, args.Price)
this.ModuleBuried.TriggerBuried(_session, comm.GetBuriedParam(comm.Rtype229, 1, conf.Pid))
}(session.Clone())
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))
})
return return
} }

View File

@ -132,6 +132,9 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.PracticeAcceptReq
this.module.SendMsgToUser(string(this.module.GetType()), "qiecuonotify", this.module.SendMsgToUser(string(this.module.GetType()), "qiecuonotify",
&pb.PracticeQiecuonotifyPush{Uid: session.GetUserId(), NotifyType: 2}, req.Uid) &pb.PracticeQiecuonotifyPush{Uid: session.GetUserId(), NotifyType: 2}, req.Uid)
_session, _ := this.module.GetUserSession(req.Uid) _session, _ := this.module.GetUserSession(req.Uid)
go this.module.ModuleBuried.TriggerBuried(_session.Clone(), comm.GetBuriedParam(comm.Rtype183, 1))
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(_session.Clone(), comm.GetBuriedParam(comm.Rtype183, 1))
})
return return
} }

View File

@ -21,6 +21,7 @@ func (this *apiComp) GetGymBuff(session comm.IUserSession, req *pb.PracticeGetGy
buff *cfg.GamePandamasBuffData buff *cfg.GamePandamasBuffData
room *pb.DBPracticeRoom room *pb.DBPracticeRoom
award []*pb.UserAssets award []*pb.UserAssets
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
err error err error
) )
@ -40,7 +41,6 @@ func (this *apiComp) GetGymBuff(session comm.IUserSession, req *pb.PracticeGetGy
} }
return return
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype185, 1))
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{
@ -67,7 +67,10 @@ func (this *apiComp) GetGymBuff(session comm.IUserSession, req *pb.PracticeGetGy
"lastgymtime": room.Lastgymtime, "lastgymtime": room.Lastgymtime,
}) })
} }
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype185, 1))
session.SendMsg(string(this.module.GetType()), "getgymbuff", &pb.PracticeGetGymBuffResp{Buffid: buff.Id, Award: award}) session.SendMsg(string(this.module.GetType()), "getgymbuff", &pb.PracticeGetGymBuffResp{Buffid: buff.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -16,8 +16,9 @@ func (this *apiComp) GymInfoCheck(session comm.IUserSession, req *pb.PracticeGym
// /获取每日一练信息 // /获取每日一练信息
func (this *apiComp) GymInfo(session comm.IUserSession, req *pb.PracticeGymInfoReq) (errdata *pb.ErrorData) { func (this *apiComp) GymInfo(session comm.IUserSession, req *pb.PracticeGymInfoReq) (errdata *pb.ErrorData) {
var ( var (
err error err error
room *pb.DBPracticeRoom room *pb.DBPracticeRoom
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
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{
@ -33,7 +34,11 @@ func (this *apiComp) GymInfo(session comm.IUserSession, req *pb.PracticeGymInfoR
"gymrefresh": room.Gymrefresh, "gymrefresh": room.Gymrefresh,
}) })
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype185, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype185, 1))
session.SendMsg(string(this.module.GetType()), "gyminfo", &pb.PracticeGymInfoResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh}) session.SendMsg(string(this.module.GetType()), "gyminfo", &pb.PracticeGymInfoResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -23,7 +23,8 @@ func (this *apiComp) Loot(session comm.IUserSession, req *pb.PracticeLootReq) (e
pillarconfigure *cfg.GamePandamasMzData pillarconfigure *cfg.GamePandamasMzData
tconfigure *cfg.GamePandamasJxData tconfigure *cfg.GamePandamasJxData
pconfigure *cfg.GamePandamasJxData pconfigure *cfg.GamePandamasJxData
extra int32 = 0 tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
extra int32 = 0
) )
if froom, err = this.module.modelPandata.queryUserMartialhall(req.Friend); err != nil { if froom, err = this.module.modelPandata.queryUserMartialhall(req.Friend); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -125,7 +126,12 @@ func (this *apiComp) Loot(session comm.IUserSession, req *pb.PracticeLootReq) (e
} else { } else {
this.module.PutUserSession(_session) this.module.PutUserSession(_session)
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype184, 1))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype184, 1))
session.SendMsg(string(this.module.GetType()), "loot", &pb.PracticeLootResp{Friend: req.Friend, Pillar: froom.Pillarf}) session.SendMsg(string(this.module.GetType()), "loot", &pb.PracticeLootResp{Friend: req.Friend, Pillar: froom.Pillarf})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -16,9 +16,10 @@ func (this *apiComp) NPCBattkleFinishCheck(session comm.IUserSession, req *pb.Pr
// /npc 战斗结果请求 // /npc 战斗结果请求
func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.PracticeNPCBattkleFinishReq) (errdata *pb.ErrorData) { func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.PracticeNPCBattkleFinishReq) (errdata *pb.ErrorData) {
var ( var (
err error err error
room *pb.DBPracticeRoom room *pb.DBPracticeRoom
conf *cfg.GameDispatch_BattleData conf *cfg.GameDispatch_BattleData
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
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{
@ -58,8 +59,7 @@ func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.Practic
"npcstate": room.Npcstate, "npcstate": room.Npcstate,
"refresh": room.Refresh, "refresh": room.Refresh,
}) })
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype182, 1))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype182, 1))
} else { } else {
room.Npcstate = 1 room.Npcstate = 1
room.Battlenum++ room.Battlenum++
@ -87,5 +87,9 @@ func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.Practic
} }
session.SendMsg(string(this.module.GetType()), "npcbattklefinish", &pb.PracticeNPCBattkleFinishResp{Issucc: true}) session.SendMsg(string(this.module.GetType()), "npcbattklefinish", &pb.PracticeNPCBattkleFinishResp{Issucc: true})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -29,6 +29,7 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
pconfigure *cfg.GamePandamasJxData pconfigure *cfg.GamePandamasJxData
extra int32 = 0 extra int32 = 0
filed string filed string
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
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{
@ -234,7 +235,11 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
"knapsack": room.Knapsack, "knapsack": room.Knapsack,
filed: pillar, filed: pillar,
}) })
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype149, 1))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype149, 1))
session.SendMsg(string(this.module.GetType()), "practice", &pb.PracticePracticeResp{Pillar: pillar}) session.SendMsg(string(this.module.GetType()), "practice", &pb.PracticePracticeResp{Pillar: pillar})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -34,6 +34,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
exp1 int32 exp1 int32
ants1 []*cfg.Gameatn ants1 []*cfg.Gameatn
ants2 []*cfg.Gameatn ants2 []*cfg.Gameatn
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
if req.Friend != "" { if req.Friend != "" {
if froom, err = this.module.modelPandata.queryUserMartialhall(req.Friend); err != nil { if froom, err = this.module.modelPandata.queryUserMartialhall(req.Friend); err != nil {
@ -295,7 +296,11 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
this.module.PutUserSession(_session) this.module.PutUserSession(_session)
} }
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype135, minutes)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype135, minutes))
session.SendMsg(string(this.module.GetType()), "receive", &pb.PracticeReceiveResp{Pillar: pillar, Knapsack: room.Knapsack}) session.SendMsg(string(this.module.GetType()), "receive", &pb.PracticeReceiveResp{Pillar: pillar, Knapsack: room.Knapsack})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -18,6 +18,7 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq
room *pb.DBPracticeRoom room *pb.DBPracticeRoom
pillar *pb.DBPracticePillar pillar *pb.DBPracticePillar
filed string filed string
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
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{
@ -72,7 +73,12 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq
filed: pillar, filed: pillar,
"pillarf": room.Pillarf, "pillarf": room.Pillarf,
}) })
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype152, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype152, 1))
session.SendMsg(string(this.module.GetType()), "unlock", &pb.PracticeUnLockResp{Info: room}) session.SendMsg(string(this.module.GetType()), "unlock", &pb.PracticeUnLockResp{Info: room})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -398,7 +398,9 @@ func (this *Practice) RPC_ModulePracticeUnLockPillar(ctx context.Context, args *
} }
_session, _ := this.GetUserSession(args.Param1) _session, _ := this.GetUserSession(args.Param1)
go this.ModuleBuried.TriggerBuried(_session, comm.GetBuriedParam(comm.Rtype152, 1)) go this.AsynHandleSession(_session, func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(_session, comm.GetBuriedParam(comm.Rtype152, 1))
})
return return
} }

View File

@ -95,7 +95,6 @@ func (this *apiComp) Answer(session comm.IUserSession, req *pb.QuestionnaireAnsw
} }
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))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
} }
if err = this.module.modelQuestionnaire.updateUserQuestionnaire(session.GetUserId(), info); err != nil { if err = this.module.modelQuestionnaire.updateUserQuestionnaire(session.GetUserId(), info); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -106,5 +105,11 @@ func (this *apiComp) Answer(session comm.IUserSession, req *pb.QuestionnaireAnsw
return return
} }
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) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -222,10 +222,12 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype67, v.N, utils.ToInt32(v.T)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype67, v.N, utils.ToInt32(v.T))
} }
} }
if len(tasks) > 0 {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
}
session.SendMsg(string(this.module.GetType()), "buy", &pb.ShopBuyResp{IsSucc: true}) session.SendMsg(string(this.module.GetType()), "buy", &pb.ShopBuyResp{IsSucc: true})
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -37,6 +37,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
equiconf *cfg.GameEquipData equiconf *cfg.GameEquipData
equibuyconf *cfg.GameShopBuyequiCosData equibuyconf *cfg.GameShopBuyequiCosData
leftrefnum int32 leftrefnum int32
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
if errdata = this.GetlistCheck(session, req); errdata != nil { if errdata = this.GetlistCheck(session, req); errdata != nil {
return return
@ -220,7 +221,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
} }
goods = transGoods(items, sdata) goods = transGoods(items, sdata)
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype105, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype105, 1))
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{"refreshnumgoldShop": shopData.RefreshnumgoldShop, "refreshtimegoldShop": shopData.RefreshtimegoldShop, filed: sdata}) this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{"refreshnumgoldShop": shopData.RefreshnumgoldShop, "refreshtimegoldShop": shopData.RefreshtimegoldShop, filed: sdata})
} else if !req.IsManualRefresh { } else if !req.IsManualRefresh {
// refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2)) // refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2))
@ -299,8 +300,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
} }
goods = transGoods(items, sdata) goods = transGoods(items, sdata)
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: sdata}) this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: sdata})
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype105, 1))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype105, 1))
} else { //返回以前的商品列表 } else { //返回以前的商品列表
keys := make([]int32, len(sdata.Items)) keys := make([]int32, len(sdata.Items))
for i, v := range sdata.Items { for i, v := range sdata.Items {
@ -325,5 +325,12 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
return return
} }
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ShopGetListResp{SType: req.SType, IsManualRefresh: req.IsManualRefresh, Goods: goods, SurplusRefreshNum: leftrefnum, Lastrefreshtime: sdata.LastRefreshTime, Leftfreerefreshnum: sdata.Leftfreerefreshnum}) session.SendMsg(string(this.module.GetType()), "getlist", &pb.ShopGetListResp{SType: req.SType, IsManualRefresh: req.IsManualRefresh, Goods: goods, SurplusRefreshNum: leftrefnum, Lastrefreshtime: sdata.LastRefreshTime, Leftfreerefreshnum: sdata.Leftfreerefreshnum})
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -15,7 +15,7 @@ func (this *apiComp) AtlasActivateCheck(session comm.IUserSession, req *pb.Smith
func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtlasActivateReq) (errdata *pb.ErrorData) { func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtlasActivateReq) (errdata *pb.ErrorData) {
var ( var (
addScore int32 // 更新图鉴增加的积分 addScore int32 // 更新图鉴增加的积分
szTask []*pb.BuriedParam tasks []*pb.BuriedParam
update map[string]interface{} update map[string]interface{}
) )
update = make(map[string]interface{}, 0) update = make(map[string]interface{}, 0)
@ -114,10 +114,12 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
update["score"] = atlas.Score update["score"] = atlas.Score
update["collect"] = atlas.Collect update["collect"] = atlas.Collect
this.module.modelAtlas.modifySmithyAtlasList(session.GetUserId(), update) this.module.modelAtlas.modifySmithyAtlasList(session.GetUserId(), update)
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype165, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype165, 1))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype166, int32(len(atlas.Collect)))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype166, int32(len(atlas.Collect))))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype167, atlas.Score)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype167, atlas.Score))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas}) session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -302,7 +302,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype177, 1)) szTask = append(szTask, comm.GetBuriedParam(comm.Rtype177, 1))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype179, 1, nextProficiency.Value1)) szTask = append(szTask, comm.GetBuriedParam(comm.Rtype179, 1, nextProficiency.Value1))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
} }
// 是否解锁新套装 // 是否解锁新套装
if nextProficiency.Type == comm.SmithyReelType4 { if nextProficiency.Type == comm.SmithyReelType4 {
@ -329,7 +328,11 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
// 炉温恢复时间红点推送 // 炉温恢复时间红点推送
i, err := this.module.service.GetModule(comm.ModuleReddot) i, err := this.module.service.GetModule(comm.ModuleReddot)
if err != nil { if err != nil {
this.module.Error(err.Error()) errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return return
} }
if b, y := i.(comm.IReddot); y { if b, y := i.(comm.IReddot); y {
@ -355,7 +358,10 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype189, req.Count)) // 进行N次定制打造 tasks = append(tasks, comm.GetBuriedParam(comm.Rtype189, req.Count)) // 进行N次定制打造
} }
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype148, req.Count)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype148, req.Count))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
return return
} }

View File

@ -20,7 +20,8 @@ func (this *apiComp) RiseCheck(session comm.IUserSession, req *pb.SmithyRiseReq)
// 炉子升温 // 炉子升温
func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (errdata *pb.ErrorData) { func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (errdata *pb.ErrorData) {
var ( var (
cost []*cfg.Gameatn // 消耗材料 cost []*cfg.Gameatn // 消耗材料
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
if errdata = this.RiseCheck(session, req); errdata != nil { if errdata = this.RiseCheck(session, req); errdata != nil {
@ -85,9 +86,12 @@ func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (err
Nextchanagetime: stove.RecoveTime, Nextchanagetime: stove.RecoveTime,
}) })
} }
tasks := make([]*pb.BuriedParam, 0)
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...) }
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
return return

View File

@ -23,6 +23,10 @@ func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.SociatyAgreeR
} }
func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (errdata *pb.ErrorData) { func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (errdata *pb.ErrorData) {
var (
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
)
if errdata = this.AgreeCheck(session, req); errdata != nil { if errdata = this.AgreeCheck(session, req); errdata != nil {
return return
} }
@ -95,8 +99,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
} }
// 触发任务条件 // 触发任务条件
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype109, 1) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype109, 1))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype109, 1))
// 发邮件 // 发邮件
if err := this.module.modelSociaty.sendMail("GuildApproved", []string{sociaty.Name}, []string{req.Uid}); err != nil { if err := this.module.modelSociaty.sendMail("GuildApproved", []string{sociaty.Name}, []string{req.Uid}); err != nil {
this.module.Error("发送邮件 模板ID:GuildApproved", this.module.Error("发送邮件 模板ID:GuildApproved",
@ -113,16 +116,15 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
session.SendMsg(string(this.module.GetType()), SociatySubTypeAgree, rsp) session.SendMsg(string(this.module.GetType()), SociatySubTypeAgree, rsp)
//审核通过推送给申请人 go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
if err := this.module.SendMsgToUser(string(this.module.GetType()), "pagree", &pb.SociatyPAgreePush{ //审核通过推送给申请人
Uid: uid, if err := this.module.SendMsgToUser(string(this.module.GetType()), "pagree", &pb.SociatyPAgreePush{
SociatyId: sociaty.Id, Uid: req.Uid,
}, req.Uid); err != nil { SociatyId: sociaty.Id,
this.module.Error("审核通过推送", }, req.Uid); err != nil {
log.Field{Key: "uid", Value: uid}, this.module.Errorln(err)
log.Field{Key: "申请人", Value: req.Uid}, }
log.Field{Key: "sociatyId", Value: sociaty.Id}, this.module.ModuleBuried.TriggerBuried(session, tasks...)
) })
}
return return
} }

View File

@ -25,6 +25,7 @@ func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.SociatyApplyR
func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (errdata *pb.ErrorData) { func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (errdata *pb.ErrorData) {
var ( var (
sociaty *pb.DBSociaty sociaty *pb.DBSociaty
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
err error err error
) )
@ -143,12 +144,17 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
// 无需审核 // 无需审核
if !isCheck { if !isCheck {
// 触发任务条件 // 触发任务条件
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype109, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype109, 1))
} }
rsp := &pb.SociatyApplyResp{ rsp := &pb.SociatyApplyResp{
Uid: uid, Uid: uid,
ScoiatyId: req.SociatyId, ScoiatyId: req.SociatyId,
} }
session.SendMsg(string(this.module.GetType()), SociatySubTypeApply, rsp) session.SendMsg(string(this.module.GetType()), SociatySubTypeApply, rsp)
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -33,6 +33,10 @@ func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.SociatyCreat
} }
func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq) (errdata *pb.ErrorData) { func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq) (errdata *pb.ErrorData) {
var (
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
)
if errdata = this.CreateCheck(session, req); errdata != nil { if errdata = this.CreateCheck(session, req); errdata != nil {
return return
} }
@ -206,8 +210,7 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
) )
return return
} }
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype188, 1))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype188, 1))
// 初始化玩家公会任务 // 初始化玩家公会任务
if err := this.module.modelSociatyTask.initSociatyTask(user.Uid, sociaty.Id); err != nil { if err := this.module.modelSociatyTask.initSociatyTask(user.Uid, sociaty.Id); err != nil {
this.module.Error("初始化玩家公会任务", this.module.Error("初始化玩家公会任务",
@ -223,5 +226,11 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
Id: sociaty.Id, Id: sociaty.Id,
Uid: uid, Uid: uid,
}) })
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -169,13 +169,17 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt
Room: stone.Rooms, Room: stone.Rooms,
}) })
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
for _, v := range szEvent { // 首次触发指定ID的事件 for _, v := range szEvent { // 首次触发指定ID的事件
if c, e := this.module.configure.GetStoneEventDataById(v); e == nil { if c, e := this.module.configure.GetStoneEventDataById(v); e == nil {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype223, c.EventType, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype223, c.EventType, 1))
} }
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -32,7 +32,8 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
eventConf *cfg.GameStoneEventData eventConf *cfg.GameStoneEventData
reward []*pb.UserAtno reward []*pb.UserAtno
curbuff int32 curbuff int32
newbuff int32 // 新获得的buff newbuff int32 // 新获得的buff
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
update = make(map[string]interface{}) update = make(map[string]interface{})
if errdata = this.EventCheck(session, req); errdata != nil { if errdata = this.EventCheck(session, req); errdata != nil {
@ -162,9 +163,7 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
update["hero"] = stone.Hero update["hero"] = stone.Hero
this.module.modelStonehenge.ChangeStonehengeData(session.GetUserId(), update) this.module.modelStonehenge.ChangeStonehengeData(session.GetUserId(), update)
// 战斗失败埋点处理 // 战斗失败埋点处理
var szTask []*pb.BuriedParam tasks = append(tasks, comm.GetBuriedParam(comm.Rtype225, 1))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype225, 1))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
return return
} }
if !bWin { // 战斗失败直接返回 if !bWin { // 战斗失败直接返回
@ -472,9 +471,8 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
}) })
// 埋点处理 // 埋点处理
var szTask []*pb.BuriedParam
for k := range stone.Rooms.Eventid { // 首次触发指定ID的事件 for k := range stone.Rooms.Eventid { // 首次触发指定ID的事件
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype215, k)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype215, k))
} }
var totalhp int32 var totalhp int32
//上阵英雄都为指定职业 //上阵英雄都为指定职业
@ -494,13 +492,13 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
totalhp += v.Currhp * 1000 / maxHp totalhp += v.Currhp * 1000 / maxHp
} }
if job != 0 { // 上阵英雄都为指定职业 if job != 0 { // 上阵英雄都为指定职业
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype216, job, stone.StageID)) //上阵英雄都为指定职业,击败石阵秘境中指定关卡的首领 tasks = append(tasks, comm.GetBuriedParam(comm.Rtype216, job, stone.StageID)) //上阵英雄都为指定职业,击败石阵秘境中指定关卡的首领
} }
for _, v := range stone.Webuff { for _, v := range stone.Webuff {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype217, v, stone.StageID)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype217, v, stone.StageID))
} }
for _, v := range stone.Enemybuff { for _, v := range stone.Enemybuff {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype217, v, stone.StageID)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype217, v, stone.StageID))
} }
// Rtype218 统计类型 // Rtype218 统计类型
var buffType map[int32]int32 var buffType map[int32]int32
@ -517,36 +515,40 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
} }
} }
for k, v := range buffType { for k, v := range buffType {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype218, k, v, stone.StageID)) //携带指定类型、≥指定数量的buff击败石阵秘境中指定关卡的首领 tasks = append(tasks, comm.GetBuriedParam(comm.Rtype218, k, v, stone.StageID)) //携带指定类型、≥指定数量的buff击败石阵秘境中指定关卡的首领
} }
// 累计击败石阵秘境任意关卡的首领N次 // 累计击败石阵秘境任意关卡的首领N次
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype219, stone.StageID)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype219, stone.StageID))
//击败指定关卡的首领时,背包中指定道具数量≥指定数量 //击败指定关卡的首领时,背包中指定道具数量≥指定数量
if item, err := this.module.ModuleItems.QueryUserPack(session.GetUserId()); err != nil { if item, err := this.module.ModuleItems.QueryUserPack(session.GetUserId()); err != nil {
for _, v := range item { for _, v := range item {
if v.Amount > 0 { if v.Amount > 0 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype222, stone.StageID, utils.ToInt32(v.ItemId), int32(v.Amount))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype222, stone.StageID, utils.ToInt32(v.ItemId), int32(v.Amount)))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype226, stone.StageID, utils.ToInt32(v.ItemId), int32(v.Amount))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype226, stone.StageID, utils.ToInt32(v.ItemId), int32(v.Amount)))
} }
} }
} }
//击败石阵秘境中指定关卡的首领时,每名上阵英雄血量≤比例(千分比) //击败石阵秘境中指定关卡的首领时,每名上阵英雄血量≤比例(千分比)
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype224, totalhp, stone.StageID)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype224, totalhp, stone.StageID))
} }
// 强化商店 // 强化商店
if eventConf.EventType == EventType29 { if eventConf.EventType == EventType29 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype220, 1)) // 强化buff 埋点 tasks = append(tasks, comm.GetBuriedParam(comm.Rtype220, 1)) // 强化buff 埋点
} }
// 累计获得指定类型buff // 累计获得指定类型buff
if eventConf.EventType == EventType25 { if eventConf.EventType == EventType25 {
if newbuff != 0 { if newbuff != 0 {
if conf, err := this.module.configure.GetStoneBuffDataById(newbuff); err == nil { if conf, err := this.module.configure.GetStoneBuffDataById(newbuff); err == nil {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype221, conf.Type, 1)) //累计获得N个指定类型的buff tasks = append(tasks, comm.GetBuriedParam(comm.Rtype221, conf.Type, 1)) //累计获得N个指定类型的buff
} }
} }
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -165,13 +165,16 @@ func (this *apiComp) GotoRoom(session comm.IUserSession, req *pb.StonehengeGotoR
}) })
// 埋点 // 埋点
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
for _, v := range szEvent { // 首次触发指定ID的事件 for _, v := range szEvent { // 首次触发指定ID的事件
if c, e := this.module.configure.GetStoneEventDataById(v); e == nil { if c, e := this.module.configure.GetStoneEventDataById(v); e == nil {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype223, c.EventType, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype223, c.EventType, 1))
} }
} }
if len(tasks) > 0 {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -31,6 +31,10 @@ func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.UserCreateRe
// 创角 // 创角
func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (errdata *pb.ErrorData) { func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (errdata *pb.ErrorData) {
var (
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
)
if errdata = this.CreateCheck(session, req); errdata != nil { if errdata = this.CreateCheck(session, req); errdata != nil {
return return
} }
@ -113,41 +117,15 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e
_ = this.module.DispenseRes(session, res, true) _ = this.module.DispenseRes(session, res, true)
} }
//初始化用户设置
// this.module.modelSetting.InitSetting(session.GetUserId())
// go func() {
// //初始化公会 date3.10
// sociaty := this.module.CrossCreateSociaty(uid, req.NickName)
// if sociaty == nil {
// return
// }
// this.module.Debugf("公会ID:%v", sociaty.Id)
// exUpdate := map[string]interface{}{
// "sociatyId": sociaty.Id,
// }
// if err := this.module.ModuleUser.ChangeUserExpand(uid, exUpdate); err != nil {
// errdata = &pb.ErrorData{
// Code: pb.ErrorCode_DBError,
// Title: pb.ErrorCode_DBError.ToString(),
// Message: err.Error(),
// }
// this.module.Error("更新玩家公会ID",
// log.Field{Key: "uid", Value: uid},
// log.Field{Key: "sociatyId", Value: sociaty.Id},
// log.Field{Key: "err", Value: err.Error()},
// )
// return
// }
// }()
// resp.IsSucc = true
// this.sendMsg(session, UserSubTypeCreate, resp)
session.SendMsg(string(this.module.GetType()), UserSubTypeCreate, &pb.UserCreateResp{}) session.SendMsg(string(this.module.GetType()), UserSubTypeCreate, &pb.UserCreateResp{})
if req.Figure != 0 { if req.Figure != 0 {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype72, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype72, 1))
} }
this.mail.SendMailByCid(session, comm.Welcomemail, nil) this.mail.SendMailByCid(session, comm.Welcomemail, nil)
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -2,8 +2,6 @@ package user
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/event"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure" "go_dreamfactory/sys/configure"
"go_dreamfactory/utils" "go_dreamfactory/utils"
@ -24,33 +22,31 @@ func (this *apiComp) LoginCheck(session comm.IUserSession, req *pb.UserLoginReq)
// 登录 // 登录
func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (errdata *pb.ErrorData) { func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (errdata *pb.ErrorData) {
if errdata = this.LoginCheck(session, req); errdata != nil {
return
}
var ( var (
err error
user *pb.DBUser user *pb.DBUser
expand *pb.DBUserExpand
lastLoginTime int64 lastLoginTime int64
update map[string]interface{} = make(map[string]interface{})
err error
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
rsp := &pb.UserLoginResp{} if errdata = this.LoginCheck(session, req); errdata != nil {
return
}
//从mgo查询user //从mgo查询user
user, err = this.module.modelUser.FindByAccount(req.Sid, req.Account) user, err = this.module.modelUser.FindByAccount(req.Sid, req.Account)
if err != nil { if err != nil && err != mongo.ErrNoDocuments {
if err != mongo.ErrNoDocuments { errdata = &pb.ErrorData{
log.Error("User_FindByAccount", Code: pb.ErrorCode_DBError,
log.Field{Key: "uid", Value: req.Sid}, Title: pb.ErrorCode_DBError.ToString(),
log.Field{Key: "account", Value: req.Account}, Message: err.Error(),
log.Field{Key: "err", Value: err.Error()},
)
return
} }
return
} }
var isNewUser bool if err == mongo.ErrNoDocuments {
if user == nil {
//如果是新玩家,创建一条基础的数据,页面会引导进入创角页面 //如果是新玩家,创建一条基础的数据,页面会引导进入创角页面
user = &pb.DBUser{ user = &pb.DBUser{
Sid: req.Sid, Sid: req.Sid,
@ -64,10 +60,14 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
} }
err = this.module.modelUser.User_Create(user) err = this.module.modelUser.User_Create(user)
if err != nil { if err != nil {
log.Errorf("User_CreateUser err %v", err) errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return return
} }
isNewUser = true expand = &pb.DBUserExpand{}
} else { } else {
// 玩家是否已在线 // 玩家是否已在线
if isession, ok := this.module.ModuleBase.GetUserSession(user.Uid); ok { if isession, ok := this.module.ModuleBase.GetUserSession(user.Uid); ok {
@ -76,19 +76,57 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
isession.UnBind() isession.UnBind()
this.module.PutUserSession(isession) this.module.PutUserSession(isession)
} }
} lastLoginTime = user.Logintime
user.Logintime = configure.Now().Unix()
user.Lastloginip = session.GetIP()
user.Offlinetime = 0
user.Area = req.Area
user.Channel = req.Channel
user.Vcode = req.Vcode
user.Vname = req.Vname
update["logintime"] = user.Logintime
update["lastloginip"] = user.Lastloginip
update["offlinetime"] = user.Offlinetime
update["Channel"] = user.Channel
update["vcode"] = user.Vcode
update["vname"] = user.Vname
//bind user if expand, err = this.module.GetUserExpand(session.GetUserId()); err != nil {
err = session.Bind(user.Uid, this.service.GetId()) if err != mongo.ErrNoDocuments {
if err != nil { errdata = &pb.ErrorData{
errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError,
Code: pb.ErrorCode_BindUser, Title: pb.ErrorCode_DBError.ToString(),
Title: pb.ErrorCode_BindUser.ToString(), Message: err.Error(),
Message: err.Error(), }
return
}
}
if !utils.IsToday(lastLoginTime) { //当天第一次登录
user.Nologindays = int32(utils.DiffDays(lastLoginTime, configure.Now().Unix()))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype8, 1))
this.module.modelExpand.Change(session.GetUserId(), map[string]interface{}{
"loginAddCount": expand.LoginAddCount + 1,
"globalbuff": 0,
"consumPs": 0, // 重置每日消耗体力
"loginContinueCount": expand.LoginContinueCount + 1,
})
// 清理点赞
}
err = this.module.modelUser.Change(user.Uid, update)
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
} }
return
} }
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype7, 1))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype230, 1, int32(configure.Now().Weekday())))
//缓存user session //缓存user session
err = this.module.modelSession.addUserSession(user.Uid, session) err = this.module.modelSession.addUserSession(user.Uid, session)
if err != nil { if err != nil {
@ -100,82 +138,97 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
} }
return return
} }
session.SendMsg(string(this.module.GetType()), UserSubTypeLogin, &pb.UserLoginResp{
Data: user,
Ex: expand,
TimeNow: configure.Now().Unix(),
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleFriend.ResetFriend(user.Uid)
this.module.modelSign.UserSign(session)
this.module.ModuleItems.InitItemBagData(session)
this.module.ModuleHero.CheckPeachReward(session, user.Ctime)
if len(tasks) > 0 {
this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
}
})
// 在logintime更新前判断是否是昨天 // 在logintime更新前判断是否是昨天
if utils.IsYestoday(user.Logintime) { // if utils.IsYestoday(user.Logintime) {
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype9, 1)) // tasks = append(tasks, comm.GetBuriedParam(comm.Rtype9, 1))
} else { // } else {
this.module.ModuleBuried.ResetBuriedByType(user.Uid, comm.Rtype9) // this.module.ModuleBuried.ResetBuriedByType(user.Uid, comm.Rtype9)
} // }
//不是新账号 //不是新账号
if !isNewUser { // if !isNewUser {
lastLoginTime = user.Logintime // lastLoginTime = user.Logintime
user.Logintime = configure.Now().Unix() // user.Logintime = configure.Now().Unix()
user.Lastloginip = session.GetIP() // user.Lastloginip = session.GetIP()
user.Offlinetime = 0 // user.Offlinetime = 0
user.Area = req.Area // user.Area = req.Area
user.Channel = req.Channel // user.Channel = req.Channel
user.Vcode = req.Vcode // user.Vcode = req.Vcode
user.Vname = req.Vname // user.Vname = req.Vname
update := utils.StructToMap(user) //尽量不要更新整个数据 // update := utils.StructToMap(user) //尽量不要更新整个数据
err = this.module.modelUser.Change(user.Uid, update) // err = this.module.modelUser.Change(user.Uid, update)
if err != nil { // if err != nil {
errdata = &pb.ErrorData{ // errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError, // Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(), // Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(), // Message: err.Error(),
} // }
return // return
} // }
if this.module.modelUser.isLoginFirst(lastLoginTime) { // if this.module.modelUser.isLoginFirst(lastLoginTime) {
this.module.ModuleHero.NoLoginDay(user.Uid, int32(utils.DiffDays(lastLoginTime, configure.Now().Unix()))) // this.module.ModuleHero.NoLoginDay(user.Uid, int32(utils.DiffDays(lastLoginTime, configure.Now().Unix())))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype8, 1)) // tasks = append(tasks, comm.GetBuriedParam(comm.Rtype8, 1))
this.module.modelExpand.updateLoginDay(user.Uid, lastLoginTime) // this.module.modelExpand.updateLoginDay(user.Uid, lastLoginTime)
// 清理点赞 // // 清理点赞
this.module.ModuleFriend.ResetFriend(user.Uid) // this.module.ModuleFriend.ResetFriend(user.Uid)
this.module.modelSign.UserSign(session) // this.module.modelSign.UserSign(session)
this.module.ModuleItems.InitItemBagData(session) // this.module.ModuleItems.InitItemBagData(session)
} // }
// 判断昨日是否登录 // // 判断昨日是否登录
rsp.Data = user // rsp.Data = user
// 查询玩家扩展数据 // // 查询玩家扩展数据
if expand, err := this.module.GetUserExpand(session.GetUserId()); err != nil { // if expand, err := this.module.GetUserExpand(session.GetUserId()); err != nil {
if err != mongo.ErrNoDocuments { // if err != mongo.ErrNoDocuments {
errdata = &pb.ErrorData{ // errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError, // Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(), // Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(), // Message: err.Error(),
} // }
return // return
} // }
} else { // } else {
rsp.Ex = expand // rsp.Ex = expand
} // }
} else { //新号 // } else { //新号
rsp.Ex = &pb.DBUserExpand{} // rsp.Ex = &pb.DBUserExpand{}
this.module.modelSign.UserSign(session) // this.module.modelSign.UserSign(session)
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype8, 1)) // tasks = append(tasks, comm.GetBuriedParam(comm.Rtype8, 1))
} // }
this.module.ModuleHero.CheckPeachReward(session, user.Ctime) // this.module.ModuleHero.CheckPeachReward(session, user.Ctime)
go this.module.RecoverUserPsStart(session.Clone()) // go this.module.RecoverUserPsStart(session.Clone())
// 日常登录任务 // // 日常登录任务
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype7, 1)) // tasks = append(tasks, comm.GetBuriedParam(comm.Rtype7, 1))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype230, 1, int32(configure.Now().Weekday()))) // tasks = append(tasks, comm.GetBuriedParam(comm.Rtype230, 1, int32(configure.Now().Weekday())))
this.module.ModulePrivilege.CheckDailyPrivilegeMail(session) // this.module.ModulePrivilege.CheckDailyPrivilegeMail(session)
rsp.Data = user // rsp.Data = user
rsp.TimeNow = configure.Now().Unix() // 设置服务器时间 // rsp.TimeNow = configure.Now().Unix() // 设置服务器时间
session.SendMsg(string(this.module.GetType()), UserSubTypeLogin, rsp) // session.SendMsg(string(this.module.GetType()), UserSubTypeLogin, rsp)
if len(tasks) > 0 { // if len(tasks) > 0 {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...) // go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
} // }
event.TriggerEvent(comm.EventUserLogin, session.Clone()) // event.TriggerEvent(comm.EventUserLogin, session.Clone())
return return
} }

View File

@ -8,7 +8,6 @@ import (
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure" "go_dreamfactory/sys/configure"
"go_dreamfactory/sys/db" "go_dreamfactory/sys/db"
"go_dreamfactory/utils"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx" "go.mongodb.org/mongo-driver/x/bsonx"
@ -94,22 +93,22 @@ func (this *ModelExpand) ChangeUserExpand(uid string, value map[string]interface
} }
// 累计登录天数 和 全局buff清理 // // 累计登录天数 和 全局buff清理
func (this *ModelExpand) updateLoginDay(uid string, timestamp int64) (err error) { // func (this *ModelExpand) updateLoginDay(uid string, timestamp int64) (err error) {
var de *pb.DBUserExpand // var de *pb.DBUserExpand
if de, err = this.GetUserExpand(uid); err == nil { // if de, err = this.GetUserExpand(uid); err == nil {
count := de.LoginAddCount + 1 // count := de.LoginAddCount + 1
update := map[string]interface{}{ // update := map[string]interface{}{
"loginAddCount": count, // "loginAddCount": count,
"globalbuff": 0, // "globalbuff": 0,
"consumPs": 0, // 重置每日消耗体力 // "consumPs": 0, // 重置每日消耗体力
} // }
// 更新连续等登录天数 // // 更新连续等登录天数
if utils.IsYestoday(timestamp) { // if utils.IsYestoday(timestamp) {
update["loginContinueCount"] = de.LoginContinueCount + 1 // update["loginContinueCount"] = de.LoginContinueCount + 1
} // }
err = this.ChangeUserExpand(uid, update) // err = this.ChangeUserExpand(uid, update)
} // }
return // return
} // }

View File

@ -80,10 +80,13 @@ func (this *ModelUser) User_Create(user *pb.DBUser) (err error) {
user.Lv = 1 //初始等级 user.Lv = 1 //初始等级
user.Ctime = now user.Ctime = now
user.Logintime = now user.Logintime = now
_, err = this.DB.InsertOne(comm.TableUser, user) if _, err = this.DB.InsertOne(comm.TableUser, user); err != nil {
this.module.Errorln("创建用户", log.Field{Key: "sid", Value: user.Sid}, log.Field{Key: "account", Value: user.Binduid}, log.Field{Key: "err", Value: err.Error()})
return
}
key := fmt.Sprintf("%s:%s", this.TableName, user.Uid) key := fmt.Sprintf("%s:%s", this.TableName, user.Uid)
if err = this.Redis.HMSet(key, user); err != nil { if err = this.Redis.HMSet(key, user); err != nil {
this.module.Error("创建用户", log.Field{Key: "sid", Value: user.Sid}, log.Field{Key: "account", Value: user.Binduid}) this.module.Error("创建用户", log.Field{Key: "sid", Value: user.Sid}, log.Field{Key: "account", Value: user.Binduid}, log.Field{Key: "err", Value: err.Error()})
return return
} }
return return

View File

@ -773,7 +773,9 @@ func (this *User) AddAttributeValues(session comm.IUserSession, attrs map[string
} }
if len(tasks) > 0 { if len(tasks) > 0 {
go this.ModuleBuried.TriggerBuried(session.Clone(), tasks...) go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
return return
} }

View File

@ -218,30 +218,34 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
this.module.Errorf("no found userdata uid:%s", session.GetUserId()) this.module.Errorf("no found userdata uid:%s", session.GetUserId())
} }
// 随机任务统计 // 随机任务统计
var szTask []*pb.BuriedParam var tasks []*pb.BuriedParam
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype73, 1, req.BossId, req.Difficulty)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype73, 1, req.BossId, req.Difficulty))
//szTask = append(szTask, comm.GetBuriedParam(comm.Rtype74, req.BossId, req.Difficulty)) //szTask = append(szTask, comm.GetBuriedParam(comm.Rtype74, req.BossId, req.Difficulty))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype78, req.BossId, req.Report.Costtime/1000, req.Difficulty)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype78, req.BossId, req.Report.Costtime/1000, req.Difficulty))
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if v.Ishelp { // 判断是否有助战 if v.Ishelp { // 判断是否有助战
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype79, req.Difficulty, req.BossId)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype79, req.Difficulty, req.BossId))
break break
} }
} }
} }
if req.Auto > 0 { if req.Auto > 0 {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype75, req.BossId, req.Difficulty)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype75, req.BossId, req.Difficulty))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype172, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype172, 1))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype181, 1, req.BossId, req.Difficulty)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype181, 1, req.BossId, req.Difficulty))
} }
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype201, consumPs)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype201, consumPs))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype76, 1, req.BossId)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype76, 1, req.BossId))
if bHelp { if bHelp {
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype180, req.BossId, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype180, req.BossId, 1))
}
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
return return
} }

View File

@ -30,6 +30,7 @@ func (this *apiComp) BattleFinish(session comm.IUserSession, req *pb.WTaskBattle
conf *cfg.GameWorldBattleData conf *cfg.GameWorldBattleData
prop []*cfg.Gameatn prop []*cfg.Gameatn
award []*pb.UserAssets award []*pb.UserAssets
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
err error err error
isWin bool isWin bool
) )
@ -99,10 +100,16 @@ func (this *apiComp) BattleFinish(session comm.IUserSession, req *pb.WTaskBattle
return return
} }
//触发任务 //触发任务
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype70, 1, req.BattleConfId)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype70, 1, req.BattleConfId))
} else { } else {
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype227, 1, req.BattleConfId)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype227, 1, req.BattleConfId))
} }
session.SendMsg(string(this.module.GetType()), "battlefinish", &pb.WTaskBattleFinishResp{BattleConfId: req.BattleConfId, Award: award}) session.SendMsg(string(this.module.GetType()), "battlefinish", &pb.WTaskBattleFinishResp{BattleConfId: req.BattleConfId, Award: award})
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -23,6 +23,7 @@ func (this *apiComp) BoxReceive(session comm.IUserSession, req *pb.WTaskBoxRecei
award []*pb.UserAtno award []*pb.UserAtno
ok bool ok bool
err error err error
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
) )
if errdata = this.BoxReceiveCheck(session, req); errdata != nil { if errdata = this.BoxReceiveCheck(session, req); errdata != nil {
return return
@ -110,8 +111,13 @@ func (this *apiComp) BoxReceive(session comm.IUserSession, req *pb.WTaskBoxRecei
} }
return return
} }
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype205, 1))
session.SendMsg(string(this.module.GetType()), "boxreceive", &pb.WTaskBoxReceiveResp{Tid: req.Tid, Boxid: req.Boxid, Award: award}) session.SendMsg(string(this.module.GetType()), "boxreceive", &pb.WTaskBoxReceiveResp{Tid: req.Tid, Boxid: req.Boxid, Award: award})
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype205, 1))
if len(tasks) > 0 {
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
}
return return
} }

View File

@ -97,7 +97,11 @@ func (this *apiComp) EventComplete(session comm.IUserSession, req *pb.WTaskEvent
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype206, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype206, 1))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype207, 1, req.Group)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype207, 1, req.Group))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
})
session.SendMsg(string(this.module.GetType()), "eventcomplete", &pb.WTaskEventCompleteResp{Group: req.Group, Event: event, Award: award}) session.SendMsg(string(this.module.GetType()), "eventcomplete", &pb.WTaskEventCompleteResp{Group: req.Group, Event: event, Award: award})
return return
} }

View File

@ -155,6 +155,7 @@ type DBUser struct {
Deposit int64 `protobuf:"varint,42,opt,name=deposit,proto3" json:"deposit" bson:"deposit"` //储蓄 Deposit int64 `protobuf:"varint,42,opt,name=deposit,proto3" json:"deposit" bson:"deposit"` //储蓄
Profit int64 `protobuf:"varint,43,opt,name=profit,proto3" json:"profit" bson:"profit"` //商队盈利 Profit int64 `protobuf:"varint,43,opt,name=profit,proto3" json:"profit" bson:"profit"` //商队盈利
Integral int64 `protobuf:"varint,44,opt,name=integral,proto3" json:"integral" bson:"integral"` //充值积分 Integral int64 `protobuf:"varint,44,opt,name=integral,proto3" json:"integral" bson:"integral"` //充值积分
Nologindays int32 `protobuf:"varint,45,opt,name=nologindays,proto3" json:"nologindays" bson:"nologindays"` //连续多少天未登录
} }
func (x *DBUser) Reset() { func (x *DBUser) Reset() {
@ -490,6 +491,13 @@ func (x *DBUser) GetIntegral() int64 {
return 0 return 0
} }
func (x *DBUser) GetNologindays() int32 {
if x != nil {
return x.Nologindays
}
return 0
}
type DBUserSetting struct { type DBUserSetting struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -815,7 +823,7 @@ var file_user_user_db_proto_rawDesc = []byte{
0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x0e, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1c, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1c,
0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28,
0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xa4, 0x08, 0x0a, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xc6, 0x08, 0x0a,
0x06, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x06, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69,
@ -882,46 +890,48 @@ var file_user_user_db_proto_rawDesc = []byte{
0x16, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x74, 0x18, 0x2b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x74, 0x18, 0x2b, 0x20, 0x01, 0x28, 0x03, 0x52,
0x06, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x06, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67,
0x72, 0x61, 0x6c, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67,
0x72, 0x61, 0x6c, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x64, 0x61,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x79, 0x73, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x69,
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x6e, 0x64, 0x61, 0x79, 0x73, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72,
0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x12, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02,
0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x18, 0x04, 0x20, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x75, 0x61,
0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x12, 0x1a, 0x0a, 0x7a, 0x68, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68,
0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x18, 0x04,
0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x75, 0x6c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x12,
0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x12, 0x14, 0x0a, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28,
0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x08, 0x52, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x77,
0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x75, 0x6c, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x12,
0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18,
0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a,
0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x67, 0x75,
0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x12, 0x61, 0x6a, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01,
0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x28, 0x08, 0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x6e,
0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x78, 0x75, 0x61, 0x73, 0x75, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75,
0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x78, 0x75, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01,
0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x28, 0x08, 0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x78,
0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x22, 0xb8, 0x01, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09,
0x0a, 0x06, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x61, 0x69,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x6a, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x22,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0xb8, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08,
0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e,
0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x69, 0x67,
0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18,
0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x75, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03,
0x7a, 0x7a, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x70, 0x73, 0x18, 0x08, 0x20, 0x01, 0x64, 0x61, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x79, 0x12, 0x16,
0x28, 0x05, 0x52, 0x04, 0x74, 0x69, 0x70, 0x73, 0x22, 0x57, 0x0a, 0x0c, 0x44, 0x42, 0x52, 0x61, 0x0a, 0x06, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06,
0x6e, 0x64, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x61, 0x6d, 0x65, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x70, 0x73, 0x18, 0x08,
0x5f, 0x63, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x69, 0x70, 0x73, 0x22, 0x57, 0x0a, 0x0c, 0x44, 0x42,
0x6e, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x61,
0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x6d, 0x65, 0x5f, 0x63, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x61, 0x6d,
0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x65, 0x43, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20,
0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x33, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61,
0x74, 0x75, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -61,7 +61,7 @@ type DBUserExpand struct {
Race map[int32]int32 `protobuf:"bytes,37,rep,name=race,proto3" json:"race" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 阵营ID 1~4 value 总好感度 Race map[int32]int32 `protobuf:"bytes,37,rep,name=race,proto3" json:"race" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 阵营ID 1~4 value 总好感度
Herofrag map[string]int32 `protobuf:"bytes,38,rep,name=herofrag,proto3" json:"herofrag" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //当获得重复守护者时获得的守护之心次数 Herofrag map[string]int32 `protobuf:"bytes,38,rep,name=herofrag,proto3" json:"herofrag" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //当获得重复守护者时获得的守护之心次数
Passonlv int32 `protobuf:"varint,39,opt,name=passonlv,proto3" json:"passonlv"` //传功等级 Passonlv int32 `protobuf:"varint,39,opt,name=passonlv,proto3" json:"passonlv"` //传功等级
ConsumPs int32 `protobuf:"varint,40,opt,name=consumPs,proto3" json:"consumPs"` // 今天消耗的体力 ConsumPs int32 `protobuf:"varint,40,opt,name=consumPs,proto3" json:"consumPs"` //今天消耗的体力
} }
func (x *DBUserExpand) Reset() { func (x *DBUserExpand) Reset() {