diff --git a/modules/academy/api_receive.go b/modules/academy/api_receive.go index e26844f9f..99ad27cd4 100644 --- a/modules/academy/api_receive.go +++ b/modules/academy/api_receive.go @@ -52,7 +52,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe } 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}) return diff --git a/modules/arena/api_challenge.go b/modules/arena/api_challenge.go index ea99b3baa..d8574f3b5 100644 --- a/modules/arena/api_challenge.go +++ b/modules/arena/api_challenge.go @@ -40,7 +40,8 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge Buleflist: record.Buleflist, 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 { session.SendMsg(string(this.module.GetType()), "challenge", &pb.ArenaChallengeResp{Code: cd, Info: nil}) } diff --git a/modules/arena/api_challengereward.go b/modules/arena/api_challengereward.go index 7c27069e4..29ff7120d 100644 --- a/modules/arena/api_challengereward.go +++ b/modules/arena/api_challengereward.go @@ -63,7 +63,8 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha redstate = pb.BattleRecordState_AttackWin 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 { if req.Revengeid != "" { redstate = pb.BattleRecordState_RevengeFailed @@ -224,7 +225,8 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha code = pb.ErrorCode_DBError } } - this.module.ModuleRtask.SendToRtask(session, comm.Rtype128, red.Integral) - this.module.ModuleRtask.SendToRtask(session, comm.Rtype129, red.Dan) + this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype128, red.Integral), comm.GettaskParam(comm.Rtype129, red.Dan)) + // this.module.ModuleRtask.SendToRtask(session, comm.Rtype128, red.Integral) + // this.module.ModuleRtask.SendToRtask(session, comm.Rtype129, red.Dan) return } diff --git a/modules/battle/module.go b/modules/battle/module.go index 1db6464ec..ddfd2ea0f 100644 --- a/modules/battle/module.go +++ b/modules/battle/module.go @@ -138,7 +138,8 @@ func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVE } for _, v := range req.Format.Friendformat { 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 } } @@ -247,7 +248,8 @@ func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLP } for _, v := range req.Format.Friendformat { 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 } } @@ -375,7 +377,8 @@ func (this *Battle) CheckBattleReport(session comm.IUserSession, report *pb.Batt } this.moonfantasy.Trigger(session, report) 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 } diff --git a/modules/chat/api_send.go b/modules/chat/api_send.go index 507ed5748..7bac939e4 100644 --- a/modules/chat/api_send.go +++ b/modules/chat/api_send.go @@ -75,7 +75,8 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code msg.Content = wordfilter.Replace(msg.Content, '*') } 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( // context.Background(), @@ -116,7 +117,8 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code msg.ChannelId = userexpand.Chatchannel //指定频道 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 default: code = pb.ErrorCode_ReqParameterError diff --git a/modules/combat/api_challengereceive.go b/modules/combat/api_challengereceive.go index f0c9d3458..d5dc89794 100644 --- a/modules/combat/api_challengereceive.go +++ b/modules/combat/api_challengereceive.go @@ -92,7 +92,8 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC if pass { lv.Pass = 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)) if err = this.module.modelCombat.updateInfo(info); err != nil { diff --git a/modules/combat/api_drop.go b/modules/combat/api_drop.go index cdde94f0f..75d1b60c4 100644 --- a/modules/combat/api_drop.go +++ b/modules/combat/api_drop.go @@ -100,7 +100,8 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod if pass { lv.Pass = 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)) if err = this.module.modelCombat.updateInfo(info); err != nil { diff --git a/modules/equipment/api_ench.go b/modules/equipment/api_ench.go index 8dc08e463..02cc5cfee 100644 --- a/modules/equipment/api_ench.go +++ b/modules/equipment/api_ench.go @@ -91,7 +91,8 @@ func (this *apiComp) Ench(session comm.IUserSession, req *pb.EquipmentEnchReq) ( 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}) return } diff --git a/modules/equipment/api_wash.go b/modules/equipment/api_wash.go index 506068fa1..49aeebf0c 100644 --- a/modules/equipment/api_wash.go +++ b/modules/equipment/api_wash.go @@ -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)), } } - 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}) return } diff --git a/modules/friend/api_cross_agree.go b/modules/friend/api_cross_agree.go index ea532851d..216c6838e 100644 --- a/modules/friend/api_cross_agree.go +++ b/modules/friend/api_cross_agree.go @@ -136,8 +136,8 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c } // 拥有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{ Num: optNum, } diff --git a/modules/friend/api_cross_assisthero.go b/modules/friend/api_cross_assisthero.go index 14aafa7dc..0eb79df7d 100644 --- a/modules/friend/api_cross_assisthero.go +++ b/modules/friend/api_cross_assisthero.go @@ -99,7 +99,7 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth } // 随机任务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 } diff --git a/modules/friend/api_cross_zan.go b/modules/friend/api_cross_zan.go index 5b33ba214..87097b44c 100644 --- a/modules/friend/api_cross_zan.go +++ b/modules/friend/api_cross_zan.go @@ -101,6 +101,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code } // 赠送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 } diff --git a/modules/gourmet/api_createorder.go b/modules/gourmet/api_createorder.go index 5fe5dc028..ff54ee241 100644 --- a/modules/gourmet/api_createorder.go +++ b/modules/gourmet/api_createorder.go @@ -143,6 +143,7 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat for _, v := range req.Order { 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 } diff --git a/modules/gourmet/api_getlist.go b/modules/gourmet/api_getlist.go index 3b2d90080..c791c1fb6 100644 --- a/modules/gourmet/api_getlist.go +++ b/modules/gourmet/api_getlist.go @@ -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}) // 任务统计 - 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 } diff --git a/modules/hero/api_buy.go b/modules/hero/api_buy.go index 62f9009cb..5f59ae77c 100644 --- a/modules/hero/api_buy.go +++ b/modules/hero/api_buy.go @@ -31,6 +31,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HeroBuyReq) (code pb price []int32 // 购买所需的价钱 totalCost float64 // 购买打折系数 udata *pb.DBUser + tasks []*comm.TaskParam = make([]*comm.TaskParam, 0) ) update = make(map[string]interface{}) 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.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 { 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 { 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{ IsSucc: true, Onebuy: record.Onebuy + req.BuyCount, diff --git a/modules/hero/api_fusion.go b/modules/hero/api_fusion.go index f7f3bac29..8658c4d04 100644 --- a/modules/hero/api_fusion.go +++ b/modules/hero/api_fusion.go @@ -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}) // 通过融合获得指定英雄 - 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 } diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index 7c28a040f..3ca137135 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -24,7 +24,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha mapData map[string]interface{} newChallenge bool // 新的关卡 reward []*cfg.Gameatn - bWin bool // 战斗是否胜利 + bWin bool // 战斗是否胜利 + tasks []*comm.TaskParam = make([]*comm.TaskParam, 0) ) mapData = make(map[string]interface{}, 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}) // 随机任务统计 - 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.Rtype81, req.Difficulty, 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 { if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil { 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 { if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil { 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 } diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index b50eb1efe..130fab6ba 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -97,7 +97,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe // 任务统计 //赠送英雄礼物并增加N点好感度 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 diff --git a/modules/martialhall/api_practice.go b/modules/martialhall/api_practice.go index ed1ef801f..06646038d 100644 --- a/modules/martialhall/api_practice.go +++ b/modules/martialhall/api_practice.go @@ -94,7 +94,8 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.MartialhallPrac this.module.modelMartialhall.Change(session.GetUserId(), map[string]interface{}{ 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}) return } diff --git a/modules/martialhall/api_unlock.go b/modules/martialhall/api_unlock.go index 927eebe02..5ffc60879 100644 --- a/modules/martialhall/api_unlock.go +++ b/modules/martialhall/api_unlock.go @@ -85,7 +85,8 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.MartialhallUnLock 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}) return } diff --git a/modules/martialhall/core.go b/modules/martialhall/core.go index b5f61180f..ffd9418bb 100644 --- a/modules/martialhall/core.go +++ b/modules/martialhall/core.go @@ -20,7 +20,8 @@ func settlement(rtask comm.IRtask, session comm.IUserSession, pillar *pb.DBPilla pillar.State = pb.PillarState_Receive } 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.State = pb.PillarState_Receive 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)) } } } diff --git a/modules/mline/api_challengeover.go b/modules/mline/api_challengeover.go index 6cbca2010..87273782e 100644 --- a/modules/mline/api_challengeover.go +++ b/modules/mline/api_challengeover.go @@ -28,7 +28,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall first bool // 判断是否是首通 update map[string]interface{} rsp *pb.MlineChallengeOverResp - star int32 // 评星 + star int32 // 评星 + tasks []*comm.TaskParam = make([]*comm.TaskParam, 0) ) rsp = &pb.MlineChallengeOverResp{} update = make(map[string]interface{}) @@ -183,8 +184,10 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall rsp.Data = curChapter session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, rsp) // 数据推送 // 主线任务统计 Rtype60 - this.module.ModuleRtask.SendToRtask(session, comm.Rtype60, 1) - this.module.ModuleRtask.SendToRtask(session, comm.Rtype61, int32(req.StageId)) + // this.module.ModuleRtask.SendToRtask(session, comm.Rtype60, 1) + // 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 ( ChapterStar int32 bAll3Star bool @@ -203,10 +206,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall bAll3Star = false } } - - this.module.ModuleRtask.SendToRtask(session, comm.Rtype158, curChapter.ChapterId, ChapterStar) + tasks = append(tasks, comm.GettaskParam(comm.Rtype158, curChapter.ChapterId, ChapterStar)) + // this.module.ModuleRtask.SendToRtask(session, comm.Rtype158, curChapter.ChapterId, ChapterStar) 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 _, 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 } diff --git a/modules/modulebase.go b/modules/modulebase.go index 5e5293239..0d6d36f00 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -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}) 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 { diff --git a/modules/moonfantasy/api_battle.go b/modules/moonfantasy/api_battle.go index e3cfb150c..006a32fd9 100644 --- a/modules/moonfantasy/api_battle.go +++ b/modules/moonfantasy/api_battle.go @@ -47,7 +47,8 @@ func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattle 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 { session.SendMsg(string(this.module.GetType()), "battle", &pb.MoonfantasyBattleResp{Code: cd}) } diff --git a/modules/moonfantasy/modelDream.go b/modules/moonfantasy/modelDream.go index e2e6dbcc0..7938b0785 100644 --- a/modules/moonfantasy/modelDream.go +++ b/modules/moonfantasy/modelDream.go @@ -134,7 +134,8 @@ func (this *modelDreamComp) trigger(session comm.IUserSession) { } 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}) - 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 } @@ -187,7 +188,8 @@ func (this *modelDreamComp) triggerbyid(session comm.IUserSession, boosid string } 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}) - 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 } diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index 68b003d06..ce8923022 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -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.Rtype59, pagoda.PagodaId) + // this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1) + // 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 } diff --git a/modules/shop/api_getlist.go b/modules/shop/api_getlist.go index de02abc66..882ac2b5c 100644 --- a/modules/shop/api_getlist.go +++ b/modules/shop/api_getlist.go @@ -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}) } else if !req.IsManualRefresh { // 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) 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 { //返回以前的商品列表 if items, err = this.module.configure.GetShopItemsConfigureByIds(sdata.Items...); err != nil { code = pb.ErrorCode_SystemError diff --git a/modules/smithy/module.go b/modules/smithy/module.go index 1b7b10201..0cf0a0062 100644 --- a/modules/smithy/module.go +++ b/modules/smithy/module.go @@ -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) { var equip map[int32]int32 // key xingji value 数量 equip = make(map[int32]int32, 0) + tasks := make([]*comm.TaskParam, 0) for _, v := range Items { if cfg := this.configure.GetEquipmentConfigureById(v.T); cfg == nil { equip[cfg.Star]++ } } 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...) } diff --git a/modules/sociaty/api_cross_agree.go b/modules/sociaty/api_cross_agree.go index 7cacc210e..21489652d 100644 --- a/modules/sociaty/api_cross_agree.go +++ b/modules/sociaty/api_cross_agree.go @@ -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 { this.module.Error("发送邮件 模板ID:GuildApproved", diff --git a/modules/sociaty/api_cross_apply.go b/modules/sociaty/api_cross_apply.go index ee79d6fd0..debae6de7 100644 --- a/modules/sociaty/api_cross_apply.go +++ b/modules/sociaty/api_cross_apply.go @@ -100,7 +100,8 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) ( // 无需审核 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{ Uid: uid, diff --git a/modules/troll/api_buyorsell.go b/modules/troll/api_buyorsell.go index 368dbce18..54812627e 100644 --- a/modules/troll/api_buyorsell.go +++ b/modules/troll/api_buyorsell.go @@ -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.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 } diff --git a/modules/user/api_login.go b/modules/user/api_login.go index 73e055e0c..524421a7d 100644 --- a/modules/user/api_login.go +++ b/modules/user/api_login.go @@ -140,8 +140,8 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod 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) rsp.Data = user diff --git a/modules/viking/module.go b/modules/viking/module.go index c5d3ec679..6a3ed7185 100644 --- a/modules/viking/module.go +++ b/modules/viking/module.go @@ -246,6 +246,7 @@ func (this *Viking) AutoBattleOver(session comm.IUserSession, Report *pb.BattleR difficulty := autoBattle.Difficulty atno = make([]*pb.UserAtno, 0) conf := this.configure.GetVikingBossConfigData(bossId, difficulty) + tasks := make([]*comm.TaskParam, 0) // costRes := this.configure.GetGlobalConf().VikingExpeditionCos // if costRes == nil { // 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.Rtype74, difficulty, bossId) - this.ModuleRtask.SendToRtask(session, comm.Rtype78, difficulty, bossId, Report.Costtime) + // this.ModuleRtask.SendToRtask(session, comm.Rtype73, difficulty, bossId, 1) + // this.ModuleRtask.SendToRtask(session, comm.Rtype74, difficulty, bossId) + // 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 { for _, v := range Report.Info.Redflist[0].Team { 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 } } } + + go this.ModuleRtask.TriggerTask(session.GetUserId(), tasks...) return }