diff --git a/bin/json/game_herofusion.json b/bin/json/game_herofusion.json index ae1cafb7f..f1b90c776 100644 --- a/bin/json/game_herofusion.json +++ b/bin/json/game_herofusion.json @@ -2,12 +2,12 @@ { "id": 1, "switch": 1, - "hero": 14007, + "hero": "14007", "pointhero": [ - 35001, - 35001, - 35001, - 35001 + "35001", + "35001", + "35001", + "35001" ], "awaken": -1, "start": -1 @@ -15,12 +15,12 @@ { "id": 2, "switch": 1, - "hero": 35001, + "hero": "35001", "pointhero": [ - 25001, - 25001, - 25001, - 25001 + "25001", + "25001", + "25001", + "25001" ], "awaken": -1, "start": -1 @@ -28,12 +28,12 @@ { "id": 3, "switch": 1, - "hero": 25001, + "hero": "25001", "pointhero": [ - 25004, - 25004, - 25004, - 25004 + "25004", + "25004", + "25004", + "25004" ], "awaken": -1, "start": -1 @@ -41,12 +41,12 @@ { "id": 4, "switch": 1, - "hero": 25004, + "hero": "25004", "pointhero": [ - 44005, - 44005, - 44005, - 44005 + "44005", + "44005", + "44005", + "44005" ], "awaken": -1, "start": -1 @@ -54,12 +54,12 @@ { "id": 5, "switch": 1, - "hero": 45003, + "hero": "45003", "pointhero": [ - 44005, - 44005, - 44005, - 44005 + "44005", + "44005", + "44005", + "44005" ], "awaken": -1, "start": -1 diff --git a/cmd/v2/ui/views/user_modifybgp.go b/cmd/v2/ui/views/user_modifybgp.go index 5d21a987d..2036c50a6 100644 --- a/cmd/v2/ui/views/user_modifybgp.go +++ b/cmd/v2/ui/views/user_modifybgp.go @@ -8,7 +8,6 @@ import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/widget" "github.com/sirupsen/logrus" - "github.com/spf13/cast" ) // 修改背景 @@ -24,7 +23,7 @@ func (this *UserModifybgpView) CreateView(t *model.TestCase) fyne.CanvasObject { if err := service.GetPttService().SendToClient( t.MainType, t.SubType, - &pb.UserModifybgpReq{BgpId: cast.ToInt32(bgpId.Text)}, + &pb.UserModifybgpReq{BgpId: bgpId.Text}, ); err != nil { logrus.Error(err) return diff --git a/lego/sys/rpcx/rpcx.go b/lego/sys/rpcx/rpcx.go index 5f8d27e2e..9efe81287 100644 --- a/lego/sys/rpcx/rpcx.go +++ b/lego/sys/rpcx/rpcx.go @@ -2,6 +2,7 @@ package rpcx import ( "context" + "strings" "github.com/smallnest/rpcx/client" ) @@ -66,36 +67,65 @@ func (this *RPCX) UnregisterAll() (err error) { //同步调用 func (this *RPCX) Call(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) { - return this.client.Call(ctx, servicePath, serviceMethod, args, reply) + //先排查下 服务端是否存在连接对象 不存在 在使用客户端对象连接 + err = this.service.Call(ctx, servicePath, serviceMethod, args, reply) + if err != nil && strings.Contains(err.Error(), "on found") { + return this.client.Call(ctx, servicePath, serviceMethod, args, reply) + } + return } //广播调用 func (this *RPCX) Broadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) { - return this.client.Broadcast(ctx, servicePath, serviceMethod, args, reply) + err = this.service.Broadcast(ctx, servicePath, serviceMethod, args, reply) + if err != nil && strings.Contains(err.Error(), "on found") { + return this.client.Broadcast(ctx, servicePath, serviceMethod, args, reply) + } + return } //异步调用 func (this *RPCX) Go(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}, done chan *client.Call) (call *client.Call, err error) { - return this.client.Go(ctx, servicePath, serviceMethod, args, reply, done) + call, err = this.service.Go(ctx, servicePath, serviceMethod, args, reply, done) + if err != nil && strings.Contains(err.Error(), "on found") { + return this.client.Go(ctx, servicePath, serviceMethod, args, reply, done) + } + return } //跨服同步调用 func (this *RPCX) AcrossClusterCall(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) { - return this.client.AcrossClusterCall(ctx, clusterTag, servicePath, serviceMethod, args, reply) + err = this.service.AcrossClusterCall(ctx, clusterTag, servicePath, serviceMethod, args, reply) + if err != nil && strings.Contains(err.Error(), "on found") { + return this.client.AcrossClusterCall(ctx, clusterTag, servicePath, serviceMethod, args, reply) + } + return } //跨集群 广播 func (this *RPCX) AcrossClusterBroadcast(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) { - err = this.client.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply) + err = this.service.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply) + if err != nil && strings.Contains(err.Error(), "on found") { + return this.client.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply) + } return } //跨服异步调用 func (this *RPCX) AcrossClusterGo(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}, done chan *client.Call) (call *client.Call, err error) { - return this.client.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done) + call, err = this.service.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done) + if err != nil && strings.Contains(err.Error(), "on found") { + return this.client.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done) + } + return } //全集群广播 func (this *RPCX) ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) { - return this.client.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply) + + err = this.client.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply) + if err != nil && strings.Contains(err.Error(), "on found") { + return this.client.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply) + } + return } diff --git a/modules/hero/api_fusion.go b/modules/hero/api_fusion.go new file mode 100644 index 000000000..bac9e8a03 --- /dev/null +++ b/modules/hero/api_fusion.go @@ -0,0 +1,80 @@ +package hero + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) FusionCheck(session comm.IUserSession, req *pb.HeroFusionReq) (code pb.ErrorCode) { + if req.FuionId <= 0 { + code = pb.ErrorCode_ReqParameterError + } + return +} + +func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (code pb.ErrorCode, data proto.Message) { + var ( + totalCount int32 + mapHero map[string]int32 + _costMaphero map[string]*pb.DBHero + ChangeList []*pb.DBHero // 变化的英雄数据 + ) + ChangeList = make([]*pb.DBHero, 0) + _costMaphero = make(map[string]*pb.DBHero, 0) + mapHero = make(map[string]int32) + if code = this.FusionCheck(session, req); code != pb.ErrorCode_Success { + return + } + conf := this.module.configure.GetHeroFucionConfig(req.FuionId) + if conf == nil { + code = pb.ErrorCode_ConfigNoFound // 配置没找到 + return + } + for _, v := range req.Heros { + totalCount += v + } + if totalCount != int32(len(conf.Pointhero)) { // 校验数量 + code = pb.ErrorCode_ReqParameterError + return + } + for k, v := range req.Heros { + // 校验英雄是否存在 + _obj, c := this.module.GetHeroByObjID(session.GetUserId(), k) + if c != pb.ErrorCode_Success || _obj.SameCount < v { + code = pb.ErrorCode_HeroNoExist + } + mapHero[_obj.HeroID] = v + _costMaphero[k] = _obj + } + for _, v := range conf.Pointhero { + if _, ok := mapHero[v]; !ok { + mapHero[v] -= 1 + } else { + code = pb.ErrorCode_ReqParameterError + return + } + } + for _, v := range mapHero { + if v != 0 { + code = pb.ErrorCode_ReqParameterError + return + } + } + for k, v := range _costMaphero { + code = this.module.DelCard(session.GetUserId(), v, mapHero[k]) + if code != pb.ErrorCode_Success { + return + } + ChangeList = append(ChangeList, _costMaphero[k]) + } + // 获得新卡 + newHero, err := this.module.modelHero.createHeroOverlying(session.GetUserId(), conf.Hero, 1) + if err != nil { + ChangeList = append(ChangeList, newHero) + } + session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList}) + return +} diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 925c785c9..dfa58f484 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -25,6 +25,7 @@ const ( hero_drawcard = "game_drawcard.json" // 抽卡 hero_drawupdraw = "game_drawupdraw.json" // 抽卡概率调整 hero_drawcost = "game_drawcost.json" // 抽卡消耗 + hero_fusion = "game_herofusion.json" // 卡牌融合 ) ///配置管理组件 @@ -53,6 +54,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp game_skillatk: cfg.NewGameSkillAtk, hero_comatn: cfg.NewGameComAtn, hero_drawcard: cfg.NewGameDrawCard, + hero_fusion: cfg.NewGameHerofusion, }) this.drawCardCfg = make(map[string]map[int32][]*cfg.GameDrawCardData, 0) @@ -380,3 +382,20 @@ func (this *configureComp) GetHeroResonanceRestConfig() (data *cfg.GameComAtnDat return } + +// 获取卡牌合成配置 +func (this *configureComp) GetHeroFucionConfig(id int32) (data *cfg.GameHerofusionData) { + + if v, err := this.GetConfigure(hero_fusion); err == nil { + if configure, ok := v.(*cfg.GameHerofusion); !ok { + err = fmt.Errorf("%T no is *cfg.GameHerofusionData", v) + return + } else { + data = configure.Get(id) + } + } else { + err = fmt.Errorf("%T no is *cfg.GameHerofusionData", v) + } + + return +} diff --git a/modules/user/api_battlerecord.go b/modules/user/api_battlerecord.go index 9228d2534..5e4687d39 100644 --- a/modules/user/api_battlerecord.go +++ b/modules/user/api_battlerecord.go @@ -13,9 +13,23 @@ func (this *apiComp) BattlerecordCheck(session comm.IUserSession, req *pb.UserBa } func (this *apiComp) Battlerecord(session comm.IUserSession, req *pb.UserBattlerecordReq) (code pb.ErrorCode, data proto.Message) { + var uid string + if req.Uid == "" { + uid = session.GetUserId() + } else { + uid = req.Uid + } + + user := this.module.GetUser(uid) + userEx, err := this.module.GetUserExpand(uid) + if err != nil { + code = pb.ErrorCode_UserExpandNull + return + } rsp := &pb.UserBattlerecordResp{ - Uid: session.GetUserId(), + Data: user, + Ex: userEx, } // 心魔塔 @@ -26,7 +40,7 @@ func (this *apiComp) Battlerecord(session comm.IUserSession, req *pb.UserBattler } if b, y := iPagoda.(comm.IPagoda); y { - dr := b.CheckUserBasePagodaInfo(session.GetUserId()) + dr := b.CheckUserBasePagodaInfo(uid) if dr != nil { rsp.PagodaRecord = dr } @@ -40,7 +54,7 @@ func (this *apiComp) Battlerecord(session comm.IUserSession, req *pb.UserBattler } if b, y := ihunting.(comm.IHunting); y { - if dr := b.CheckUserBaseHuntingInfo(session.GetUserId()); dr != nil { + if dr := b.CheckUserBaseHuntingInfo(uid); dr != nil { rsp.HuntingRecord = dr } } @@ -53,7 +67,7 @@ func (this *apiComp) Battlerecord(session comm.IUserSession, req *pb.UserBattler } if b, y := iviking.(comm.IViking); y { - if dr := b.CheckUserBaseVikingInfo(session.GetUserId()); dr != nil { + if dr := b.CheckUserBaseVikingInfo(uid); dr != nil { rsp.VikingRecord = dr } } diff --git a/modules/user/model_cross_session.go b/modules/user/model_cross_session.go new file mode 100644 index 000000000..cb301e23e --- /dev/null +++ b/modules/user/model_cross_session.go @@ -0,0 +1,2 @@ +package user + diff --git a/modules/user/module.go b/modules/user/module.go index 7facee8ff..514ca63b4 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -7,6 +7,7 @@ import ( "go_dreamfactory/pb" "go_dreamfactory/sys/db" + "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/event" "go_dreamfactory/lego/sys/log" @@ -29,6 +30,7 @@ type User struct { modelSetting *ModelSetting modelExpand *ModelExpand configure *modules.MCompConfigure + service base.IRPCXService } func (this *User) GetType() core.M_Modules { @@ -37,6 +39,7 @@ func (this *User) GetType() core.M_Modules { func (this *User) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) + this.service = service.(base.IRPCXService) return } diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index 066a55286..459625d3b 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -1686,6 +1686,100 @@ func (x *HeroDrawCardFloorResp) GetStar5() int32 { return 0 } +// 英雄融合 +type HeroFusionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FuionId int32 `protobuf:"varint,1,opt,name=fuionId,proto3" json:"fuionId"` + Heros map[string]int32 `protobuf:"bytes,2,rep,name=heros,proto3" json:"heros" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key heroObjID value 数量 +} + +func (x *HeroFusionReq) Reset() { + *x = HeroFusionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_hero_hero_msg_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeroFusionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeroFusionReq) ProtoMessage() {} + +func (x *HeroFusionReq) ProtoReflect() protoreflect.Message { + mi := &file_hero_hero_msg_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeroFusionReq.ProtoReflect.Descriptor instead. +func (*HeroFusionReq) Descriptor() ([]byte, []int) { + return file_hero_hero_msg_proto_rawDescGZIP(), []int{32} +} + +func (x *HeroFusionReq) GetFuionId() int32 { + if x != nil { + return x.FuionId + } + return 0 +} + +func (x *HeroFusionReq) GetHeros() map[string]int32 { + if x != nil { + return x.Heros + } + return nil +} + +type HeroFusionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *HeroFusionResp) Reset() { + *x = HeroFusionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_hero_hero_msg_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeroFusionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeroFusionResp) ProtoMessage() {} + +func (x *HeroFusionResp) ProtoReflect() protoreflect.Message { + mi := &file_hero_hero_msg_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeroFusionResp.ProtoReflect.Descriptor instead. +func (*HeroFusionResp) Descriptor() ([]byte, []int) { + return file_hero_hero_msg_proto_rawDescGZIP(), []int{33} +} + var File_hero_hero_msg_proto protoreflect.FileDescriptor var file_hero_hero_msg_proto_rawDesc = []byte{ @@ -1835,8 +1929,18 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x72, 0x64, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x34, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x34, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x35, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x35, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x35, 0x22, 0x94, 0x01, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, + 0x46, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x75, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x75, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x05, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x68, + 0x65, 0x72, 0x6f, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x10, + 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1851,7 +1955,7 @@ func file_hero_hero_msg_proto_rawDescGZIP() []byte { return file_hero_hero_msg_proto_rawDescData } -var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 34) +var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 37) var file_hero_hero_msg_proto_goTypes = []interface{}{ (*HeroInfoReq)(nil), // 0: HeroInfoReq (*HeroInfoResp)(nil), // 1: HeroInfoResp @@ -1885,35 +1989,39 @@ var file_hero_hero_msg_proto_goTypes = []interface{}{ (*HeroChangePush)(nil), // 29: HeroChangePush (*HeroDrawCardFloorReq)(nil), // 30: HeroDrawCardFloorReq (*HeroDrawCardFloorResp)(nil), // 31: HeroDrawCardFloorResp - nil, // 32: HeroPropertyPush.PropertyEntry - nil, // 33: HeroPropertyPush.AddPropertyEntry - (*DBHero)(nil), // 34: DBHero + (*HeroFusionReq)(nil), // 32: HeroFusionReq + (*HeroFusionResp)(nil), // 33: HeroFusionResp + nil, // 34: HeroPropertyPush.PropertyEntry + nil, // 35: HeroPropertyPush.AddPropertyEntry + nil, // 36: HeroFusionReq.HerosEntry + (*DBHero)(nil), // 37: DBHero } var file_hero_hero_msg_proto_depIdxs = []int32{ - 34, // 0: HeroInfoResp.base:type_name -> DBHero - 34, // 1: HeroListResp.list:type_name -> DBHero + 37, // 0: HeroInfoResp.base:type_name -> DBHero + 37, // 1: HeroListResp.list:type_name -> DBHero 5, // 2: HeroStrengthenUplvReq.expCards:type_name -> MapStringInt32 - 34, // 3: HeroStrengthenUplvResp.hero:type_name -> DBHero + 37, // 3: HeroStrengthenUplvResp.hero:type_name -> DBHero 8, // 4: HeroStrengthenUpStarReq.hero:type_name -> CostCardData 8, // 5: HeroStrengthenUpStarReq.heroRace:type_name -> CostCardData - 34, // 6: HeroStrengthenUpStarResp.hero:type_name -> DBHero - 34, // 7: HeroStrengthenUpSkillResp.hero:type_name -> DBHero - 34, // 8: HeroResonanceResp.hero:type_name -> DBHero - 34, // 9: HeroResonanceResp.upStarCard:type_name -> DBHero - 34, // 10: HeroResonanceResetResp.hero:type_name -> DBHero + 37, // 6: HeroStrengthenUpStarResp.hero:type_name -> DBHero + 37, // 7: HeroStrengthenUpSkillResp.hero:type_name -> DBHero + 37, // 8: HeroResonanceResp.hero:type_name -> DBHero + 37, // 9: HeroResonanceResp.upStarCard:type_name -> DBHero + 37, // 10: HeroResonanceResetResp.hero:type_name -> DBHero 17, // 11: HeroResonanceUseEnergyReq.energy:type_name -> EnergyData - 34, // 12: HeroResonanceUseEnergyResp.hero:type_name -> DBHero - 34, // 13: HeroAwakenResp.hero:type_name -> DBHero - 32, // 14: HeroPropertyPush.property:type_name -> HeroPropertyPush.PropertyEntry - 33, // 15: HeroPropertyPush.addProperty:type_name -> HeroPropertyPush.AddPropertyEntry - 34, // 16: HeroLockResp.hero:type_name -> DBHero - 34, // 17: HeroGetSpecifiedResp.hero:type_name -> DBHero - 34, // 18: HeroChangePush.list:type_name -> DBHero - 19, // [19:19] is the sub-list for method output_type - 19, // [19:19] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 37, // 12: HeroResonanceUseEnergyResp.hero:type_name -> DBHero + 37, // 13: HeroAwakenResp.hero:type_name -> DBHero + 34, // 14: HeroPropertyPush.property:type_name -> HeroPropertyPush.PropertyEntry + 35, // 15: HeroPropertyPush.addProperty:type_name -> HeroPropertyPush.AddPropertyEntry + 37, // 16: HeroLockResp.hero:type_name -> DBHero + 37, // 17: HeroGetSpecifiedResp.hero:type_name -> DBHero + 37, // 18: HeroChangePush.list:type_name -> DBHero + 36, // 19: HeroFusionReq.heros:type_name -> HeroFusionReq.HerosEntry + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_hero_hero_msg_proto_init() } @@ -2307,6 +2415,30 @@ func file_hero_hero_msg_proto_init() { return nil } } + file_hero_hero_msg_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeroFusionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hero_hero_msg_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeroFusionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2314,7 +2446,7 @@ func file_hero_hero_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_hero_hero_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 34, + NumMessages: 37, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/user_db.pb.go b/pb/user_db.pb.go index 7c1df9e67..def3b0c33 100644 --- a/pb/user_db.pb.go +++ b/pb/user_db.pb.go @@ -124,7 +124,7 @@ type DBUser struct { Title int32 `protobuf:"varint,19,opt,name=title,proto3" json:"title"` //@go_tags(`bson:"title"`)头衔 Offlinetime int64 `protobuf:"varint,11,opt,name=offlinetime,proto3" json:"offlinetime" bson:"offlinetime"` //离线时间 Figure int32 `protobuf:"varint,20,opt,name=figure,proto3" json:"figure" bson:"figure"` //主角形象 - Bgp int32 `protobuf:"varint,21,opt,name=bgp,proto3" json:"bgp" bson:"bgp"` //背景 + Bgp string `protobuf:"bytes,21,opt,name=bgp,proto3" json:"bgp" bson:"bgp"` //背景 } func (x *DBUser) Reset() { @@ -299,11 +299,11 @@ func (x *DBUser) GetFigure() int32 { return 0 } -func (x *DBUser) GetBgp() int32 { +func (x *DBUser) GetBgp() string { if x != nil { return x.Bgp } - return 0 + return "" } type DBUserSetting struct { @@ -493,7 +493,7 @@ var file_user_user_db_proto_rawDesc = []byte{ 0x52, 0x0b, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x67, 0x70, 0x18, 0x15, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x03, 0x62, 0x67, 0x70, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73, + 0x28, 0x09, 0x52, 0x03, 0x62, 0x67, 0x70, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x75, 0x61, diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index 1bda7c1be..10081ed9f 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -1667,6 +1667,8 @@ type UserBattlerecordReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` } func (x *UserBattlerecordReq) Reset() { @@ -1701,15 +1703,23 @@ func (*UserBattlerecordReq) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{33} } +func (x *UserBattlerecordReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + type UserBattlerecordResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` - PagodaRecord *DBPagodaRecord `protobuf:"bytes,2,opt,name=pagodaRecord,proto3" json:"pagodaRecord"` //爬塔战斗记录 - HuntingRecord []*DBHuntingRank `protobuf:"bytes,3,rep,name=huntingRecord,proto3" json:"huntingRecord"` //狩猎战斗记录 - VikingRecord []*DBVikingRank `protobuf:"bytes,4,rep,name=vikingRecord,proto3" json:"vikingRecord"` //维京远征战斗记录 + Data *DBUser `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` + Ex *DBUserExpand `protobuf:"bytes,2,opt,name=ex,proto3" json:"ex"` //用户扩展 + PagodaRecord *DBPagodaRecord `protobuf:"bytes,3,opt,name=pagodaRecord,proto3" json:"pagodaRecord"` //爬塔战斗记录 + HuntingRecord []*DBHuntingRank `protobuf:"bytes,4,rep,name=huntingRecord,proto3" json:"huntingRecord"` //狩猎战斗记录 + VikingRecord []*DBVikingRank `protobuf:"bytes,5,rep,name=vikingRecord,proto3" json:"vikingRecord"` //维京远征战斗记录 } func (x *UserBattlerecordResp) Reset() { @@ -1744,11 +1754,18 @@ func (*UserBattlerecordResp) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{34} } -func (x *UserBattlerecordResp) GetUid() string { +func (x *UserBattlerecordResp) GetData() *DBUser { if x != nil { - return x.Uid + return x.Data } - return "" + return nil +} + +func (x *UserBattlerecordResp) GetEx() *DBUserExpand { + if x != nil { + return x.Ex + } + return nil } func (x *UserBattlerecordResp) GetPagodaRecord() *DBPagodaRecord { @@ -2071,32 +2088,36 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x26, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x69, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0xc6, 0x01, 0x0a, 0x14, - 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x33, 0x0a, 0x0c, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, - 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0c, 0x70, - 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x34, 0x0a, 0x0d, 0x68, - 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, - 0x6e, 0x6b, 0x52, 0x0d, 0x68, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x12, 0x31, 0x0a, 0x0c, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, - 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x0c, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x22, 0x34, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x74, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x68, 0x65, - 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, - 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x64, 0x73, 0x22, 0x27, 0x0a, 0x13, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x74, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x77, 0x74, - 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x22, 0x32, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, - 0x6f, 0x77, 0x74, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x68, 0x65, - 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, - 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0xf0, 0x01, + 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x52, 0x02, + 0x65, 0x78, 0x12, 0x33, 0x0a, 0x0c, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, + 0x6f, 0x64, 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0c, 0x70, 0x61, 0x67, 0x6f, 0x64, + 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x34, 0x0a, 0x0d, 0x68, 0x75, 0x6e, 0x74, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x0d, + 0x68, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x31, 0x0a, + 0x0c, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, + 0x6e, 0x6b, 0x52, 0x0c, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x22, 0x34, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x74, + 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, + 0x6a, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x68, 0x65, 0x72, 0x6f, + 0x4f, 0x62, 0x6a, 0x49, 0x64, 0x73, 0x22, 0x27, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x74, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, + 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x77, 0x74, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x22, 0x32, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x77, 0x74, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, + 0x6a, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x68, 0x65, 0x72, 0x6f, + 0x4f, 0x62, 0x6a, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2170,14 +2191,16 @@ var file_user_user_msg_proto_depIdxs = []int32{ 42, // 5: UserLoadResp.data:type_name -> CacheUser 43, // 6: UserGetSettingResp.setting:type_name -> DBUserSetting 43, // 7: UserUpdateSettingReq.setting:type_name -> DBUserSetting - 44, // 8: UserBattlerecordResp.pagodaRecord:type_name -> DBPagodaRecord - 45, // 9: UserBattlerecordResp.huntingRecord:type_name -> DBHuntingRank - 46, // 10: UserBattlerecordResp.vikingRecord:type_name -> DBVikingRank - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 39, // 8: UserBattlerecordResp.data:type_name -> DBUser + 40, // 9: UserBattlerecordResp.ex:type_name -> DBUserExpand + 44, // 10: UserBattlerecordResp.pagodaRecord:type_name -> DBPagodaRecord + 45, // 11: UserBattlerecordResp.huntingRecord:type_name -> DBHuntingRank + 46, // 12: UserBattlerecordResp.vikingRecord:type_name -> DBVikingRank + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_user_user_msg_proto_init() } diff --git a/sys/configure/structs/Game.HerofusionData.go b/sys/configure/structs/Game.HerofusionData.go index 74641a9e7..eb481d465 100644 --- a/sys/configure/structs/Game.HerofusionData.go +++ b/sys/configure/structs/Game.HerofusionData.go @@ -13,8 +13,8 @@ import "errors" type GameHerofusionData struct { Id int32 Switch int32 - Hero int32 - Pointhero []int32 + Hero string + Pointhero []string Awaken int32 Start int32 } @@ -28,17 +28,17 @@ func (*GameHerofusionData) GetTypeId() int32 { func (_v *GameHerofusionData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["switch"].(float64); !_ok_ { err = errors.New("switch error"); return }; _v.Switch = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hero"].(float64); !_ok_ { err = errors.New("hero error"); return }; _v.Hero = int32(_tempNum_) } + { var _ok_ bool; if _v.Hero, _ok_ = _buf["hero"].(string); !_ok_ { err = errors.New("hero error"); return } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["pointhero"].([]interface{}); !_ok_ { err = errors.New("pointhero error"); return } - _v.Pointhero = make([]int32, 0, len(_arr_)) + _v.Pointhero = make([]string, 0, len(_arr_)) for _, _e_ := range _arr_ { - var _list_v_ int32 - { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) } + var _list_v_ string + { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } _v.Pointhero = append(_v.Pointhero, _list_v_) } }