上传错误信息收集
This commit is contained in:
parent
c3c266557a
commit
0143e85b28
@ -22,6 +22,10 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.AcademyInfoReq) (co
|
|||||||
}
|
}
|
||||||
if info, err = this.module.modelAcademy.queryInfo(session.GetUserId()); err != nil {
|
if info, err = this.module.modelAcademy.queryInfo(session.GetUserId()); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), "info", &pb.AcademyInfoResp{Info: info})
|
session.SendMsg(string(this.module.GetType()), "info", &pb.AcademyInfoResp{Info: info})
|
||||||
|
@ -30,6 +30,10 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe
|
|||||||
if iswin {
|
if iswin {
|
||||||
if info, err = this.module.modelAcademy.queryInfo(session.GetUserId()); err != nil {
|
if info, err = this.module.modelAcademy.queryInfo(session.GetUserId()); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if level, err = this.module.configure.getGameTeaching(req.Level); err != nil {
|
if level, err = this.module.configure.getGameTeaching(req.Level); err != nil {
|
||||||
@ -50,6 +54,10 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe
|
|||||||
}
|
}
|
||||||
if err = this.module.modelAcademy.updateInfo(info); err != nil {
|
if err = this.module.modelAcademy.updateInfo(info); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,10 @@ func (this *apiComp) Teaching(session comm.IUserSession, req *pb.AcademyTeaching
|
|||||||
|
|
||||||
if level, err = this.module.configure.getGameHeroTeaching(req.HeroId); err != nil {
|
if level, err = this.module.configure.getGameHeroTeaching(req.HeroId); err != nil {
|
||||||
cd = pb.ErrorCode_ConfigNoFound
|
cd = pb.ErrorCode_ConfigNoFound
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cd, record = this.module.battle.CreateEveBattle(session, &pb.BattleEVEReq{
|
cd, record = this.module.battle.CreateEveBattle(session, &pb.BattleEVEReq{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package academy
|
package academy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
@ -18,7 +19,6 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT
|
|||||||
iswin bool
|
iswin bool
|
||||||
level *cfg.GameHeroStrategyData
|
level *cfg.GameHeroStrategyData
|
||||||
info *pb.DBAcademy
|
info *pb.DBAcademy
|
||||||
// group []*cfg.GameTeachingData
|
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if code = this.TeachingReceiveCheck(session, req); code != pb.ErrorCode_Success {
|
if code = this.TeachingReceiveCheck(session, req); code != pb.ErrorCode_Success {
|
||||||
@ -30,14 +30,26 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT
|
|||||||
if iswin {
|
if iswin {
|
||||||
if info, err = this.module.modelAcademy.queryInfo(session.GetUserId()); err != nil {
|
if info, err = this.module.modelAcademy.queryInfo(session.GetUserId()); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if level, err = this.module.configure.getGameHeroTeaching(req.HeroId); err != nil {
|
if level, err = this.module.configure.getGameHeroTeaching(req.HeroId); err != nil {
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if req.Report.Completetask == nil || len(req.Report.Completetask) != len(level.Task) {
|
if req.Report.Completetask == nil || len(req.Report.Completetask) != len(level.Task) {
|
||||||
code = pb.ErrorCode_AcademyTaskNoCompleteTask
|
code = pb.ErrorCode_AcademyTaskNoCompleteTask
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: fmt.Sprintf("目标任务:%v 完成任务:%v", level.Task, req.Report.Completetask),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !info.Hero[req.HeroId] {
|
if !info.Hero[req.HeroId] {
|
||||||
@ -45,6 +57,10 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT
|
|||||||
}
|
}
|
||||||
if err = this.module.modelAcademy.updateInfo(info); err != nil {
|
if err = this.module.modelAcademy.updateInfo(info); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.module.DispenseRes(session, level.Award, true)
|
this.module.DispenseRes(session, level.Award, true)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package academy
|
package academy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
@ -71,7 +70,7 @@ func (this *configureComp) getGameHeroTeaching(id string) (result *cfg.GameHeroS
|
|||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
} else {
|
} else {
|
||||||
if result, ok = v.(*cfg.GameHeroStrategy).GetDataMap()[id]; !ok {
|
if result, ok = v.(*cfg.GameHeroStrategy).GetDataMap()[id]; !ok {
|
||||||
err = fmt.Errorf("on found GameMonster:%s", id)
|
err = comm.NewNotFoundConfErr(moduleName, game_herostrategy, id)
|
||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package arena
|
package arena
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/sys/mgo"
|
"go_dreamfactory/lego/sys/mgo"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
@ -25,16 +26,28 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (code p
|
|||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if code = this.BuyCheck(session, req); code != pb.ErrorCode_Success {
|
if code = this.BuyCheck(session, req); code != pb.ErrorCode_Success {
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: fmt.Sprintf("请求参数:%+v", req),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if info, err = this.module.modelArena.queryPlayerInfo(session.GetUserId()); err != nil && err != mgo.MongodbNil {
|
if info, err = this.module.modelArena.queryPlayerInfo(session.GetUserId()); err != nil && err != mgo.MongodbNil {
|
||||||
code = pb.ErrorCode_CacheReadError
|
code = pb.ErrorCode_CacheReadError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.module.modelArena.recoverTicket(session, info)
|
this.module.modelArena.recoverTicket(session, info)
|
||||||
|
|
||||||
if maxbuy, err = this.module.ModuleTools.GetPriceGroupLen(comm.ArenaBuyType); err != nil {
|
if maxbuy, err = this.module.ModuleTools.GetPriceGroupLen(comm.ArenaBuyType); err != nil {
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
vipbuy = this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType5)
|
vipbuy = this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType5)
|
||||||
@ -44,17 +57,16 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (code p
|
|||||||
code = pb.ErrorCode_ArenaTicketBuyUp
|
code = pb.ErrorCode_ArenaTicketBuyUp
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if res, _ := this.module.ModuleTools.GetPriceGroupCost(comm.ArenaBuyType, info.Buynum+i+1); len(res) > 0 {
|
if res, err := this.module.ModuleTools.GetPriceGroupCost(comm.ArenaBuyType, info.Buynum+i+1); len(res) > 0 {
|
||||||
need = append(need, res...)
|
need = append(need, res...)
|
||||||
} else {
|
} else {
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if challenge, err = this.module.configure.GetchallengeData(info.Buynum + i + 1); err != nil || challenge == nil {
|
|
||||||
// code = pb.ErrorCode_ConfigNoFound
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// need = append(need, challenge.Need...)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if code = this.module.ConsumeRes(session, need, true); code != pb.ErrorCode_Success {
|
if code = this.module.ConsumeRes(session, need, true); code != pb.ErrorCode_Success {
|
||||||
@ -67,6 +79,10 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (code p
|
|||||||
// info.Ticket += req.BuyNum
|
// info.Ticket += req.BuyNum
|
||||||
if err = this.module.modelArena.updateArenaUserInfo(info); err != nil {
|
if err = this.module.modelArena.updateArenaUserInfo(info); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), "buy", &pb.MoonfantasyBuyResp{Issucc: true, BattleNum: info.Buynum})
|
session.SendMsg(string(this.module.GetType()), "buy", &pb.MoonfantasyBuyResp{Issucc: true, BattleNum: info.Buynum})
|
||||||
|
@ -50,19 +50,16 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
|
|||||||
}
|
}
|
||||||
if red, err = this.module.modelArena.queryPlayerInfo(session.GetUserId()); err != nil {
|
if red, err = this.module.modelArena.queryPlayerInfo(session.GetUserId()); err != nil {
|
||||||
cd = pb.ErrorCode_DBError
|
cd = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.module.modelArena.recoverTicket(session, red)
|
this.module.modelArena.recoverTicket(session, red)
|
||||||
if cd = this.module.ConsumeRes(session, []*cfg.Gameatn{this.module.ModuleTools.GetGlobalConf().ArenaTicketCos}, true); cd != pb.ErrorCode_Success {
|
if cd = this.module.ConsumeRes(session, []*cfg.Gameatn{this.module.ModuleTools.GetGlobalConf().ArenaTicketCos}, true); cd != pb.ErrorCode_Success {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if red.Ticket > this.module.ModuleTools.GetGlobalConf().ArenaTicketCos {
|
|
||||||
// red.Ticket -= this.module.ModuleTools.GetGlobalConf().ArenaTicketCos
|
|
||||||
// } else {
|
|
||||||
// code = pb.ErrorCode_ArenaTicketNotEnough
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
if red.Attack != nil {
|
if red.Attack != nil {
|
||||||
for i, v := range req.Battle.Format {
|
for i, v := range req.Battle.Format {
|
||||||
if red.Attack.Formt[i].Id != v {
|
if red.Attack.Formt[i].Id != v {
|
||||||
@ -76,6 +73,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
|
|||||||
if red.Defend == nil || change {
|
if red.Defend == nil || change {
|
||||||
if heros, err = this.module.modelArena.queryUserHeros(session.GetUserId(), req.Battle.Format); err != nil {
|
if heros, err = this.module.modelArena.queryUserHeros(session.GetUserId(), req.Battle.Format); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if red.Defend == nil {
|
if red.Defend == nil {
|
||||||
@ -96,11 +97,19 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
|
|||||||
if !req.Isai {
|
if !req.Isai {
|
||||||
if bule, err = this.module.modelArena.queryArenaPlayer(req.Playerid); err != nil {
|
if bule, err = this.module.modelArena.queryArenaPlayer(req.Playerid); err != nil {
|
||||||
cd = pb.ErrorCode_DBError
|
cd = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if bule, err = this.module.modelArena.getAI(req.MformatId); err != nil {
|
if bule, err = this.module.modelArena.getAI(req.MformatId); err != nil {
|
||||||
cd = pb.ErrorCode_DBError
|
cd = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,6 +127,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
|
|||||||
red.Prededuction = -1 * redplay.Changeintegral
|
red.Prededuction = -1 * redplay.Changeintegral
|
||||||
if err = this.module.modelArena.updateArenaUserInfo(red); err != nil {
|
if err = this.module.modelArena.updateArenaUserInfo(red); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cd, record = this.module.battle.CreatePvpBattle(session, &pb.BattlePVPReq{
|
cd, record = this.module.battle.CreatePvpBattle(session, &pb.BattlePVPReq{
|
||||||
|
@ -32,6 +32,10 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
|
|||||||
}
|
}
|
||||||
if info, err = this.module.modelArena.queryPlayerInfo(session.GetUserId()); err != nil {
|
if info, err = this.module.modelArena.queryPlayerInfo(session.GetUserId()); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if req.Iswin {
|
if req.Iswin {
|
||||||
@ -44,7 +48,12 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
|
|||||||
}
|
}
|
||||||
info.Streak++
|
info.Streak++
|
||||||
if reward, err = this.module.configure.getActiveRewardById(info.Dan); err != nil {
|
if reward, err = this.module.configure.getActiveRewardById(info.Dan); err != nil {
|
||||||
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
|
data = &pb.ErrorData{
|
||||||
|
Title: pb.GetErrorCodeMsg(code),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if code = this.module.DispenseRes(session, reward.WinReward, true); code != pb.ErrorCode_Success {
|
if code = this.module.DispenseRes(session, reward.WinReward, true); code != pb.ErrorCode_Success {
|
||||||
|
@ -2,6 +2,7 @@ package arena
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/sys/configure"
|
"go_dreamfactory/sys/configure"
|
||||||
@ -90,7 +91,7 @@ func (this *configureComp) getActiveRewardById(lv int32) (result *cfg.GameArenaA
|
|||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
} else {
|
} else {
|
||||||
if result, ok = v.(*cfg.GameArenaActiveReward).GetDataMap()[lv]; !ok {
|
if result, ok = v.(*cfg.GameArenaActiveReward).GetDataMap()[lv]; !ok {
|
||||||
err = fmt.Errorf("未找到段位:%d配置", lv)
|
err = comm.NewNotFoundConfErr("", game_arenaactivereward, lv)
|
||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,10 @@ func (this *Buried) OnInstallComp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 跨服埋点触发
|
// 跨服埋点触发
|
||||||
func (this *Buried) Rpc_ModuleBuriedTrigger(ctx context.Context, args *pb.Rpc_ModuleBuriedTriggerReq, reply *pb.Rpc_ModuleBuriedTriggerResp) {
|
func (this *Buried) Rpc_ModuleBuriedTrigger(ctx context.Context, args *pb.Rpc_ModuleBuriedTriggerReq, reply *pb.Rpc_ModuleBuriedTriggerResp) (err error) {
|
||||||
this.Debug("跨服埋点触发!", log.Field{Key: "uid", Value: args.Uid}, log.Field{Key: "burieds", Value: args.Burieds})
|
this.Debug("跨服埋点触发!", log.Field{Key: "uid", Value: args.Uid}, log.Field{Key: "burieds", Value: args.Burieds})
|
||||||
this.trigger(args.Uid, args.Burieds...)
|
this.trigger(args.Uid, args.Burieds...)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//激活数据采集点
|
//激活数据采集点
|
||||||
|
@ -91,7 +91,6 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
a.module.ModuleBuried.ActiveCondition(uid, utils.NoContain(rsp.CondiIds, curTaskConf.Completetask)...)
|
a.module.ModuleBuried.ActiveCondition(uid, utils.NoContain(rsp.CondiIds, curTaskConf.Completetask)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a.sendMsg(session, WorldtaskSubtypeAccept, rsp)
|
a.sendMsg(session, WorldtaskSubtypeAccept, rsp)
|
||||||
|
@ -119,7 +119,7 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
this.sendMsg(session, WorldtaskSubtypeFinish, rsp)
|
this.sendMsg(session, WorldtaskSubtypeFinish, rsp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.sendMsg(session, WorldtaskSubtypeFinish, rsp)
|
||||||
// 完成任务
|
// 完成任务
|
||||||
if err := this.module.modelWorldtask.finishTask(req.GroupId, req.TaskId, userTask); err != nil {
|
if err := this.module.modelWorldtask.finishTask(req.GroupId, req.TaskId, userTask); err != nil {
|
||||||
code = pb.ErrorCode_WorldtaskFinish
|
code = pb.ErrorCode_WorldtaskFinish
|
||||||
|
@ -35,7 +35,7 @@ func (this *Worldtask) Init(service core.IService, module core.IModule, options
|
|||||||
|
|
||||||
func (this *Worldtask) OnInstallComp() {
|
func (this *Worldtask) OnInstallComp() {
|
||||||
this.ModuleBase.OnInstallComp()
|
this.ModuleBase.OnInstallComp()
|
||||||
event.RegisterGO(comm.EventBuriedComplete, this.TCondFinishNotify)
|
event.Register(comm.EventBuriedComplete, this.TCondFinishNotify)
|
||||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||||
this.modelWorldtask = this.RegisterComp(new(ModelWorldtask)).(*ModelWorldtask)
|
this.modelWorldtask = this.RegisterComp(new(ModelWorldtask)).(*ModelWorldtask)
|
||||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||||
@ -57,16 +57,15 @@ func (this *Worldtask) Start() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *Worldtask) TCondFinishNotify(uid string, conids []int32) {
|
func (this *Worldtask) TCondFinishNotify(uid string, conids []int32) {
|
||||||
|
this.Debug("世界任务完成条件通知", log.Field{Key: "uid", Value: uid}, log.Field{Key: "condIds", Value: conids})
|
||||||
|
|
||||||
session, ok := this.GetUserSession(uid)
|
session, ok := this.GetUserSession(uid)
|
||||||
defer func() {
|
defer func() {
|
||||||
|
if ok {
|
||||||
session.Push()
|
session.Push()
|
||||||
|
}
|
||||||
this.PutUserSession(session)
|
this.PutUserSession(session)
|
||||||
}()
|
}()
|
||||||
if !ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.Debug("世界任务完成条件通知", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "condIds", Value: conids})
|
|
||||||
|
|
||||||
// 玩家世界任务
|
// 玩家世界任务
|
||||||
userTask, err := this.modelWorldtask.getWorldtask(uid)
|
userTask, err := this.modelWorldtask.getWorldtask(uid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -97,6 +96,7 @@ func (this *Worldtask) TCondFinishNotify(uid string, conids []int32) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if len(finishedTaskIds) == 0 {
|
if len(finishedTaskIds) == 0 {
|
||||||
// this.Debug("未找到当前世界任务",
|
// this.Debug("未找到当前世界任务",
|
||||||
// log.Field{Key: "uid", Value: uid},
|
// log.Field{Key: "uid", Value: uid},
|
||||||
|
Loading…
Reference in New Issue
Block a user