上传任务消息推送

This commit is contained in:
liwei1dao 2023-03-27 15:47:17 +08:00
parent 5cb480f6eb
commit b0d0ec205f
33 changed files with 119 additions and 61 deletions

View File

@ -52,7 +52,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe
} }
this.module.DispenseRes(session, level.Award, true) this.module.DispenseRes(session, level.Award, true)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype151, 1) go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(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

@ -40,7 +40,8 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
Buleflist: record.Buleflist, Buleflist: record.Buleflist,
Tasks: record.Tasks, Tasks: record.Tasks,
}}) }})
this.module.ModuleRtask.SendToRtask(session, comm.Rtype130, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype130, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype130, 1))
} else { } else {
session.SendMsg(string(this.module.GetType()), "challenge", &pb.ArenaChallengeResp{Code: cd, Info: nil}) session.SendMsg(string(this.module.GetType()), "challenge", &pb.ArenaChallengeResp{Code: cd, Info: nil})
} }

View File

@ -63,7 +63,8 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
redstate = pb.BattleRecordState_AttackWin redstate = pb.BattleRecordState_AttackWin
bulestate = pb.BattleRecordState_DefendLost bulestate = pb.BattleRecordState_DefendLost
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype131, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype131, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype131, 1))
} else { } else {
if req.Revengeid != "" { if req.Revengeid != "" {
redstate = pb.BattleRecordState_RevengeFailed redstate = pb.BattleRecordState_RevengeFailed
@ -224,7 +225,8 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
} }
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype128, red.Integral) this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype128, red.Integral), comm.GettaskParam(comm.Rtype129, red.Dan))
this.module.ModuleRtask.SendToRtask(session, comm.Rtype129, red.Dan) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype128, red.Integral)
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype129, red.Dan)
return return
} }

View File

@ -138,7 +138,8 @@ 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 != "" {
this.ModuleRtask.SendToRtask(session, comm.Rtype108, 1) // this.ModuleRtask.SendToRtask(session, comm.Rtype108, 1)
go this.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype108, 1))
break break
} }
} }
@ -247,7 +248,8 @@ func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLP
} }
for _, v := range req.Format.Friendformat { for _, v := range req.Format.Friendformat {
if v != "" { if v != "" {
this.ModuleRtask.SendToRtask(session, comm.Rtype108, 1) // this.ModuleRtask.SendToRtask(session, comm.Rtype108, 1)
go this.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype108, 1))
break break
} }
} }
@ -375,7 +377,8 @@ 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.ModuleRtask.SendToRtask(session, comm.Rtype157, int32(report.Info.Ptype), v) // this.ModuleRtask.SendToRtask(session, comm.Rtype157, int32(report.Info.Ptype), v)
go this.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype157, int32(report.Info.Ptype), v))
} }
return pb.ErrorCode_Success, true return pb.ErrorCode_Success, true
} }

View File

@ -75,7 +75,8 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code
msg.Content = wordfilter.Replace(msg.Content, '*') msg.Content = wordfilter.Replace(msg.Content, '*')
} }
go this.module.modelChat.sendChatToWorld(msg, max_chat) go this.module.modelChat.sendChatToWorld(msg, max_chat)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype62, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype62, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype62, 1))
//随机任务 //随机任务
// if _, err = this.service.AcrossClusterRpcGo( // if _, err = this.service.AcrossClusterRpcGo(
// context.Background(), // context.Background(),
@ -116,7 +117,8 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code
msg.ChannelId = userexpand.Chatchannel //指定频道 msg.ChannelId = userexpand.Chatchannel //指定频道
go this.module.modelChat.sendChatToCrossServer(msg, max_chat) go this.module.modelChat.sendChatToCrossServer(msg, max_chat)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype106, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype106, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype106, 1))
break break
default: default:
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError

View File

@ -92,7 +92,8 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC
if pass { if pass {
lv.Pass = true lv.Pass = true
this.module.DispenseRes(session, level.Award, true) this.module.DispenseRes(session, level.Award, true)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype140, 1, level.Id) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype140, 1, level.Id)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype140, 1))
} }
lv.Progress = int32((float64(len(lv.Passmanster)+len(lv.Passdrop)) / float64(len(level.Passdroplist)+len(level.PassformatList))) * float64(100)) lv.Progress = int32((float64(len(lv.Passmanster)+len(lv.Passdrop)) / float64(len(level.Passdroplist)+len(level.PassformatList))) * float64(100))
if err = this.module.modelCombat.updateInfo(info); err != nil { if err = this.module.modelCombat.updateInfo(info); err != nil {

View File

@ -100,7 +100,8 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod
if pass { if pass {
lv.Pass = true lv.Pass = true
this.module.DispenseRes(session, level.Award, true) this.module.DispenseRes(session, level.Award, true)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype140, 1, level.Id) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype140, 1, level.Id)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype140, 1))
} }
lv.Progress = int32((float64(len(lv.Passmanster)+len(lv.Passdrop)) / float64(len(level.Passdroplist)+len(level.PassformatList))) * float64(100)) lv.Progress = int32((float64(len(lv.Passmanster)+len(lv.Passdrop)) / float64(len(level.Passdroplist)+len(level.PassformatList))) * float64(100))
if err = this.module.modelCombat.updateInfo(info); err != nil { if err = this.module.modelCombat.updateInfo(info); err != nil {

View File

@ -91,7 +91,8 @@ func (this *apiComp) Ench(session comm.IUserSession, req *pb.EquipmentEnchReq) (
return return
} }
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype94, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype94, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(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})
return return
} }

View File

@ -68,7 +68,8 @@ func (this *apiComp) Wash(session comm.IUserSession, req *pb.EquipmentWashReq) (
Value: attrlibrarys[v].Attrvar + int32(float64(attrlibrarys[v].Addition[equip.AdverbEntry[i].Lv-1])/1000.0*float64(attrlibrarys[v].AttrvarCorrect)), Value: attrlibrarys[v].Attrvar + int32(float64(attrlibrarys[v].Addition[equip.AdverbEntry[i].Lv-1])/1000.0*float64(attrlibrarys[v].AttrvarCorrect)),
} }
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype95, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype95, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(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})
return return
} }

View File

@ -136,8 +136,8 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
} }
// 拥有xx个好友 // 拥有xx个好友
this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype10, int32(len(agreeIds))) // this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype10, int32(len(agreeIds)))
go this.moduleFriend.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype10, int32(len(agreeIds))))
resp := &pb.FriendAgreeResp{ resp := &pb.FriendAgreeResp{
Num: optNum, Num: optNum,
} }

View File

@ -99,7 +99,7 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
} }
// 随机任务Rtype13 // 随机任务Rtype13
this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype13, 1) // this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype13, 1)
go this.moduleFriend.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype13, 1))
return return
} }

View File

@ -101,6 +101,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
} }
// 赠送X次友情点 // 赠送X次友情点
this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype11, 1) // this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype11, 1)
go this.moduleFriend.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype11, 1))
return return
} }

View File

@ -143,6 +143,7 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat
for _, v := range req.Order { for _, v := range req.Order {
iTotal += int(v.FoodCount) iTotal += int(v.FoodCount)
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype150, int32(iTotal)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype150, int32(iTotal))
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype150, int32(iTotal)))
return return
} }

View File

@ -31,7 +31,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.GourmetGetListRe
session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet}) session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet})
// 任务统计 // 任务统计
this.module.ModuleRtask.SendToRtask(session, comm.Rtype136, _gourmet.TotalTime) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype136, _gourmet.TotalTime)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype136, _gourmet.TotalTime))
return return
} }

View File

@ -31,6 +31,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HeroBuyReq) (code pb
price []int32 // 购买所需的价钱 price []int32 // 购买所需的价钱
totalCost float64 // 购买打折系数 totalCost float64 // 购买打折系数
udata *pb.DBUser udata *pb.DBUser
tasks []*comm.TaskParam = make([]*comm.TaskParam, 0)
) )
update = make(map[string]interface{}) update = make(map[string]interface{})
if code = this.BuyCheck(session, req); code != pb.ErrorCode_Success { if code = this.BuyCheck(session, req); code != pb.ErrorCode_Success {
@ -107,18 +108,22 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HeroBuyReq) (code pb
this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update) this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update)
//随机任务 //随机任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype64, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype64, 1)
tasks = append(tasks, comm.GettaskParam(comm.Rtype64, 1))
for _, v := range give { for _, v := range give {
if v.A == comm.ItemType { if v.A == comm.ItemType {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype65, v.N, utils.ToInt32(v.T)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype65, v.N, utils.ToInt32(v.T))
tasks = append(tasks, comm.GettaskParam(comm.Rtype65, v.N, utils.ToInt32(v.T)))
} }
} }
for _, v := range need { for _, v := range need {
if v.A == comm.AttrType && (v.T == comm.ResGold || v.T == comm.ResDiamond) { if v.A == comm.AttrType && (v.T == comm.ResGold || v.T == comm.ResDiamond) {
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))
tasks = append(tasks, comm.GettaskParam(comm.Rtype67, v.N, utils.ToInt32(v.T)))
} }
} }
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), tasks...)
session.SendMsg(string(this.module.GetType()), "buy", &pb.HeroBuyResp{ session.SendMsg(string(this.module.GetType()), "buy", &pb.HeroBuyResp{
IsSucc: true, IsSucc: true,
Onebuy: record.Onebuy + req.BuyCount, Onebuy: record.Onebuy + req.BuyCount,

View File

@ -87,6 +87,7 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c
} }
session.SendMsg(string(this.module.GetType()), HeroFusionResp, &pb.HeroFusionResp{Heroid: conf.Hero}) session.SendMsg(string(this.module.GetType()), HeroFusionResp, &pb.HeroFusionResp{Heroid: conf.Hero})
// 通过融合获得指定英雄 // 通过融合获得指定英雄
this.module.ModuleRtask.SendToRtask(session, comm.Rtype139, utils.ToInt32(conf.Hero)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype139, utils.ToInt32(conf.Hero))
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype139, utils.ToInt32(conf.Hero)))
return return
} }

View File

@ -24,7 +24,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
mapData map[string]interface{} mapData map[string]interface{}
newChallenge bool // 新的关卡 newChallenge bool // 新的关卡
reward []*cfg.Gameatn reward []*cfg.Gameatn
bWin bool // 战斗是否胜利 bWin bool // 战斗是否胜利
tasks []*comm.TaskParam = make([]*comm.TaskParam, 0)
) )
mapData = make(map[string]interface{}, 0) mapData = make(map[string]interface{}, 0)
reward = make([]*cfg.Gameatn, 0) reward = make([]*cfg.Gameatn, 0)
@ -109,13 +110,16 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{Data: hunting}) session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{Data: hunting})
// 随机任务统计 // 随机任务统计
this.module.ModuleRtask.SendToRtask(session, comm.Rtype81, req.Difficulty, req.BossType) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype81, req.Difficulty, req.BossType)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype82, req.BossType) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype82, req.BossType)
tasks = append(tasks, comm.GettaskParam(comm.Rtype81, req.Difficulty, req.BossType))
tasks = append(tasks, comm.GettaskParam(comm.Rtype82, req.BossType))
// 狩猎副本掉落觉醒材料 // 狩猎副本掉落觉醒材料
for _, v := range reward { for _, v := range reward {
if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil { if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil {
if _conf.Usetype == comm.UseType8 { if _conf.Usetype == comm.UseType8 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype154, v.N) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype154, v.N)
tasks = append(tasks, comm.GettaskParam(comm.Rtype154, v.N))
} }
} }
} }
@ -123,10 +127,12 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
for _, v := range cfgHunting.Firstprize { for _, v := range cfgHunting.Firstprize {
if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil { if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil {
if _conf.Usetype == comm.UseType8 { if _conf.Usetype == comm.UseType8 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype154, v.N) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype154, v.N)
tasks = append(tasks, comm.GettaskParam(comm.Rtype154, v.N))
} }
} }
} }
} }
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), tasks...)
return return
} }

View File

@ -97,7 +97,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
// 任务统计 // 任务统计
//赠送英雄礼物并增加N点好感度 //赠送英雄礼物并增加N点好感度
if upLv > 0 { if upLv > 0 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv))
} }
return return

View File

@ -94,7 +94,8 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.MartialhallPrac
this.module.modelMartialhall.Change(session.GetUserId(), map[string]interface{}{ this.module.modelMartialhall.Change(session.GetUserId(), map[string]interface{}{
filed: pillar, filed: pillar,
}) })
this.module.ModuleRtask.SendToRtask(session, comm.Rtype149, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype149, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype149, 1))
session.SendMsg(string(this.module.GetType()), "practice", &pb.MartialhallPracticeResp{Issucc: true, Info: mart}) session.SendMsg(string(this.module.GetType()), "practice", &pb.MartialhallPracticeResp{Issucc: true, Info: mart})
return return
} }

View File

@ -85,7 +85,8 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.MartialhallUnLock
filed: pillar, filed: pillar,
}) })
this.module.ModuleRtask.SendToRtask(session, comm.Rtype152, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype152, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype152, 1))
session.SendMsg(string(this.module.GetType()), "unlock", &pb.MartialhallUnLockResp{Issucc: true, Info: mart}) session.SendMsg(string(this.module.GetType()), "unlock", &pb.MartialhallUnLockResp{Issucc: true, Info: mart})
return return
} }

View File

@ -20,7 +20,8 @@ func settlement(rtask comm.IRtask, session comm.IUserSession, pillar *pb.DBPilla
pillar.State = pb.PillarState_Receive pillar.State = pb.PillarState_Receive
} }
if minutes > 0 { if minutes > 0 {
rtask.SendToRtask(session, comm.Rtype135, minutes) // rtask.SendToRtask(session, comm.Rtype135, minutes)
go rtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype135, 1))
} }
} }
@ -37,7 +38,8 @@ func check(rtask comm.IRtask, session comm.IUserSession, pillar *pb.DBPillar, md
pillar.Lastbill = configure.Now().Unix() pillar.Lastbill = configure.Now().Unix()
pillar.State = pb.PillarState_Receive pillar.State = pb.PillarState_Receive
if minutes > 0 { if minutes > 0 {
rtask.SendToRtask(session, comm.Rtype135, minutes) // rtask.SendToRtask(session, comm.Rtype135, minutes)
go rtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype135, 1))
} }
} }
} }

View File

@ -28,7 +28,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
first bool // 判断是否是首通 first bool // 判断是否是首通
update map[string]interface{} update map[string]interface{}
rsp *pb.MlineChallengeOverResp rsp *pb.MlineChallengeOverResp
star int32 // 评星 star int32 // 评星
tasks []*comm.TaskParam = make([]*comm.TaskParam, 0)
) )
rsp = &pb.MlineChallengeOverResp{} rsp = &pb.MlineChallengeOverResp{}
update = make(map[string]interface{}) update = make(map[string]interface{})
@ -183,8 +184,10 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
rsp.Data = curChapter rsp.Data = curChapter
session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, rsp) // 数据推送 session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, rsp) // 数据推送
// 主线任务统计 Rtype60 // 主线任务统计 Rtype60
this.module.ModuleRtask.SendToRtask(session, comm.Rtype60, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype60, 1)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype61, int32(req.StageId)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype61, int32(req.StageId))
tasks = append(tasks, comm.GettaskParam(comm.Rtype60, 1))
tasks = append(tasks, comm.GettaskParam(comm.Rtype61, int32(req.StageId)))
var ( var (
ChapterStar int32 ChapterStar int32
bAll3Star bool bAll3Star bool
@ -203,10 +206,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
bAll3Star = false bAll3Star = false
} }
} }
tasks = append(tasks, comm.GettaskParam(comm.Rtype158, curChapter.ChapterId, ChapterStar))
this.module.ModuleRtask.SendToRtask(session, comm.Rtype158, curChapter.ChapterId, ChapterStar) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype158, curChapter.ChapterId, ChapterStar)
if bAll3Star { if bAll3Star {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype159, curChapter.ChapterId) tasks = append(tasks, comm.GettaskParam(comm.Rtype159, curChapter.ChapterId))
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype159, curChapter.ChapterId)
} }
for _, v2 := range list { for _, v2 := range list {
for _, v1 := range v2.Star { for _, v1 := range v2.Star {
@ -217,6 +221,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
} }
} }
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype160, allStar) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype160, allStar)
tasks = append(tasks, comm.GettaskParam(comm.Rtype160, allStar))
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), tasks...)
return return
} }

View File

@ -369,7 +369,8 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn
} }
this.Debug("消耗玩家资源", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "attrs", Value: attrs}) this.Debug("消耗玩家资源", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "attrs", Value: attrs})
if count, ok := attrs[comm.ResDiamond]; ok { if count, ok := attrs[comm.ResDiamond]; ok {
this.ModuleRtask.SendToRtask(session, comm.Rtype104, -count) // this.ModuleRtask.SendToRtask(session, comm.Rtype104, -count)
go this.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype104, -count))
} }
} }
if len(items) > 0 { if len(items) > 0 {

View File

@ -47,7 +47,8 @@ func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattle
Buleflist: record.Buleflist, Buleflist: record.Buleflist,
}, },
}) })
this.module.ModuleRtask.SendToRtask(session, comm.Rtype88, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype88, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype88, 1))
} else { } else {
session.SendMsg(string(this.module.GetType()), "battle", &pb.MoonfantasyBattleResp{Code: cd}) session.SendMsg(string(this.module.GetType()), "battle", &pb.MoonfantasyBattleResp{Code: cd})
} }

View File

@ -134,7 +134,8 @@ 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.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype87, 1))
return return
} }
@ -187,7 +188,8 @@ 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) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype87, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype87, 1))
return return
} }

View File

@ -151,7 +151,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
} }
// 任务相关 // 任务相关
this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype59, pagoda.PagodaId) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype59, pagoda.PagodaId)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype58, 1), comm.GettaskParam(comm.Rtype59, pagoda.PagodaId))
return return
} }

View File

@ -158,7 +158,8 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
} }
} }
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(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))
@ -200,7 +201,8 @@ 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) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype105, 1))
} else { //返回以前的商品列表 } else { //返回以前的商品列表
if items, err = this.module.configure.GetShopItemsConfigureByIds(sdata.Items...); err != nil { if items, err = this.module.configure.GetShopItemsConfigureByIds(sdata.Items...); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError

View File

@ -74,12 +74,16 @@ func (this *Smithy) CheckActivateAtlasCollect(uid string, id string) (code pb.Er
func (this *Smithy) SendRdTask(session comm.IUserSession, Items []*pb.UserAssets) { func (this *Smithy) SendRdTask(session comm.IUserSession, Items []*pb.UserAssets) {
var equip map[int32]int32 // key xingji value 数量 var equip map[int32]int32 // key xingji value 数量
equip = make(map[int32]int32, 0) equip = make(map[int32]int32, 0)
tasks := make([]*comm.TaskParam, 0)
for _, v := range Items { for _, v := range Items {
if cfg := this.configure.GetEquipmentConfigureById(v.T); cfg == nil { if cfg := this.configure.GetEquipmentConfigureById(v.T); cfg == nil {
equip[cfg.Star]++ equip[cfg.Star]++
} }
} }
for k, v := range equip { for k, v := range equip {
this.ModuleRtask.SendToRtask(session, comm.Rtype51, v, k) tasks = append(tasks, comm.GettaskParam(comm.Rtype51, v, k))
// this.ModuleRtask.SendToRtask(session, comm.Rtype51, v, k)
} }
go this.ModuleRtask.TriggerTask(session.GetUserId(), tasks...)
} }

View File

@ -56,7 +56,8 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
} }
// 触发任务条件 // 触发任务条件
this.module.ModuleRtask.SendToRtask(session, comm.Rtype109, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype109, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(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",

View File

@ -100,7 +100,8 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
// 无需审核 // 无需审核
if !isCheck { if !isCheck {
// 触发任务条件 // 触发任务条件
this.module.ModuleRtask.SendToRtask(session, comm.Rtype109, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype109, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype109, 1))
} }
rsp := &pb.SociatyApplyResp{ rsp := &pb.SociatyApplyResp{
Uid: uid, Uid: uid,

View File

@ -170,6 +170,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.TrollBuyOrSell
this.module.record.AddTrollRecord(session.GetUserId(), gold, trolltrain.TarinPos) this.module.record.AddTrollRecord(session.GetUserId(), gold, trolltrain.TarinPos)
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype153, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype153, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype153, 1))
return return
} }

View File

@ -140,8 +140,8 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
this.module.RecoverUserPsStart(user.Uid) this.module.RecoverUserPsStart(user.Uid)
// 日常登录任务 // 日常登录任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype8, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype8, 1)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype8, 1))
this.module.ModulePrivilege.CheckDailyPrivilegeMail(session) this.module.ModulePrivilege.CheckDailyPrivilegeMail(session)
rsp.Data = user rsp.Data = user

View File

@ -246,6 +246,7 @@ func (this *Viking) AutoBattleOver(session comm.IUserSession, Report *pb.BattleR
difficulty := autoBattle.Difficulty difficulty := autoBattle.Difficulty
atno = make([]*pb.UserAtno, 0) atno = make([]*pb.UserAtno, 0)
conf := this.configure.GetVikingBossConfigData(bossId, difficulty) conf := this.configure.GetVikingBossConfigData(bossId, difficulty)
tasks := make([]*comm.TaskParam, 0)
// costRes := this.configure.GetGlobalConf().VikingExpeditionCos // costRes := this.configure.GetGlobalConf().VikingExpeditionCos
// if costRes == nil { // if costRes == nil {
// code = pb.ErrorCode_ConfigNoFound // code = pb.ErrorCode_ConfigNoFound
@ -307,17 +308,23 @@ func (this *Viking) AutoBattleOver(session comm.IUserSession, Report *pb.BattleR
} }
} }
// 随机任务统计 // 随机任务统计
this.ModuleRtask.SendToRtask(session, comm.Rtype73, difficulty, bossId, 1) // this.ModuleRtask.SendToRtask(session, comm.Rtype73, difficulty, bossId, 1)
this.ModuleRtask.SendToRtask(session, comm.Rtype74, difficulty, bossId) // this.ModuleRtask.SendToRtask(session, comm.Rtype74, difficulty, bossId)
this.ModuleRtask.SendToRtask(session, comm.Rtype78, difficulty, bossId, Report.Costtime) // this.ModuleRtask.SendToRtask(session, comm.Rtype78, difficulty, bossId, Report.Costtime)
tasks = append(tasks, comm.GettaskParam(comm.Rtype73, difficulty, bossId, 1))
tasks = append(tasks, comm.GettaskParam(comm.Rtype74, difficulty, bossId))
tasks = append(tasks, comm.GettaskParam(comm.Rtype78, difficulty, bossId, Report.Costtime))
if Report != nil && Report.Info != nil && len(Report.Info.Redflist) > 0 { if Report != nil && Report.Info != nil && len(Report.Info.Redflist) > 0 {
for _, v := range Report.Info.Redflist[0].Team { for _, v := range Report.Info.Redflist[0].Team {
if v.Ishelp { // 判断是否有助战 if v.Ishelp { // 判断是否有助战
this.ModuleRtask.SendToRtask(session, comm.Rtype79, difficulty, bossId) // this.ModuleRtask.SendToRtask(session, comm.Rtype79, difficulty, bossId)
tasks = append(tasks, comm.GettaskParam(comm.Rtype78, difficulty, bossId, Report.Costtime))
break break
} }
} }
} }
go this.ModuleRtask.TriggerTask(session.GetUserId(), tasks...)
return return
} }