From 5a369950606b00e6ec9411fdcb773dd225c6fcad Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 16 Mar 2023 13:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 3 + modules/arena/modelarena.go | 2 +- modules/battle/module.go | 4 +- modules/equipment/modelEquipment.go | 10 +-- modules/hero/model_hero.go | 4 +- modules/hero/module.go | 6 +- modules/horoscope/modelhoroscope.go | 2 +- modules/items/modelitems.go | 12 +-- modules/modulebase.go | 20 ++++- modules/practice/api_unLock.go | 2 +- modules/practice/modelPandata.go | 6 +- modules/practice/module.go | 118 ++++++++++++++++++---------- modules/privilege/module.go | 2 +- modules/user/model_expand.go | 4 +- modules/user/model_user.go | 4 +- pb/practice_msg.pb.go | 20 ++--- 16 files changed, 137 insertions(+), 82 deletions(-) diff --git a/comm/const.go b/comm/const.go index f84bc12e1..99a58bf8e 100644 --- a/comm/const.go +++ b/comm/const.go @@ -290,6 +290,9 @@ const ( //Rpc Rpc_ModuleSociatyTask core.Rpc_Key = "Rpc_ModuleSociatyTask" Rpc_ModuleSociatyGetTask core.Rpc_Key = "Rpc_ModuleSociatyGetTask" + //武馆解锁柱子 + RPC_ModulePracticeUnLockPillar core.Rpc_Key = "RPC_ModulePracticeUnLockPillar" + // RPC 通知来了邮件 Rpc_Mail core.Rpc_Key = "Rpc_Mail" ) diff --git a/modules/arena/modelarena.go b/modules/arena/modelarena.go index dae0b8847..6a0327c0f 100644 --- a/modules/arena/modelarena.go +++ b/modules/arena/modelarena.go @@ -92,7 +92,7 @@ func (this *modelArena) queryUserHeros(uid string, heroids []string) (results [] var ( model *db.DBModel ) - if model, err = this.module.GetDBModuleByUid(uid, comm.TableHero, time.Hour); err != nil { + if model, err = this.module.GetDBModelByUid(uid, comm.TableHero, time.Hour); err != nil { this.module.Errorln(err) return } diff --git a/modules/battle/module.go b/modules/battle/module.go index 4f8936a3e..1db6464ec 100644 --- a/modules/battle/module.go +++ b/modules/battle/module.go @@ -208,11 +208,11 @@ func (this *Battle) CreateRtPvpBattle(req *pb.BattleRTPVPReq) (code pb.ErrorCode code = pb.ErrorCode_Exception return } - if redmodel, err = this.GetDBModuleByUid(req.RedCompId, comm.TableHero, time.Hour); err != nil { + if redmodel, err = this.GetDBModelByUid(req.RedCompId, comm.TableHero, time.Hour); err != nil { code = pb.ErrorCode_DBError return } - if bluemodel, err = this.GetDBModuleByUid(req.BlueCompId, comm.TableHero, time.Hour); err != nil { + if bluemodel, err = this.GetDBModelByUid(req.BlueCompId, comm.TableHero, time.Hour); err != nil { code = pb.ErrorCode_DBError return } diff --git a/modules/equipment/modelEquipment.go b/modules/equipment/modelEquipment.go index c70dcf7b9..c2405e391 100644 --- a/modules/equipment/modelEquipment.go +++ b/modules/equipment/modelEquipment.go @@ -57,7 +57,7 @@ func (this *modelEquipmentComp) QueryUserEquipments(uId string) (equipments []*p ) equipments = make([]*pb.DB_Equipment, 0) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.GetList(uId, &equipments); err != nil { @@ -143,7 +143,7 @@ func (this *modelEquipmentComp) AddEquipments(session comm.IUserSession, cIds ma model *db.DBModel ) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.AddLists(uId, add); err != nil { @@ -166,7 +166,7 @@ func (this *modelEquipmentComp) addEquipment(equip *pb.DB_Equipment) (err error) model *db.DBModel ) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(equip.UId, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(equip.UId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.AddList(equip.UId, equip.Id, equip); err != nil { @@ -190,7 +190,7 @@ func (this *modelEquipmentComp) DelEquipments(uId string, eIds []string) (change ) change = make([]*pb.DB_Equipment, 0) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.DelListlds(uId, eIds); err != nil { @@ -220,7 +220,7 @@ func (this *modelEquipmentComp) UpdateByHeroId(uid string, equipments ...*pb.DB_ model *db.DBModel ) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { for _, v := range equipments { diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 900075ed8..ded2e0639 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -139,7 +139,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int if hero != nil { hero.SameCount = 1 // 新需求 不需要判断叠加 if this.moduleHero.IsCross() { - if model, err = this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil { + if model, err = this.moduleHero.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil { this.moduleHero.Errorln(err) } else { if err = model.AddList(uid, hero.Id, hero); err != nil { @@ -831,7 +831,7 @@ func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, c return } if this.moduleHero.IsCross() { - if dbModel, err1 := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err1 == nil { + if dbModel, err1 := this.moduleHero.GetDBModelByUid(uid, this.TableName, this.Expired); err1 == nil { if err = dbModel.GetList(uid, &heros); err != nil { this.moduleHero.Errorf("err:%v", err) return diff --git a/modules/hero/module.go b/modules/hero/module.go index 918d90cc0..b0c0a28fe 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -310,7 +310,7 @@ func (this *Hero) AddHeroExp(session comm.IUserSession, heroObjID string, exp in } if this.IsCross() { _hero = &pb.DBHero{} - if model, err := this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { + if model, err := this.GetDBModelByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { if err := model.GetListObj(session.GetUserId(), heroObjID, _hero); err != nil { this.Errorf("err:%v", err) return @@ -348,7 +348,7 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf if this.IsCross() { _hero = &pb.DBHero{} - if model, err = this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { + if model, err = this.GetDBModelByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { if err := model.GetListObj(session.GetUserId(), heroObjID, _hero); err != nil { this.Errorf("err:%v", err) return @@ -851,7 +851,7 @@ func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid string, ) if this.IsCross() { _hero = &pb.DBHero{} - if model, err = this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { + if model, err = this.GetDBModelByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { if err := model.GetListObj(session.GetUserId(), heroOid, _hero); err != nil { this.Errorf("err:%v", err) return diff --git a/modules/horoscope/modelhoroscope.go b/modules/horoscope/modelhoroscope.go index f6d8a15dd..c2044d095 100644 --- a/modules/horoscope/modelhoroscope.go +++ b/modules/horoscope/modelhoroscope.go @@ -51,7 +51,7 @@ func (this *modelHoroscope) updateInfo(session comm.IUserSession, info *pb.DBHor "nodes": info.Nodes, "lastrest": info.Lastrest, }) - if model, err = this.module.GetDBModuleByUid(info.Uid, this.TableName, time.Hour); err != nil { + if model, err = this.module.GetDBModelByUid(info.Uid, this.TableName, time.Hour); err != nil { this.module.Errorln(err) return } diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index b63b62892..d7ae75bcc 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -42,7 +42,7 @@ func (this *ModelItemsComp) QueryUserPack(uId string) (itmes []*pb.DB_UserItemDa ) itmes = make([]*pb.DB_UserItemData, 0) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.GetList(uId, &itmes); err != nil { @@ -66,7 +66,7 @@ func (this *ModelItemsComp) QueryUserPackByGridId(uId string, grid string) (itme itme = &pb.DB_UserItemData{} if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.GetListObj(uId, grid, itme); err != nil { @@ -90,7 +90,7 @@ func (this *ModelItemsComp) QueryUserPackByGridIds(uId string, grids []string) ( itme = make([]*pb.DB_UserItemData, len(grids)) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.GetListObjs(uId, grids, &itme); err != nil { @@ -116,7 +116,7 @@ func (this *ModelItemsComp) AddUserPack(uId string, itmes ...*pb.DB_UserItemData model *db.DBModel ) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.AddLists(uId, data); err != nil { @@ -138,7 +138,7 @@ func (this *ModelItemsComp) UpdateUserPack(uid string, itmes ...*pb.DB_UserItemD model *db.DBModel ) if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { for _, v := range itmes { @@ -172,7 +172,7 @@ func (this *ModelItemsComp) DeleteUserPack(uid string, itmes ...*pb.DB_UserItemD gridIds[i] = v.GridId } if this.module.IsCross() { - if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil { + if model, err = this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.DelListlds(uid, gridIds); err != nil { diff --git a/modules/modulebase.go b/modules/modulebase.go index 97e6bca57..5e5293239 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -477,7 +477,25 @@ func (this *ModuleBase) GetDBNodule(session comm.IUserSession, tableName string, } //跨服对象获取数据操作对象 -func (this *ModuleBase) GetDBModuleByUid(uid, tableName string, expired time.Duration) (model *db.DBModel, err error) { +func (this *ModuleBase) GetCrossDBModel(tableName string, expired time.Duration) (model *db.DBModel, err error) { + var ( + conn *db.DBConn + ) + if this.IsCross() { + if conn, err = db.Local(); err != nil { + return + } + } else { + if conn, err = db.Cross(); err != nil { + return + } + } + model = db.NewDBModel(tableName, expired, conn) + return +} + +//跨服对象获取数据操作对象 +func (this *ModuleBase) GetDBModelByUid(uid, tableName string, expired time.Duration) (model *db.DBModel, err error) { var ( stag string conn *db.DBConn diff --git a/modules/practice/api_unLock.go b/modules/practice/api_unLock.go index a8385ddb5..f98f49fa7 100644 --- a/modules/practice/api_unLock.go +++ b/modules/practice/api_unLock.go @@ -56,6 +56,6 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq filed: pillar, "pillarf": room.Pillarf, }) - session.SendMsg(string(this.module.GetType()), "unLock", &pb.PracticeUnLockResp{Info: room}) + session.SendMsg(string(this.module.GetType()), "unlock", &pb.PracticeUnLockResp{Info: room}) return } diff --git a/modules/practice/modelPandata.go b/modules/practice/modelPandata.go index 985144a95..0f36e49ac 100644 --- a/modules/practice/modelPandata.go +++ b/modules/practice/modelPandata.go @@ -45,10 +45,10 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic Knapsack: make(map[string]int32), Gymaction: 0, Gymrefresh: 0, - Pillar1: &pb.DBPracticePillar{Index: 1, Isunlock: 2, Lv: 1}, + Pillar1: &pb.DBPracticePillar{Index: 1, Lv: 1}, Pillar2: &pb.DBPracticePillar{Index: 2, Lv: 1}, Pillar3: &pb.DBPracticePillar{Index: 3, Lv: 1}, - Pillarf: &pb.DBPracticePillar{Index: 4, Isunlock: 2, Lv: 1}, + Pillarf: &pb.DBPracticePillar{Index: 4, Lv: 1}, Statuers: make([]*pb.DBPracticeStatuer, 0), } if err = this.refreshnpc(result); err != nil { @@ -64,6 +64,8 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic return } + + //刷新npc func (this *modelPandata) refreshnpc(room *pb.DBPracticeRoom) (err error) { var ( diff --git a/modules/practice/module.go b/modules/practice/module.go index 1c8bcbf0c..8e19e95a9 100644 --- a/modules/practice/module.go +++ b/modules/practice/module.go @@ -1,6 +1,8 @@ package practice import ( + "context" + "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" @@ -11,6 +13,7 @@ import ( "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/sys/db" + "strconv" "time" "go.mongodb.org/mongo-driver/bson/primitive" @@ -74,6 +77,7 @@ func (this *Practice) Start() (err error) { return } this.battle = module.(comm.IBattle) + this.service.RegisterFunctionName(string(comm.RPC_ModulePracticeUnLockPillar), this.RPC_ModulePracticeUnLockPillar) return } @@ -156,51 +160,20 @@ func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32 //完成世界任务 func (this *Practice) TaskComplete(session comm.IUserSession, taskid int32) { - var ( - configure []*cfg.GamePandamasJsData - room *pb.DBPracticeRoom - err error + this.Debug("TaskComplete", + log.Field{Key: "session", Value: session.GetUserId()}, + log.Field{Key: "taskid", Value: taskid}, ) - if configure, err = this.configure.getGamePandamasJs(); err != nil { - this.Errorln(err) - return - } - if room, err = this.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil { - this.Errorln(err) - return - } - for _, v := range configure { - if v.UnlockCondition == taskid { - switch v.Id { - case 1: - if room.Pillar1.Isunlock == 0 { - room.Pillar1.Isunlock = 1 - } - this.modelPandata.Change(session.GetUserId(), map[string]interface{}{ - "pillar1": room.Pillar1, - }) - this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1001") - break - case 2: - if room.Pillar2.Isunlock == 0 { - room.Pillar2.Isunlock = 1 - } - this.modelPandata.Change(session.GetUserId(), map[string]interface{}{ - "pillar2": room.Pillar2, - }) - this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1001") - break - case 3: - if room.Pillar3.Isunlock == 0 { - room.Pillar3.Isunlock = 1 - } - this.modelPandata.Change(session.GetUserId(), map[string]interface{}{ - "pillar3": room.Pillar3, - }) - this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1001") - break - } + if !this.IsCross() { + err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), + comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar), + &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: fmt.Sprintf("%d", taskid)}, &pb.EmptyResp{}) + if err != nil { + this.Errorln(err) + return } + } else { + this.RPC_ModulePracticeUnLockPillar(context.Background(), &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: fmt.Sprintf("%d", taskid)}, &pb.EmptyResp{}) } } @@ -291,3 +264,62 @@ func (this *Practice) ChallengeResults(bid, red, bule string, winSide int32) { "statuers": buleroom.Statuers, }) } + +//解锁武馆柱子 +func (this *Practice) RPC_ModulePracticeUnLockPillar(ctx context.Context, args *pb.RPCGeneralReqA2, reply *pb.EmptyResp) (err error) { + this.Debug("RPC_ModulePracticeUnLockPillar", + log.Field{Key: "uid", Value: args.Param1}, + log.Field{Key: "taskid", Value: args.Param2}, + ) + var ( + configure []*cfg.GamePandamasJsData + room *pb.DBPracticeRoom + taskid int64 + ) + if taskid, err = strconv.ParseInt(args.Param2, 10, 64); err != nil { + this.Errorln(err) + return + } + if configure, err = this.configure.getGamePandamasJs(); err != nil { + this.Errorln(err) + return + } + if room, err = this.modelPandata.queryUserMartialhall(args.Param1); err != nil { + this.Errorln(err) + return + } + for _, v := range configure { + if v.UnlockCondition == int32(taskid) { + switch v.Id { + case 1: + if room.Pillar1.Isunlock == 0 { + room.Pillar1.Isunlock = 1 + } + this.modelPandata.Change(args.Param1, map[string]interface{}{ + "pillar1": room.Pillar1, + }) + this.atlas.CheckActivatePandaAtlasCollect(args.Param1, "1001") + break + case 2: + if room.Pillar2.Isunlock == 0 { + room.Pillar2.Isunlock = 1 + } + this.modelPandata.Change(args.Param1, map[string]interface{}{ + "pillar2": room.Pillar2, + }) + this.atlas.CheckActivatePandaAtlasCollect(args.Param1, "1001") + break + case 3: + if room.Pillar3.Isunlock == 0 { + room.Pillar3.Isunlock = 1 + } + this.modelPandata.Change(args.Param1, map[string]interface{}{ + "pillar3": room.Pillar3, + }) + this.atlas.CheckActivatePandaAtlasCollect(args.Param1, "1001") + break + } + } + } + return +} diff --git a/modules/privilege/module.go b/modules/privilege/module.go index d1332ea84..c6e2a5225 100644 --- a/modules/privilege/module.go +++ b/modules/privilege/module.go @@ -413,7 +413,7 @@ func (this *Privilege) SendDailyPrivilegeMail(session comm.IUserSession, cId []i } func (this *Privilege) GetCountByPrivilegeId(uid string, pType int32) (count int32) { if this.IsCross() { // 跨服情况 - if model, err := this.GetDBModuleByUid(uid, comm.TableVip, time.Hour); err == nil { + if model, err := this.GetDBModelByUid(uid, comm.TableVip, time.Hour); err == nil { vip := &pb.DBVip{} if err = model.Get(uid, vip); err == nil { if v, ok := vip.Privilege[pType]; ok { diff --git a/modules/user/model_expand.go b/modules/user/model_expand.go index edcdcafac..4e156e495 100644 --- a/modules/user/model_expand.go +++ b/modules/user/model_expand.go @@ -33,7 +33,7 @@ func (this *ModelExpand) Init(service core.IService, module core.IModule, comp c func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) { result = &pb.DBUserExpand{} if db.IsCross() { - if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil { + if model, err := this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil { this.module.Error("Cross GetDBModuleByUid", log.Field{Key: "uid", Value: uid}) return result, err } else { @@ -78,7 +78,7 @@ func (this *ModelExpand) ChangeUserExpand(uid string, value map[string]interface model *db.DBModel ) if db.IsCross() { - if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err == nil { + if model, err = this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err == nil { return model.Change(uid, value) } else { this.module.Errorln(err) diff --git a/modules/user/model_user.go b/modules/user/model_user.go index b52d56b5d..d81f9a46f 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -93,7 +93,7 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser) { // return // } if this.module.IsCross() { - if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil { + if model, err := this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.Get(uid, user); err != nil { @@ -111,7 +111,7 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser) { //设置属性 func (this *ModelUser) updateUserAttr(uid string, data map[string]interface{}) error { if this.module.IsCross() { - if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil { + if model, err := this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { if err = model.Change(uid, data); err != nil { diff --git a/pb/practice_msg.pb.go b/pb/practice_msg.pb.go index ca97017a7..67668de4e 100644 --- a/pb/practice_msg.pb.go +++ b/pb/practice_msg.pb.go @@ -858,8 +858,8 @@ type PracticeEnrolledReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"` - Hero string `protobuf:"bytes,2,opt,name=hero,proto3" json:"hero"` + Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"` + Hero []string `protobuf:"bytes,2,rep,name=hero,proto3" json:"hero"` } func (x *PracticeEnrolledReq) Reset() { @@ -901,11 +901,11 @@ func (x *PracticeEnrolledReq) GetGroup() int32 { return 0 } -func (x *PracticeEnrolledReq) GetHero() string { +func (x *PracticeEnrolledReq) GetHero() []string { if x != nil { return x.Hero } - return "" + return nil } ///登记满级英雄 回应 @@ -914,8 +914,8 @@ type PracticeEnrolledResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"` - Hero string `protobuf:"bytes,2,opt,name=hero,proto3" json:"hero"` + Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"` + Hero []string `protobuf:"bytes,2,rep,name=hero,proto3" json:"hero"` } func (x *PracticeEnrolledResp) Reset() { @@ -957,11 +957,11 @@ func (x *PracticeEnrolledResp) GetGroup() int32 { return 0 } -func (x *PracticeEnrolledResp) GetHero() string { +func (x *PracticeEnrolledResp) GetHero() []string { if x != nil { return x.Hero } - return "" + return nil } ///练功道具和教习推送 @@ -2110,11 +2110,11 @@ var file_practice_practice_msg_proto_rawDesc = []byte{ 0x22, 0x3f, 0x0a, 0x13, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, - 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x72, + 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x40, 0x0a, 0x14, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, - 0x12, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, + 0x12, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x24, 0x0a, 0x12, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x4a, 0x58, 0x49, 0x74, 0x65, 0x6d, 0x50, 0x75, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x50, 0x72, 0x61,