上传竞技场代码

This commit is contained in:
liwei1dao 2023-11-09 18:10:53 +08:00
parent 781dd76e34
commit 59eb50d8d2
3 changed files with 22 additions and 4 deletions

View File

@ -88,18 +88,34 @@ func (this *modelArena) queryArenaPlayer(uId string) (result *pb.ArenaPlayer, er
// 查询用户英雄数据 // 查询用户英雄数据
func (this *modelArena) queryUserHeros(uid string, heroids []string) (results []*pb.DBHero, err error) { func (this *modelArena) queryUserHeros(uid string, heroids []string) (results []*pb.DBHero, err error) {
var ( var (
model *db.DBModel model *db.DBModel
ids []string
resultstemp []*pb.DBHero
) )
if model, err = this.module.GetDBModelByUid(uid, comm.TableHero); err != nil { if model, err = this.module.GetDBModelByUid(uid, comm.TableHero); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
return return
} }
for _, v := range heroids {
if v == "" {
ids = append(ids, v)
}
}
results = make([]*pb.DBHero, 0) resultstemp = make([]*pb.DBHero, 0)
if err = model.GetListObjs(uid, heroids, &results); err != nil { if err = model.GetListObjs(uid, ids, &resultstemp); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
return return
} }
results = make([]*pb.DBHero, len(heroids))
for i1, v1 := range resultstemp {
for i2, _ := range results {
if i1 == i2 {
results[i2] = v1
}
}
}
return return
} }

View File

@ -43,6 +43,6 @@ func (this *apiComp) Ready(session comm.IUserSession, req *pb.CatchbugsReadyReq)
} }
return return
} }
session.SendMsg(string(this.module.GetType()), "loadcomplete", &pb.CanineRabbitLoadCompleteResp{Roomid: req.Roomid, Issucc: true}) session.SendMsg(string(this.module.GetType()), "ready", &pb.CatchbugsReadyResp{Roomid: req.Roomid, Issucc: true})
return return
} }

View File

@ -15,6 +15,7 @@ import (
"go_dreamfactory/modules/caninerabbit" "go_dreamfactory/modules/caninerabbit"
"go_dreamfactory/modules/capturesheep" "go_dreamfactory/modules/capturesheep"
"go_dreamfactory/modules/caravan" "go_dreamfactory/modules/caravan"
"go_dreamfactory/modules/catchbugs"
"go_dreamfactory/modules/chat" "go_dreamfactory/modules/chat"
"go_dreamfactory/modules/combat" "go_dreamfactory/modules/combat"
"go_dreamfactory/modules/dailytask" "go_dreamfactory/modules/dailytask"
@ -184,6 +185,7 @@ func main() {
caninerabbit.NewModule(), caninerabbit.NewModule(),
island.NewModule(), island.NewModule(),
egghunt.NewModule(), egghunt.NewModule(),
catchbugs.NewModule(),
) )
} }