diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index b12a43f1a..f637ac7bf 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -293,7 +293,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade if len(tasks) > 0 { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype95, 1)) + this.module.ModuleBuried.TriggerBuried(session, tasks...) }) } return diff --git a/modules/sociaty/model_sociatytask.go b/modules/sociaty/model_sociatytask.go index 2e40ed6b1..0c9bcb6cc 100644 --- a/modules/sociaty/model_sociatytask.go +++ b/modules/sociaty/model_sociatytask.go @@ -8,7 +8,6 @@ import ( "go_dreamfactory/modules" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" - "go_dreamfactory/utils" "go.mongodb.org/mongo-driver/bson" ) @@ -36,27 +35,27 @@ func (this *ModelSociatyTask) initSociatyTask(uid, sociatyId string) error { var taskList []*pb.SociatyTask taskListConf := this.moduleSociaty.sociatyTaskConf.GetDataList() - globalConf := this.moduleSociaty.globalConf + // globalConf := this.moduleSociaty.globalConf var condIds []int32 // 大于4条配置 - if len(taskListConf) > int(globalConf.GuildTaskNum) { - // 按照权重 - //随机4条任务 - randInts := utils.RandomNumbers(0, len(taskListConf)-1, int(globalConf.GuildTaskNum)) - for _, v := range randInts { - taskList = append(taskList, &pb.SociatyTask{ - TaskId: taskListConf[v].TypeId, - }) - condIds = append(condIds, taskListConf[v].TypeId) - } - } else { - for _, v := range taskListConf { - taskList = append(taskList, &pb.SociatyTask{ - TaskId: v.TypeId, - }) - condIds = append(condIds, v.TypeId) - } + // if len(taskListConf) > int(globalConf.GuildTaskNum) { + // // 按照权重 + // //随机4条任务 + // randInts := utils.RandomNumbers(0, len(taskListConf)-1, int(globalConf.GuildTaskNum)) + // for _, v := range randInts { + // taskList = append(taskList, &pb.SociatyTask{ + // TaskId: taskListConf[v].TypeId, + // }) + // condIds = append(condIds, taskListConf[v].TypeId) + // } + // } else { + for _, v := range taskListConf { + taskList = append(taskList, &pb.SociatyTask{ + TaskId: v.TypeId, + }) + condIds = append(condIds, v.TypeId) } + // } sociatyTask.TaskList = taskList sociatyTask.LastUpdateTime = configure.Now().Unix() // 激活所有任务 diff --git a/modules/sociaty/module.go b/modules/sociaty/module.go index 08b5c27c1..939db4120 100644 --- a/modules/sociaty/module.go +++ b/modules/sociaty/module.go @@ -323,48 +323,49 @@ type TaskParams struct { } // 任务条件达成通知 +// 废弃 不需要主动推送任务变化 前端主动刷新页面即可 func (this *Sociaty) BuriedsNotify(session comm.IUserSession, conds []*pb.ConIProgress) { - log.Debug("公会任务通知", - log.Field{Key: "uid", Value: session.GetUserId()}, - log.Field{Key: "condIds", Value: conds}) + // log.Debug("公会任务通知", + // log.Field{Key: "uid", Value: session.GetUserId()}, + // log.Field{Key: "condIds", Value: conds}) - sociaty := this.modelSociaty.getUserSociaty(session.GetUserId()) - if sociaty == nil { - return - } + // sociaty := this.modelSociaty.getUserSociaty(session.GetUserId()) + // if sociaty == nil { + // return + // } - sociatyId := sociaty.Id + // sociatyId := sociaty.Id - dt := &pb.DBSociatyTask{} - err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), - comm.Service_Worker, string(comm.Rpc_ModuleSociatyGetTask), - &pb.RPCGeneralReqA2{Param1: sociatyId, Param2: session.GetUserId()}, dt) + // dt := &pb.DBSociatyTask{} + // err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), + // comm.Service_Worker, string(comm.Rpc_ModuleSociatyGetTask), + // &pb.RPCGeneralReqA2{Param1: sociatyId, Param2: session.GetUserId()}, dt) - var flag bool - for _, v := range dt.TaskList { - for _, cond := range conds { - if v.TaskId == cond.Conid && cond.State == pb.BuriedItemFinishState_buried_finish { - v.Status = 1 - flag = true - } - } - } - if !flag { - return - } + // var flag bool + // for _, v := range dt.TaskList { + // for _, cond := range conds { + // if v.TaskId == cond.Conid && cond.State == pb.BuriedItemFinishState_buried_finish { + // v.Status = 1 + // flag = true + // } + // } + // } + // if !flag { + // return + // } - update := map[string]interface{}{ - "taskList": dt.TaskList, - "lastUpdateTime": configure.Now().Unix(), - } + // update := map[string]interface{}{ + // "taskList": dt.TaskList, + // "lastUpdateTime": configure.Now().Unix(), + // } - err = this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), - comm.Service_Worker, string(comm.Rpc_ModuleSociatyTask), - &TaskParams{SociatyId: sociatyId, Uid: session.GetUserId(), Data: update}, &pb.EmptyResp{}) - if err != nil { - return - } - return + // err = this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), + // comm.Service_Worker, string(comm.Rpc_ModuleSociatyTask), + // &TaskParams{SociatyId: sociatyId, Uid: session.GetUserId(), Data: update}, &pb.EmptyResp{}) + // if err != nil { + // return + // } + // return } func (this *Sociaty) RpcUpdateUserTask(ctx context.Context, p *TaskParams, reply *pb.EmptyResp) error { diff --git a/modules/user/model_user.go b/modules/user/model_user.go index 36688955e..a2254db48 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -102,12 +102,12 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser, err error) { this.module.Errorln(err) } else { if err = model.Get(uid, user); err != nil { - this.module.Errorf("err:%v", err) + this.module.Errorf("uid:%s err:%v", uid, err) } } } else { if err = this.Get(uid, user); err != nil { - this.module.Errorf("err:%v", err) + this.module.Errorf("uid:%s err:%v", uid, err) } } return