This commit is contained in:
meixiongfeng 2023-06-15 23:52:12 +08:00
commit 8741b5fecd
10 changed files with 90 additions and 42 deletions

View File

@ -9,6 +9,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"math/rand"
)
@ -42,7 +43,7 @@ func (this *Gourmet) OnInstallComp() {
}
//红点查询
func (this *Gourmet) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
func (this *Gourmet) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
return
}

View File

@ -168,12 +168,15 @@ func (this *Hunting) CheckRank(uid string, boosID int32, difficulty int32, repor
}
//红点查询
func (this *Hunting) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
func (this *Hunting) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
switch v {
case comm.Reddot14102:
reddot[comm.Reddot14102] = this.modelHunting.checkReddot32(session)
reddot[comm.Reddot14102] = &pb.ReddotItem{
Rid: int32(comm.Reddot14102),
Activated: this.modelHunting.checkReddot32(session),
}
break
}
}

View File

@ -293,21 +293,33 @@ func (this *Library) QueryFavorabilityByRace(uid string, race int32) int32 {
}
// 红点
func (this *Library) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
func (this *Library) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
switch v {
case comm.Reddot19105:
reddot[comm.Reddot19105] = this.modelLibrary.checkReddot19105(session.GetUserId())
reddot[comm.Reddot19105] = &pb.ReddotItem{
Rid: int32(comm.Reddot19105),
Activated: this.modelLibrary.checkReddot19105(session.GetUserId()),
}
break
case comm.Reddot19103:
reddot[comm.Reddot19103] = this.modelFetter.checkReddot19103(session.GetUserId())
reddot[comm.Reddot19103] = &pb.ReddotItem{
Rid: int32(comm.Reddot19103),
Activated: this.modelFetter.checkReddot19103(session.GetUserId()),
}
break
case comm.Reddot19109:
reddot[comm.Reddot19109] = this.modelLibrary.checkReddot19109(session.GetUserId())
reddot[comm.Reddot19109] = &pb.ReddotItem{
Rid: int32(comm.Reddot19109),
Activated: this.modelLibrary.checkReddot19109(session.GetUserId()),
}
break
case comm.Reddot19110:
reddot[comm.Reddot19110] = this.modelLibrary.checkReddot19110(session.GetUserId())
reddot[comm.Reddot19110] = &pb.ReddotItem{
Rid: int32(comm.Reddot19110),
Activated: this.modelLibrary.checkReddot19110(session.GetUserId()),
}
break
}
}

View File

@ -102,22 +102,34 @@ func (this *Mail) SendNewMail(mail *pb.DBMailData, uid ...string) bool {
}
//红点查询
func (this *Mail) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
func (this *Mail) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
switch v {
case comm.Reddot12101:
if isredot := this.modelMail.checkReddot26(session.GetUserId()); isredot {
reddot[comm.Reddot12101] = true
reddot[comm.Reddot12101] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: true,
}
} else {
reddot[comm.Reddot12101] = false
reddot[comm.Reddot12101] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: false,
}
}
break
case comm.Reddot12102:
if isredot := this.modelMail.checkReddot30(session.GetUserId()); isredot {
reddot[comm.Reddot12102] = true
reddot[comm.Reddot12102] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: true,
}
} else {
reddot[comm.Reddot12102] = false
reddot[comm.Reddot12102] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: false,
}
}
break
}

View File

@ -50,11 +50,14 @@ func (this *Mline) Start() (err error) {
}
//红点查询
func (this *Mline) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
func (this *Mline) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
if v == comm.Reddot24100 {
reddot[comm.Reddot24100] = this.CheckPoint(session.GetUserId())
reddot[comm.Reddot24100] = &pb.ReddotItem{
Rid: int32(comm.Reddot24100),
Activated: this.CheckPoint(session.GetUserId()),
}
break
}
}

View File

@ -145,12 +145,15 @@ func (this *Pagoda) SetPagodaRankList(tableName string, score int64, uid string)
}
//红点查询
func (this *Pagoda) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
func (this *Pagoda) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
switch v {
case comm.Reddot6:
reddot[comm.Reddot6] = this.CheckPoint6(session.GetUserId())
reddot[comm.Reddot6] = &pb.ReddotItem{
Rid: int32(comm.Reddot6),
Activated: this.CheckPoint6(session.GetUserId()),
}
break
}

View File

@ -122,18 +122,27 @@ func (this *Smithy) CheckActivateAtlasCollect(uid string, id string) {
return
}
func (this *Smithy) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
func (this *Smithy) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
switch v {
case comm.Reddot17102: // 铁匠铺手册台
reddot[comm.Reddot17102] = this.modelAtlas.checkReddot17102(session.GetUserId())
reddot[comm.Reddot17102] = &pb.ReddotItem{
Rid: int32(comm.Reddot17102),
Activated: this.modelAtlas.checkReddot17102(session.GetUserId()),
}
break
case comm.Reddot17107: // 铁匠铺手册台收藏家奖励按钮上
reddot[comm.Reddot17107] = this.modelTask.checkReddot17107(session.GetUserId())
reddot[comm.Reddot17107] = &pb.ReddotItem{
Rid: int32(comm.Reddot17107),
Activated: this.modelTask.checkReddot17107(session.GetUserId()),
}
break
case comm.Reddot17106: //
reddot[comm.Reddot17106] = this.modelAtlas.checkReddot17106(session.GetUserId())
reddot[comm.Reddot17106] = &pb.ReddotItem{
Rid: int32(comm.Reddot17106),
Activated: this.modelAtlas.checkReddot17106(session.GetUserId()),
}
break
}

View File

@ -176,12 +176,15 @@ func (this *Viking) CheckRank(uid string, boosID int32, difficulty int32, report
}
//红点查询
func (this *Viking) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
func (this *Viking) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
switch v {
case comm.Reddot13102:
reddot[comm.Reddot13102] = this.modelViking.checkReddot31(session)
reddot[comm.Reddot13102] = &pb.ReddotItem{
Rid: int32(comm.Reddot13102),
Activated: this.modelViking.checkReddot31(session),
}
break
}

View File

@ -47,8 +47,8 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.WorldtaskMineReq) (
//查询当前所有任务组下的完成条件数据
var condIds []int32
condMap := make(map[int32][]int32)
for k, v := range myWorldtask.CurrentTasks {
// condMap := make(map[int32][]int32)
for _, v := range myWorldtask.CurrentTasks {
for _, t := range v.TaskMap {
cfg, err := this.module.configure.getWorldtaskById(t.TaskId)
if err != nil {
@ -62,7 +62,7 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.WorldtaskMineReq) (
if (len(cfg.Completetask) >= 1 && cfg.Completetask[0] > 0) &&
len(cfg.Completetask) > 0 {
condIds = append(condIds, cfg.Completetask...)
condMap[k] = cfg.Completetask
// condMap[k] = cfg.Completetask
}
}
@ -82,19 +82,21 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.WorldtaskMineReq) (
return
}
for k, v := range condMap {
if mw, ok := myWorldtask.CurrentTasks[k]; ok {
for _, task := range mw.TaskMap {
for _, cond := range conds {
if _, ok := utils.Findx(v, cond.Conid); ok {
task.Conds = append(task.Conds, cond)
}
// for k, v := range condMap {
for _, mw := range myWorldtask.CurrentTasks {
for _, task := range mw.TaskMap {
task.Conds = make([]*pb.ConIProgress, 0)
_cfg, _ := this.module.configure.getWorldtaskById(task.TaskId)
for _, cond := range conds {
if _, ok := utils.Findx(_cfg.Completetask, cond.Conid); ok {
task.Conds = append(task.Conds, cond)
}
}
}
}
// }
rsp := &pb.WorldtaskMineResp{
Task: myWorldtask,
}

View File

@ -20,7 +20,7 @@ const (
type configureComp struct {
modules.MCompConfigure
lock sync.RWMutex
worldtaskConf map[int32]*cfg.GameWorldTaskData //key 条件ID
worldtaskConf map[int32]*cfg.GameWorldTaskData //key 条件ID
}
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {