From 23822e2f9bcf234655c128e8913d3ab7e9f6f318 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Thu, 9 Jun 2022 12:03:52 +0800 Subject: [PATCH] fix: update protocode. add account 版本信息协议 --- cmd/gameserver/action/HeroAction.go | 2 +- cmd/gameserver/action/RoleAction.go | 22 +++++++++++----------- cmd/gameserver/gmaction/GmAction.go | 2 +- cmd/gameserver/plugin/plugin.go | 2 +- cmd/gameserver/service/agent.go | 14 +++++++------- cmd/httpserver/action/AccountAction.go | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ cmd/test/action/TestAction.go | 14 +++++++------- cmd/test/action/protocode.go | 8 ++------ go.mod | 3 +++ go.sum | 6 ++++++ models/config.go | 19 +++++++++++++++++++ models/dbseed.go | 9 +++++---- models/equip.go | 4 ++-- models/hero.go | 8 ++++---- models/increment.go | 4 ++-- models/prop.go | 6 +++--- models/role.go | 44 ++++++++++++++++++++++---------------------- models/rolePlugin.go | 30 +++++++++++++++--------------- models/role_test.go | 18 +++++++++--------- models/team.go | 8 ++++---- pb/account.pb.go | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- pb/game.pb.go | 58 +++++++++++++++++++++++++++++----------------------------- pb/models.pb.go | 303 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------- pb/protocode.pb.go | 50 +++++++++++++++++--------------------------------- protos | 2 +- tools/generator.py | 34 +++++++++++++++++----------------- 26 files changed, 541 insertions(+), 302 deletions(-) create mode 100644 models/config.go diff --git a/cmd/gameserver/action/HeroAction.go b/cmd/gameserver/action/HeroAction.go index d6320d1..963d825 100644 --- a/cmd/gameserver/action/HeroAction.go +++ b/cmd/gameserver/action/HeroAction.go @@ -87,5 +87,5 @@ func HeroUpLevelRpc(role *models.RoleModel, msg components.IMessage) (int32, int h.SetProperty("exp", exp) } - return 0, &pb.HeroUpLevelRsp{Hero: hero.Hero} + return 0, &pb.HeroUpLevelRsp{Hero: hero.Data} } diff --git a/cmd/gameserver/action/RoleAction.go b/cmd/gameserver/action/RoleAction.go index 5d4df4e..6f5fe08 100644 --- a/cmd/gameserver/action/RoleAction.go +++ b/cmd/gameserver/action/RoleAction.go @@ -61,9 +61,9 @@ func CreateRpc(role1 *models.RoleModel, msg components.IMessage) (int32, interfa } role = models.NewRole(roleId) - role.Role.Uid = req.Token - role.Role.Level = 1 - role.Role.Nick = getRandomName() + role.Data.Uid = req.Token + role.Data.Level = 1 + role.Data.Nick = getRandomName() if err := role.Create(); err != nil { logger.Error("CreateRpc role create err: %v", err) return 4, nil @@ -161,7 +161,7 @@ func RoleEndBattleRpc(role *models.RoleModel, msg components.IMessage) (int32, i return 1, nil } chapterInfo := csvdata.Get().TbRogueChapter.Get(req.ChapterId) - chapterCount, first := role.Role.Passchapters[req.ChapterId] + chapterCount, first := role.Data.Passchapters[req.ChapterId] carbonInfo, ok := chapterInfo.Carbons[req.CarbonId] if !ok { logger.Error("carbonInfo not exists") @@ -177,14 +177,14 @@ func RoleEndBattleRpc(role *models.RoleModel, msg components.IMessage) (int32, i reward := make(common.IMapStringNum) if !first { - role.Role.Passchapters[req.ChapterId] = 1 + role.Data.Passchapters[req.ChapterId] = 1 for k, v := range common.StringToMapNum(carbonInfo.FirstAward) { reward[k] = v } } else { - role.Role.Passchapters[req.ChapterId] = chapterCount + 1 + role.Data.Passchapters[req.ChapterId] = chapterCount + 1 } - role.SetProperty("passchapters", role.Role.Passchapters) + role.SetProperty("passchapters", role.Data.Passchapters) for k, v := range common.StringToMapNum(carbonInfo.NormalAward) { rv, ok := reward[k] @@ -214,13 +214,13 @@ func RoleEndBattleRpc(role *models.RoleModel, msg components.IMessage) (int32, i //team exp heros := make([]*pb.Hero, 3) - t := team.(*models.TeamModel).Team + t := team.(*models.TeamModel).Data h1, ok := role.Heros[t.HeroId1] if ok { level, exp = h1.(*models.HeroModel).UpLevel(amount) h1.SetProperty("level", level) h1.SetProperty("exp", exp) - heros[0] = h1.(*models.HeroModel).Hero + heros[0] = h1.(*models.HeroModel).Data } h2, ok := role.Heros[t.HeroId2] @@ -228,7 +228,7 @@ func RoleEndBattleRpc(role *models.RoleModel, msg components.IMessage) (int32, i level, exp = h2.(*models.HeroModel).UpLevel(amount) h2.SetProperty("level", level) h2.SetProperty("exp", exp) - heros[1] = h2.(*models.HeroModel).Hero + heros[1] = h2.(*models.HeroModel).Data } h3, ok := role.Heros[t.HeroId3] @@ -236,7 +236,7 @@ func RoleEndBattleRpc(role *models.RoleModel, msg components.IMessage) (int32, i level, exp = h3.(*models.HeroModel).UpLevel(amount) h3.SetProperty("level", level) h3.SetProperty("exp", exp) - heros[2] = h3.(*models.HeroModel).Hero + heros[2] = h3.(*models.HeroModel).Data } rsp.RoleExpamount = amount diff --git a/cmd/gameserver/gmaction/GmAction.go b/cmd/gameserver/gmaction/GmAction.go index d6df922..c07672c 100644 --- a/cmd/gameserver/gmaction/GmAction.go +++ b/cmd/gameserver/gmaction/GmAction.go @@ -33,7 +33,7 @@ func (gm *GmAction) AddEquip(role *models.RoleModel, params GMParams) { equip := &pb.Equipment{ Id: role.IncreEquipByKey(1), - RoleId: role.Role.Id, + RoleId: role.Data.Id, TbId: int32(tbId), Quality: 1, } diff --git a/cmd/gameserver/plugin/plugin.go b/cmd/gameserver/plugin/plugin.go index 50adb9f..12e654d 100644 --- a/cmd/gameserver/plugin/plugin.go +++ b/cmd/gameserver/plugin/plugin.go @@ -36,7 +36,7 @@ func LoginRpc(msg components.IMessage) (int32, interface{}) { role.SetProperty("Device", req.Device) return 0, &pb.RoleRsp{ - Role: role.Role, + Role: role.Data, Hero: role.GetAllHero(), Team: role.GetAllTeam(), } diff --git a/cmd/gameserver/service/agent.go b/cmd/gameserver/service/agent.go index 147d08a..55a87fc 100644 --- a/cmd/gameserver/service/agent.go +++ b/cmd/gameserver/service/agent.go @@ -40,8 +40,8 @@ func (c *Agent) SetSchema(schema components.ISchema) { c.Role = schema.(*models.RoleModel) c.Role.SetConn(c) - c.Server.GetConnManage().AddRID(c.Role.Role.Id, c.IConnection.GetID()) - c.Server.GetConnManage().AddUID(c.Role.Role.Uid, c.IConnection.GetID()) + c.Server.GetConnManage().AddRID(c.Role.Data.Id, c.IConnection.GetID()) + c.Server.GetConnManage().AddUID(c.Role.Data.Uid, c.IConnection.GetID()) } func (c *Agent) GetSchema() components.ISchema { @@ -77,7 +77,7 @@ func (c *Agent) OnLoginQuery(msg components.IMessage) (int32, proto.Message) { conn := c.Server.GetConnManage().GetConnByUID(uid) if conn != nil { logger.Debug("挤掉。。。。。。。。") - conn.SendSuccess(uint32(pb.ProtoCode_DisConnectRsp), nil) + conn.SendSuccess(uint32(pb.ProtoCode_DisConnectNty), nil) conn.Stop() } @@ -87,7 +87,7 @@ func (c *Agent) OnLoginQuery(msg components.IMessage) (int32, proto.Message) { } role.SetProperty("Device", req.Device) protoMsg := &pb.RoleRsp{ - Role: role.Role, + Role: role.Data, Hero: role.GetAllHero(), Team: role.GetAllTeam(), Equipments: role.GetEquipments(), @@ -164,9 +164,9 @@ func (c *Agent) OnClose() { return } - logger.Debug("ID: %d close, roleid", c.IConnection.GetID(), c.Role.Role.Id) - c.Server.GetConnManage().DelRID(c.Role.Role.Id) - c.Server.GetConnManage().DelUID(c.Role.Role.Uid) + logger.Debug("ID: %d close, roleid", c.IConnection.GetID(), c.Role.Data.Id) + c.Server.GetConnManage().DelRID(c.Role.Data.Id) + c.Server.GetConnManage().DelUID(c.Role.Data.Uid) c.Role.OnOfflineEvent() } diff --git a/cmd/httpserver/action/AccountAction.go b/cmd/httpserver/action/AccountAction.go index a7c9209..8409d8a 100644 --- a/cmd/httpserver/action/AccountAction.go +++ b/cmd/httpserver/action/AccountAction.go @@ -12,6 +12,8 @@ import ( "pro2d/common/sms" "pro2d/models" "pro2d/pb" + "strconv" + "strings" ) type AccountAction struct { @@ -117,3 +119,80 @@ func (h *AccountAction) Sms(c *gin.Context) (int, interface{}) { return 0, nil } + +/* +Version 获取版本信息 + 1 版本数据获取错误 + 2 分割版本数据错误 +*/ +func (h *AccountAction) Version(c *gin.Context) (int, interface{}) { + i := 0 + x := 0 + y := 0 + cfg := models.NewConfig() + if err := cfg.Load(); err != nil { + return 1, nil + } + + res := strings.Split(cfg.Data.Version, ".") + if len(res) != 3 { + return 2, nil + } + + i, _ = strconv.Atoi(res[0]) + x, _ = strconv.Atoi(res[1]) + y, _ = strconv.Atoi(res[2]) + return 0, &pb.UpdateVersion{ + I: int32(i), + X: int32(x), + Y: int32(y), + } +} + +/* +UPVersion 更新版本 + 参数 update=x or update=y + 1 版本数据获取错误 + 2 分割版本数据错误 +*/ +func (h *AccountAction) UPVersion(c *gin.Context) (int, interface{}) { + update, b := c.GetQuery("update") + if !b { + update = "y" + } + + i := 1 + x := 0 + y := 0 + cfg := models.NewConfig() + if err := cfg.Load(); err != nil { + err = cfg.Create() + if err != nil { + return 1, nil + } + } + + res := strings.Split(cfg.Data.Version, ".") + if len(res) != 3 { + return 2, nil + } + + i, _ = strconv.Atoi(res[0]) + x, _ = strconv.Atoi(res[1]) + y, _ = strconv.Atoi(res[2]) + + if update == "x" { + x++ + } else { + y++ + } + version := []string{res[0], strconv.Itoa(x), strconv.Itoa(y)} + cfg.SetProperty("version", strings.Join(version, ".")) + cfg.Update() + + return 0, &pb.UpdateVersion{ + I: int32(i), + X: int32(x), + Y: int32(y), + } +} diff --git a/cmd/test/action/TestAction.go b/cmd/test/action/TestAction.go index ede1409..37a7921 100644 --- a/cmd/test/action/TestAction.go +++ b/cmd/test/action/TestAction.go @@ -17,9 +17,6 @@ func LoginRsp(role *models.RoleTestModel, msg components.IMessage) { func CreateRsp(role *models.RoleTestModel, msg components.IMessage) { } -func DisConnectRsp(role *models.RoleTestModel, msg components.IMessage) { -} - func ChangeTeamRsp(role *models.RoleTestModel, msg components.IMessage) { } func HeroEquipReferRsp(role *models.RoleTestModel, msg components.IMessage) { @@ -31,9 +28,6 @@ func RoleRsp(role *models.RoleTestModel, msg components.IMessage) { func RoleUpdatePropertyRsp(role *models.RoleTestModel, msg components.IMessage) { } -func RoleUpdateItemsNty(role *models.RoleTestModel, msg components.IMessage) { -} - func RoleUpdateChangeRsp(role *models.RoleTestModel, msg components.IMessage) { } @@ -51,11 +45,17 @@ func RoleEndBattleRsp(role *models.RoleTestModel, msg components.IMessage) { } logger.Debug(rsp.Reward) } - func EquipmentDelRsp(role *models.RoleTestModel, msg components.IMessage) { } func EquipmentAddRsp(role *models.RoleTestModel, msg components.IMessage) { } + func HeroUpLevelRsp(role *models.RoleTestModel, msg components.IMessage) { } + +func DisConnectNty(role *models.RoleTestModel, msg components.IMessage) { +} + +func RoleUpdateItemsNty(role *models.RoleTestModel, msg components.IMessage) { +} diff --git a/cmd/test/action/protocode.go b/cmd/test/action/protocode.go index 46ae088..1071a0c 100644 --- a/cmd/test/action/protocode.go +++ b/cmd/test/action/protocode.go @@ -16,13 +16,9 @@ func GetTestActionMap() map[interface{}]interface{} { am[uint32(pb.ProtoCode_EquipmentDelRpc)] = EquipmentDelRsp am[uint32(pb.ProtoCode_HeroUpLevelRpc)] = HeroUpLevelRsp am[uint32(pb.ProtoCode_DisConnectNty)] = DisConnectNty + am[uint32(pb.ProtoCode_RoleUpdatePropertyNty)] = RoleUpdatePropertyNty am[uint32(pb.ProtoCode_RoleUpdateItemsNty)] = RoleUpdateItemsNty - am[uint32(pb.ProtoCode_HeartRsp)] = HeartRsp - am[uint32(pb.ProtoCode_RoleRsp)] = RoleRsp - am[uint32(pb.ProtoCode_RoleUpdatePropertyRsp)] = RoleUpdatePropertyRsp - am[uint32(pb.ProtoCode_RoleEndBattleRsp)] = RoleEndBattleRsp - am[uint32(pb.ProtoCode_EquipmentAddRsp)] = EquipmentAddRsp - am[uint32(pb.ProtoCode_HeroUpLevelRsp)] = HeroUpLevelRsp + am[uint32(pb.ProtoCode_EquipmentAddNty)] = EquipmentAddNty return am } diff --git a/go.mod b/go.mod index 442da9f..2a4b865 100644 --- a/go.mod +++ b/go.mod @@ -49,15 +49,18 @@ require ( github.com/xdg-go/scram v1.0.2 // indirect github.com/xdg-go/stringprep v1.0.2 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + github.com/yuin/goldmark v1.4.1 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.2 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.17.0 // indirect golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect + golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect golang.org/x/text v0.3.7 // indirect + golang.org/x/tools v0.1.10 // indirect golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect google.golang.org/grpc v1.38.0 // indirect diff --git a/go.sum b/go.sum index dc93c3c..85372f4 100644 --- a/go.sum +++ b/go.sum @@ -223,6 +223,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/etcd/api/v3 v3.5.2 h1:tXok5yLlKyuQ/SXSjtqHc4uzNaMqZi2XsoSPr/LlJXI= go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.2 h1:4hzqQ6hIb3blLyQ8usCU4h3NghkqcsohEQ3o3VetYxE= @@ -256,6 +258,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -334,6 +338,8 @@ golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/models/config.go b/models/config.go new file mode 100644 index 0000000..8af68eb --- /dev/null +++ b/models/config.go @@ -0,0 +1,19 @@ +package models + +import ( + "pro2d/common/components" + "pro2d/pb" +) + +type ConfigModel struct { + components.ISchema + Data *pb.Config +} + +func NewConfig() *ConfigModel { + data := &pb.Config{Id: "1"} + return &ConfigModel{ + ISchema: NewSchema(data.String(), data), + Data: data, + } +} diff --git a/models/dbseed.go b/models/dbseed.go index f499e0b..221ef62 100644 --- a/models/dbseed.go +++ b/models/dbseed.go @@ -35,6 +35,7 @@ func DBSeedS() *DBSeed { func AccountModels() STOIncrement { return STOIncrement{ &pb.Account{}: 0, + &pb.Config{}: 0, "uid": common.MaxUidNum, } } @@ -68,12 +69,12 @@ func (d *DBSeed) InitAutoIncreUidTable(schema STOIncrement) { if err := autoIncrement.Load(); err != nil { //字段不存在 初始化 id increId = d.serverID * b - autoIncrement.Incre.Key = name - autoIncrement.Incre.Val = increId + autoIncrement.Data.Key = name + autoIncrement.Data.Val = increId autoIncrement.Create() } else { - increId = autoIncrement.Incre.Val + increId = autoIncrement.Data.Val } //设置到redis中,提供初始自增id @@ -118,7 +119,7 @@ func (d *DBSeed) SaveAutoincrementTimer(schema STOIncrement) { continue } else { - dbID = autoIncrement.Incre.Val + dbID = autoIncrement.Data.Val } //获取redis中的id 内存中的数据。获取自增id relayID, err := redis.Int64(redisproxy.HGET(fmt.Sprintf(common.AutoIncrement, d.serverID), name)) diff --git a/models/equip.go b/models/equip.go index 603928c..3118677 100644 --- a/models/equip.go +++ b/models/equip.go @@ -7,13 +7,13 @@ import ( type EquipModel struct { components.ISchema - Equip *pb.Equipment + Data *pb.Equipment } func NewEquip(data *pb.Equipment) *EquipModel { m := &EquipModel{ ISchema: NewSchema(data.Id, data), - Equip: data, + Data: data, } return m diff --git a/models/hero.go b/models/hero.go index a237850..7c62861 100644 --- a/models/hero.go +++ b/models/hero.go @@ -9,14 +9,14 @@ import ( type HeroModel struct { components.ISchema - Hero *pb.Hero + Data *pb.Hero Equipments common.IMapStringNum } func NewHero(hero *pb.Hero) *HeroModel { m := &HeroModel{ ISchema: NewSchema(hero.Id, hero), - Hero: hero, + Data: hero, Equipments: common.StringToMapNum(hero.Equipments), } return m @@ -32,8 +32,8 @@ func (m *HeroModel) AddEquipment(key string, pos int32) { m.SetProperty("equipments", common.MapNumToString(m.Equipments)) } func (m *HeroModel) UpLevel(exp int32) (int32, int32) { - exp = exp + m.Hero.Exp - level := m.Hero.Level + exp = exp + m.Data.Exp + level := m.Data.Level oldLevelExp := csvdata.Get().TbHeroLevelExp.Get(level) if oldLevelExp == nil { return level, exp diff --git a/models/increment.go b/models/increment.go index 38c5b59..1de3d1d 100644 --- a/models/increment.go +++ b/models/increment.go @@ -7,7 +7,7 @@ import ( type IncrementModels struct { components.ISchema - Incre *pb.Increment + Data *pb.Increment } func NewIncrement(key string) *IncrementModels { @@ -17,7 +17,7 @@ func NewIncrement(key string) *IncrementModels { r := &IncrementModels{ ISchema: NewSchema(data.Key, data), - Incre: data, + Data: data, } return r } diff --git a/models/prop.go b/models/prop.go index f5e54d7..47eaac0 100644 --- a/models/prop.go +++ b/models/prop.go @@ -7,7 +7,7 @@ import ( type PropModel struct { components.ISchema - Prop *pb.Prop + Data *pb.Prop } func NewProp(id string) *PropModel { @@ -16,8 +16,8 @@ func NewProp(id string) *PropModel { } m := &PropModel{ ISchema: NewSchema(id, data), - Prop: data, + Data: data, } return m -} \ No newline at end of file +} diff --git a/models/role.go b/models/role.go index 68943b3..25012c4 100644 --- a/models/role.go +++ b/models/role.go @@ -13,7 +13,7 @@ import ( type RoleModel struct { components.ISchema - Role *pb.Role + Data *pb.Role Heros SchemaMap Teams SchemaMap Equipments SchemaMap @@ -27,13 +27,13 @@ func RoleExistByUid(uid string) *RoleModel { data := &pb.Role{Uid: uid, Incres: make(map[string]uint32), Passchapters: make(map[int32]int32)} if err := mongoproxy.FindOne(mongoproxy.GetCollName(data), mongoproxy.GetBsonM("uid", uid), data); err != nil { - logger.Error("Role not exist err: %v", err) + logger.Error("Data not exist err: %v", err) return nil } r := &RoleModel{ ISchema: NewSchema(data.Id, data), - Role: data, + Data: data, Heros: make(SchemaMap), Teams: make(SchemaMap), Equipments: make(SchemaMap), @@ -49,7 +49,7 @@ func NewRole(id string) *RoleModel { data := &pb.Role{Id: id, Incres: make(map[string]uint32), Passchapters: make(map[int32]int32)} m := &RoleModel{ ISchema: NewSchema(id, data), - Role: data, + Data: data, Heros: make(SchemaMap), Teams: make(SchemaMap), Equipments: make(SchemaMap), @@ -60,34 +60,34 @@ func NewRole(id string) *RoleModel { } func (m *RoleModel) IncreByKey(key string, detal uint32) uint32 { - v, ok := m.Role.Incres[key] + v, ok := m.Data.Incres[key] if !ok { v = detal } else { v += detal } - m.Role.Incres[key] = v - m.SetProperty("incres", m.Role.Incres) + m.Data.Incres[key] = v + m.SetProperty("incres", m.Data.Incres) return v } func (m *RoleModel) IncreHearByKey(detal uint32) string { - return fmt.Sprintf("%s%04d", m.Role.Id, m.IncreByKey("hero", detal)) + return fmt.Sprintf("%s%04d", m.Data.Id, m.IncreByKey("hero", detal)) } func (m *RoleModel) IncreTeamByKey(detal uint32) string { - return fmt.Sprintf("%s%02d", m.Role.Id, m.IncreByKey("team", detal)) + return fmt.Sprintf("%s%02d", m.Data.Id, m.IncreByKey("team", detal)) } func (m *RoleModel) IncreEquipByKey(detal uint32) string { - return fmt.Sprintf("%s%04d", m.Role.Id, m.IncreByKey("equipment", detal)) + return fmt.Sprintf("%s%04d", m.Data.Id, m.IncreByKey("equipment", detal)) } func (m *RoleModel) InitRole() { //init hero h1 := pb.Hero{ Id: m.IncreHearByKey(1), - RoleId: m.Role.Id, + RoleId: m.Data.Id, Type: 1, Level: 1, ReinCount: 0, @@ -113,7 +113,7 @@ func (m *RoleModel) InitRole() { //init team t1 := pb.Team{ Id: m.IncreTeamByKey(1), - RoleId: m.Role.Id, + RoleId: m.Data.Id, HeroId1: h1.Id, HeroId2: h2.Id, HeroId3: h3.Id, @@ -141,7 +141,7 @@ func (m *RoleModel) InitRole() { func (m *RoleModel) LoadHero() { heros := make([]*pb.Hero, 10) - err := mongoproxy.FindMany("hero", "roleid", m.Role.Id, &heros) + err := mongoproxy.FindMany("hero", "roleid", m.Data.Id, &heros) if err != nil { logger.Error(err) return @@ -153,7 +153,7 @@ func (m *RoleModel) LoadHero() { func (m *RoleModel) LoadTeams() { teams := make([]*pb.Team, 4) - err := mongoproxy.FindMany("team", "roleid", m.Role.Id, &teams) + err := mongoproxy.FindMany("team", "roleid", m.Data.Id, &teams) if err != nil { logger.Error(err) return @@ -165,12 +165,12 @@ func (m *RoleModel) LoadTeams() { //加载背包数据到内存 func (m *RoleModel) LoadItems() { - m.Items = common.StringToMapNum(m.Role.Items) + m.Items = common.StringToMapNum(m.Data.Items) } func (m *RoleModel) LoadEquipments() { data := make([]*pb.Equipment, 10) - err := mongoproxy.FindMany("equipment", "roleid", m.Role.Id, &data) + err := mongoproxy.FindMany("equipment", "roleid", m.Data.Id, &data) if err != nil { logger.Error(err) return @@ -204,16 +204,16 @@ func (m *RoleModel) UpdateProperties(property map[string]interface{}, notify boo return } - update := &pb.RoleUpdatePropertyRsp{ + update := &pb.RoleUpdatePropertyNty{ Id: ids, Role: role, } if rsp, err := proto.Marshal(update); err != nil { - logger.Error("id %s, err:", m.Role.Id, err) + logger.Error("id %s, err:", m.Data.Id, err) return } else { if m.GetConn() != nil && notify { - m.GetConn().Send(0, uint32(pb.ProtoCode_RoleUpdatePropertyRsp), rsp) + m.GetConn().Send(0, uint32(pb.ProtoCode_RoleUpdatePropertyNty), rsp) } } } @@ -221,7 +221,7 @@ func (m *RoleModel) UpdateProperties(property map[string]interface{}, notify boo func (m *RoleModel) GetAllHero() []*pb.Hero { var h []*pb.Hero for _, hero := range m.Heros { - h = append(h, hero.(*HeroModel).Hero) + h = append(h, hero.(*HeroModel).Data) } return h } @@ -229,7 +229,7 @@ func (m *RoleModel) GetAllHero() []*pb.Hero { func (m *RoleModel) GetAllTeam() []*pb.Team { var t []*pb.Team for _, team := range m.Teams { - t = append(t, team.(*TeamModel).Team) + t = append(t, team.(*TeamModel).Data) } return t } @@ -237,7 +237,7 @@ func (m *RoleModel) GetAllTeam() []*pb.Team { func (m *RoleModel) GetEquipments() []*pb.Equipment { var equips []*pb.Equipment for _, e := range m.Equipments { - equips = append(equips, e.(*EquipModel).Equip) + equips = append(equips, e.(*EquipModel).Data) } return equips } diff --git a/models/rolePlugin.go b/models/rolePlugin.go index 080c7c4..d5a36b6 100644 --- a/models/rolePlugin.go +++ b/models/rolePlugin.go @@ -104,7 +104,7 @@ func (m *RoleModel) AddTeam(team *pb.Team) { func (m *RoleModel) UpdateTeam(teams []*pb.Team) { for _, team := range teams { - team.RoleId = m.Role.Id + team.RoleId = m.Data.Id t := m.Teams[team.Id] if t != nil { t.UpdateSchema(team) @@ -121,20 +121,20 @@ func (m *RoleModel) AddEquip(equip *pb.Equipment) *EquipModel { } func (m *RoleModel) EquipmentAddNotify(equip *pb.Equipment) { - update := &pb.EquipmentAddRsp{Equip: equip} + update := &pb.EquipmentAddNty{Equip: equip} if rsp, err := proto.Marshal(update); err != nil { logger.Error(" EquipmentAddNotify err:", err.Error()) return } else { if m.GetConn() != nil { - m.GetConn().SendSuccess(uint32(pb.ProtoCode_EquipmentAddRsp), rsp) + m.GetConn().SendSuccess(uint32(pb.ProtoCode_EquipmentAddNty), rsp) } } } func (m *RoleModel) UpLevel(exp int32) (int32, int32) { - exp = exp + m.Role.Exp - level := m.Role.Level + exp = exp + m.Data.Exp + level := m.Data.Level oldLevelExp := csvdata.Get().TbAccountLevelExp.Get(level) if oldLevelExp == nil { return level, exp @@ -177,18 +177,18 @@ func (m *RoleModel) EquipmentRefer(equipId, heroId string, refer bool, pos int32 // 2.1.2 如果不是戒指,如果其他英雄已经被穿戴,则脱了再穿, 同位置装备是否穿戴, 已经被穿戴,则脱了再穿 // 可以合并。不用判断是否是戒指。 h1 := m.Heros[heroId] - h2 := m.Heros[equip.Equip.HeroId] + h2 := m.Heros[equip.Data.HeroId] var outHero, inHero *HeroModel - inEquip := csvdata.Get().TbEquipmentData.Get(equip.Equip.GetTbId()) + inEquip := csvdata.Get().TbEquipmentData.Get(equip.Data.GetTbId()) if !refer { if h1 != nil { outHero = h1.(*HeroModel) - outHero.DelEquipment(equip.Equip.Id) + outHero.DelEquipment(equip.Data.Id) } if h2 != nil { outHero = h2.(*HeroModel) - outHero.DelEquipment(equip.Equip.Id) + outHero.DelEquipment(equip.Data.Id) } equip.SetProperty("heroid", "") @@ -204,7 +204,7 @@ func (m *RoleModel) EquipmentRefer(equipId, heroId string, refer bool, pos int32 } } // 2.1.1 - if equip.Equip.HeroId == "" { + if equip.Data.HeroId == "" { var outEquipID string for id, typ := range inHero.Equipments { if typ == pos { @@ -221,8 +221,8 @@ func (m *RoleModel) EquipmentRefer(equipId, heroId string, refer bool, pos int32 } } - inHero.AddEquipment(equip.Equip.Id, pos) - equip.SetProperty("heroid", inHero.Hero.Id) + inHero.AddEquipment(equip.Data.Id, pos) + equip.SetProperty("heroid", inHero.Data.Id) equip.SetProperty("pos", pos) } else { if h2 == nil { @@ -247,9 +247,9 @@ func (m *RoleModel) EquipmentRefer(equipId, heroId string, refer bool, pos int32 } } - outHero.DelEquipment(equip.Equip.Id) - inHero.AddEquipment(equip.Equip.Id, pos) - equip.SetProperty("heroid", inHero.Hero.Id) + outHero.DelEquipment(equip.Data.Id) + inHero.AddEquipment(equip.Data.Id, pos) + equip.SetProperty("heroid", inHero.Data.Id) equip.SetProperty("pos", pos) } diff --git a/models/role_test.go b/models/role_test.go index 4c3e4e0..d88ce69 100644 --- a/models/role_test.go +++ b/models/role_test.go @@ -21,9 +21,9 @@ func TestNewRole(t *testing.T) { role := RoleExistByUid(uid) if role != nil { //uid存在 , 更新角色 - //role.AddHero(&pb.Hero{ + //role.AddHero(&pb.Data{ // Id: 1, - // RoleId: role.Role.Id, + // RoleId: role.Data.Id, // Type: 0, // Level: 0, // ReinCount: 0, @@ -35,9 +35,9 @@ func TestNewRole(t *testing.T) { } else { //uid不存在,创建角色 role = NewRole("1") - role.Role.Uid = uid - role.Role.Device = "111111" - role.Role.Level = 0 + role.Data.Uid = uid + role.Data.Device = "111111" + role.Data.Level = 0 err := role.Create() fmt.Println(err) } @@ -81,7 +81,7 @@ func TestRoleModel_ProtoReflect(t *testing.T) { // "Device": "12312312312", //} sch.UpdateProperty("Device", "123123123", false) - fmt.Println(sch.Role) + fmt.Println(sch.Data) } func TestRoleModel_UpdateTeam(t *testing.T) { @@ -115,9 +115,9 @@ func TestRoleModel_IncreByKey(t *testing.T) { //sch.Load() //sch.LoadAll() // - //sch.Role.Incres["hero"] = 4 - //sch.Role.Incres["team"] = 4 - //sch.SetProperty("incres", sch.Role.Incres) + //sch.Data.Incres["hero"] = 4 + //sch.Data.Incres["team"] = 4 + //sch.SetProperty("incres", sch.Data.Incres) //sch.Update() fmt.Printf("%03d\n", 3) diff --git a/models/team.go b/models/team.go index 595f37d..e3399b7 100644 --- a/models/team.go +++ b/models/team.go @@ -10,13 +10,13 @@ import ( type TeamMap map[string]*TeamModel type TeamModel struct { components.ISchema - Team *pb.Team + Data *pb.Team } func NewTeam(data *pb.Team) *TeamModel { m := &TeamModel{ ISchema: NewSchema(data.Id, data), - Team: data, + Data: data, } return m @@ -25,12 +25,12 @@ func NewTeam(data *pb.Team) *TeamModel { func TeamExistsByID(id string) *TeamModel { data := &pb.Team{Id: id} if err := mongoproxy.FindOne(mongoproxy.GetCollName(data), mongoproxy.GetBsonM("id", id), data); err != nil { - logger.Error("Role not exist err: %v", err) + logger.Error("Data not exist err: %v", err) return nil } r := &TeamModel{ ISchema: NewSchema(data.Id, data), - Team: data, + Data: data, } return r } diff --git a/pb/account.pb.go b/pb/account.pb.go index f237061..a47f948 100644 --- a/pb/account.pb.go +++ b/pb/account.pb.go @@ -217,6 +217,69 @@ func (x *Register) GetCode() string { return "" } +type UpdateVersion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + I int32 `protobuf:"varint,1,opt,name=i,proto3" json:"i,omitempty"` + X int32 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` + Y int32 `protobuf:"varint,3,opt,name=y,proto3" json:"y,omitempty"` +} + +func (x *UpdateVersion) Reset() { + *x = UpdateVersion{} + if protoimpl.UnsafeEnabled { + mi := &file_account_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateVersion) ProtoMessage() {} + +func (x *UpdateVersion) ProtoReflect() protoreflect.Message { + mi := &file_account_proto_msgTypes[3] + 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 UpdateVersion.ProtoReflect.Descriptor instead. +func (*UpdateVersion) Descriptor() ([]byte, []int) { + return file_account_proto_rawDescGZIP(), []int{3} +} + +func (x *UpdateVersion) GetI() int32 { + if x != nil { + return x.I + } + return 0 +} + +func (x *UpdateVersion) GetX() int32 { + if x != nil { + return x.X + } + return 0 +} + +func (x *UpdateVersion) GetY() int32 { + if x != nil { + return x.Y + } + return 0 +} + var File_account_proto protoreflect.FileDescriptor var file_account_proto_rawDesc = []byte{ @@ -240,8 +303,12 @@ var file_account_proto_rawDesc = []byte{ 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x39, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x01, 0x69, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, + 0x79, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -256,11 +323,12 @@ func file_account_proto_rawDescGZIP() []byte { return file_account_proto_rawDescData } -var file_account_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_account_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_account_proto_goTypes = []interface{}{ - (*ServiceInfo)(nil), // 0: account.ServiceInfo - (*LoginRsp)(nil), // 1: account.LoginRsp - (*Register)(nil), // 2: account.Register + (*ServiceInfo)(nil), // 0: account.ServiceInfo + (*LoginRsp)(nil), // 1: account.LoginRsp + (*Register)(nil), // 2: account.Register + (*UpdateVersion)(nil), // 3: account.UpdateVersion } var file_account_proto_depIdxs = []int32{ 0, // 0: account.LoginRsp.game_service:type_name -> account.ServiceInfo @@ -313,6 +381,18 @@ func file_account_proto_init() { return nil } } + file_account_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateVersion); 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{ @@ -320,7 +400,7 @@ func file_account_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_account_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/game.pb.go b/pb/game.pb.go index 5897c04..1d6e250 100644 --- a/pb/game.pb.go +++ b/pb/game.pb.go @@ -503,8 +503,8 @@ func (x *RoleRsp) GetEquipments() []*Equipment { return nil } -//ResponseCmd RoleUpdatePropertyRsp -type RoleUpdatePropertyRsp struct { +//ResponseCmd RoleUpdatePropertyNty +type RoleUpdatePropertyNty struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -513,8 +513,8 @@ type RoleUpdatePropertyRsp struct { Role *Role `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` } -func (x *RoleUpdatePropertyRsp) Reset() { - *x = RoleUpdatePropertyRsp{} +func (x *RoleUpdatePropertyNty) Reset() { + *x = RoleUpdatePropertyNty{} if protoimpl.UnsafeEnabled { mi := &file_game_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -522,13 +522,13 @@ func (x *RoleUpdatePropertyRsp) Reset() { } } -func (x *RoleUpdatePropertyRsp) String() string { +func (x *RoleUpdatePropertyNty) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RoleUpdatePropertyRsp) ProtoMessage() {} +func (*RoleUpdatePropertyNty) ProtoMessage() {} -func (x *RoleUpdatePropertyRsp) ProtoReflect() protoreflect.Message { +func (x *RoleUpdatePropertyNty) ProtoReflect() protoreflect.Message { mi := &file_game_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -540,19 +540,19 @@ func (x *RoleUpdatePropertyRsp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RoleUpdatePropertyRsp.ProtoReflect.Descriptor instead. -func (*RoleUpdatePropertyRsp) Descriptor() ([]byte, []int) { +// Deprecated: Use RoleUpdatePropertyNty.ProtoReflect.Descriptor instead. +func (*RoleUpdatePropertyNty) Descriptor() ([]byte, []int) { return file_game_proto_rawDescGZIP(), []int{9} } -func (x *RoleUpdatePropertyRsp) GetId() []int32 { +func (x *RoleUpdatePropertyNty) GetId() []int32 { if x != nil { return x.Id } return nil } -func (x *RoleUpdatePropertyRsp) GetRole() *Role { +func (x *RoleUpdatePropertyNty) GetRole() *Role { if x != nil { return x.Role } @@ -919,7 +919,7 @@ func (x *EquipmentDelReq) GetId() []string { } //ResponseCmd EquipmentAddRsp -type EquipmentAddRsp struct { +type EquipmentAddNty struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -927,8 +927,8 @@ type EquipmentAddRsp struct { Equip *Equipment `protobuf:"bytes,1,opt,name=equip,proto3" json:"equip,omitempty"` } -func (x *EquipmentAddRsp) Reset() { - *x = EquipmentAddRsp{} +func (x *EquipmentAddNty) Reset() { + *x = EquipmentAddNty{} if protoimpl.UnsafeEnabled { mi := &file_game_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -936,13 +936,13 @@ func (x *EquipmentAddRsp) Reset() { } } -func (x *EquipmentAddRsp) String() string { +func (x *EquipmentAddNty) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EquipmentAddRsp) ProtoMessage() {} +func (*EquipmentAddNty) ProtoMessage() {} -func (x *EquipmentAddRsp) ProtoReflect() protoreflect.Message { +func (x *EquipmentAddNty) ProtoReflect() protoreflect.Message { mi := &file_game_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -954,12 +954,12 @@ func (x *EquipmentAddRsp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use EquipmentAddRsp.ProtoReflect.Descriptor instead. -func (*EquipmentAddRsp) Descriptor() ([]byte, []int) { +// Deprecated: Use EquipmentAddNty.ProtoReflect.Descriptor instead. +func (*EquipmentAddNty) Descriptor() ([]byte, []int) { return file_game_proto_rawDescGZIP(), []int{16} } -func (x *EquipmentAddRsp) GetEquip() *Equipment { +func (x *EquipmentAddNty) GetEquip() *Equipment { if x != nil { return x.Equip } @@ -1111,8 +1111,8 @@ var file_game_proto_rawDesc = []byte{ 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x49, 0x0a, 0x15, 0x52, 0x6f, 0x6c, 0x65, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x73, - 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x02, 0x69, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4e, 0x74, + 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x2a, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, @@ -1149,7 +1149,7 @@ var file_game_proto_rawDesc = []byte{ 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3a, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, - 0x52, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x71, 0x75, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x4e, 0x74, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x71, 0x75, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x71, 0x75, 0x69, 0x70, 0x22, 0x3e, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x55, 0x70, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x16, @@ -1186,14 +1186,14 @@ var file_game_proto_goTypes = []interface{}{ (*EquipInfo)(nil), // 6: game.EquipInfo (*HeroEquipReferReq)(nil), // 7: game.HeroEquipReferReq (*RoleRsp)(nil), // 8: game.RoleRsp - (*RoleUpdatePropertyRsp)(nil), // 9: game.RoleUpdatePropertyRsp + (*RoleUpdatePropertyNty)(nil), // 9: game.RoleUpdatePropertyNty (*RoleUpdateItemsNty)(nil), // 10: game.RoleUpdateItemsNty (*RoleClearItemsReq)(nil), // 11: game.RoleClearItemsReq (*RoleStartBattleReq)(nil), // 12: game.RoleStartBattleReq (*RoleEndBattleReq)(nil), // 13: game.RoleEndBattleReq (*RoleEndBattleRsp)(nil), // 14: game.RoleEndBattleRsp (*EquipmentDelReq)(nil), // 15: game.EquipmentDelReq - (*EquipmentAddRsp)(nil), // 16: game.EquipmentAddRsp + (*EquipmentAddNty)(nil), // 16: game.EquipmentAddNty (*HeroUpLevelReq)(nil), // 17: game.HeroUpLevelReq (*HeroUpLevelRsp)(nil), // 18: game.HeroUpLevelRsp (*Team)(nil), // 19: models.Team @@ -1208,9 +1208,9 @@ var file_game_proto_depIdxs = []int32{ 21, // 3: game.RoleRsp.hero:type_name -> models.Hero 19, // 4: game.RoleRsp.team:type_name -> models.Team 22, // 5: game.RoleRsp.equipments:type_name -> models.Equipment - 20, // 6: game.RoleUpdatePropertyRsp.role:type_name -> models.Role + 20, // 6: game.RoleUpdatePropertyNty.role:type_name -> models.Role 21, // 7: game.RoleEndBattleRsp.hero:type_name -> models.Hero - 22, // 8: game.EquipmentAddRsp.equip:type_name -> models.Equipment + 22, // 8: game.EquipmentAddNty.equip:type_name -> models.Equipment 21, // 9: game.HeroUpLevelRsp.hero:type_name -> models.Hero 10, // [10:10] is the sub-list for method output_type 10, // [10:10] is the sub-list for method input_type @@ -1335,7 +1335,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleUpdatePropertyRsp); i { + switch v := v.(*RoleUpdatePropertyNty); i { case 0: return &v.state case 1: @@ -1419,7 +1419,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EquipmentAddRsp); i { + switch v := v.(*EquipmentAddNty); i { case 0: return &v.state case 1: diff --git a/pb/models.pb.go b/pb/models.pb.go index 1e4d926..f3cb3d1 100644 --- a/pb/models.pb.go +++ b/pb/models.pb.go @@ -83,6 +83,61 @@ func (x *Account) GetUid() string { return "" } +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" index:"unique" pri:"1"` // @inject_tag: index:"unique" pri:"1" + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_models_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_models_proto_msgTypes[1] + 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 Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_models_proto_rawDescGZIP(), []int{1} +} + +func (x *Config) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Config) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type Hero struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -101,7 +156,7 @@ type Hero struct { func (x *Hero) Reset() { *x = Hero{} if protoimpl.UnsafeEnabled { - mi := &file_models_proto_msgTypes[1] + mi := &file_models_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -114,7 +169,7 @@ func (x *Hero) String() string { func (*Hero) ProtoMessage() {} func (x *Hero) ProtoReflect() protoreflect.Message { - mi := &file_models_proto_msgTypes[1] + mi := &file_models_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -127,7 +182,7 @@ func (x *Hero) ProtoReflect() protoreflect.Message { // Deprecated: Use Hero.ProtoReflect.Descriptor instead. func (*Hero) Descriptor() ([]byte, []int) { - return file_models_proto_rawDescGZIP(), []int{1} + return file_models_proto_rawDescGZIP(), []int{2} } func (x *Hero) GetId() string { @@ -203,7 +258,7 @@ type Equipment struct { func (x *Equipment) Reset() { *x = Equipment{} if protoimpl.UnsafeEnabled { - mi := &file_models_proto_msgTypes[2] + mi := &file_models_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -216,7 +271,7 @@ func (x *Equipment) String() string { func (*Equipment) ProtoMessage() {} func (x *Equipment) ProtoReflect() protoreflect.Message { - mi := &file_models_proto_msgTypes[2] + mi := &file_models_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -229,7 +284,7 @@ func (x *Equipment) ProtoReflect() protoreflect.Message { // Deprecated: Use Equipment.ProtoReflect.Descriptor instead. func (*Equipment) Descriptor() ([]byte, []int) { - return file_models_proto_rawDescGZIP(), []int{2} + return file_models_proto_rawDescGZIP(), []int{3} } func (x *Equipment) GetId() string { @@ -293,7 +348,7 @@ type Prop struct { func (x *Prop) Reset() { *x = Prop{} if protoimpl.UnsafeEnabled { - mi := &file_models_proto_msgTypes[3] + mi := &file_models_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -306,7 +361,7 @@ func (x *Prop) String() string { func (*Prop) ProtoMessage() {} func (x *Prop) ProtoReflect() protoreflect.Message { - mi := &file_models_proto_msgTypes[3] + mi := &file_models_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -319,7 +374,7 @@ func (x *Prop) ProtoReflect() protoreflect.Message { // Deprecated: Use Prop.ProtoReflect.Descriptor instead. func (*Prop) Descriptor() ([]byte, []int) { - return file_models_proto_rawDescGZIP(), []int{3} + return file_models_proto_rawDescGZIP(), []int{4} } func (x *Prop) GetId() string { @@ -351,7 +406,7 @@ type Team struct { func (x *Team) Reset() { *x = Team{} if protoimpl.UnsafeEnabled { - mi := &file_models_proto_msgTypes[4] + mi := &file_models_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -364,7 +419,7 @@ func (x *Team) String() string { func (*Team) ProtoMessage() {} func (x *Team) ProtoReflect() protoreflect.Message { - mi := &file_models_proto_msgTypes[4] + mi := &file_models_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -377,7 +432,7 @@ func (x *Team) ProtoReflect() protoreflect.Message { // Deprecated: Use Team.ProtoReflect.Descriptor instead. func (*Team) Descriptor() ([]byte, []int) { - return file_models_proto_rawDescGZIP(), []int{4} + return file_models_proto_rawDescGZIP(), []int{5} } func (x *Team) GetId() string { @@ -427,7 +482,7 @@ type Increment struct { func (x *Increment) Reset() { *x = Increment{} if protoimpl.UnsafeEnabled { - mi := &file_models_proto_msgTypes[5] + mi := &file_models_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -440,7 +495,7 @@ func (x *Increment) String() string { func (*Increment) ProtoMessage() {} func (x *Increment) ProtoReflect() protoreflect.Message { - mi := &file_models_proto_msgTypes[5] + mi := &file_models_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -453,7 +508,7 @@ func (x *Increment) ProtoReflect() protoreflect.Message { // Deprecated: Use Increment.ProtoReflect.Descriptor instead. func (*Increment) Descriptor() ([]byte, []int) { - return file_models_proto_rawDescGZIP(), []int{5} + return file_models_proto_rawDescGZIP(), []int{6} } func (x *Increment) GetKey() string { @@ -499,7 +554,7 @@ type Role struct { func (x *Role) Reset() { *x = Role{} if protoimpl.UnsafeEnabled { - mi := &file_models_proto_msgTypes[6] + mi := &file_models_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -512,7 +567,7 @@ func (x *Role) String() string { func (*Role) ProtoMessage() {} func (x *Role) ProtoReflect() protoreflect.Message { - mi := &file_models_proto_msgTypes[6] + mi := &file_models_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -525,7 +580,7 @@ func (x *Role) ProtoReflect() protoreflect.Message { // Deprecated: Use Role.ProtoReflect.Descriptor instead. func (*Role) Descriptor() ([]byte, []int) { - return file_models_proto_rawDescGZIP(), []int{6} + return file_models_proto_rawDescGZIP(), []int{7} } func (x *Role) GetId() string { @@ -670,88 +725,91 @@ var file_models_proto_rawDesc = []byte{ 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0xc9, 0x01, 0x0a, 0x04, 0x48, 0x65, 0x72, 0x6f, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, - 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x69, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x69, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x1e, 0x0a, 0x0a, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, - 0x70, 0x22, 0xb3, 0x01, 0x0a, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x32, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x62, 0x5f, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x62, 0x49, 0x64, 0x12, 0x23, 0x0a, - 0x0d, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x71, - 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x71, 0x75, - 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x22, 0x2c, 0x0a, 0x04, 0x50, 0x72, 0x6f, 0x70, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x80, 0x01, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, - 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, - 0x69, 0x64, 0x31, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, - 0x64, 0x31, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x32, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x32, 0x12, 0x19, 0x0a, - 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x33, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x33, 0x22, 0x2f, 0x0a, 0x09, 0x49, 0x6e, 0x63, 0x72, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x99, 0x05, 0x0a, 0x04, 0x52, 0x6f, - 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x69, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x69, 0x63, 0x6b, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x68, 0x70, 0x12, 0x15, 0x0a, 0x06, 0x68, 0x70, 0x5f, 0x6d, - 0x61, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x68, 0x70, 0x4d, 0x61, 0x78, 0x12, - 0x13, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x5f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x62, 0x75, 0x79, 0x52, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x5f, 0x72, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x79, 0x52, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x65, 0x6c, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x06, 0x69, - 0x6e, 0x63, 0x72, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x2e, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x74, 0x68, 0x65, 0x73, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6c, 0x6f, 0x74, 0x68, - 0x65, 0x73, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x65, 0x61, 0x70, 0x6f, - 0x6e, 0x73, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x77, - 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, - 0x74, 0x68, 0x65, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6a, - 0x65, 0x77, 0x65, 0x6c, 0x72, 0x79, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0c, 0x6a, 0x65, 0x77, 0x65, 0x6c, 0x72, 0x79, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, - 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x70, 0x61, 0x73, 0x73, 0x63, 0x68, 0x61, - 0x70, 0x74, 0x65, 0x72, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x63, 0x68, - 0x61, 0x70, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x70, 0x61, 0x73, - 0x73, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x49, 0x6e, 0x63, - 0x72, 0x65, 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, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x50, 0x61, 0x73, 0x73, 0x63, 0x68, 0x61, 0x70, - 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc9, 0x01, 0x0a, 0x04, 0x48, 0x65, + 0x72, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x69, 0x6e, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x69, 0x6e, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x69, 0x6e, 0x5f, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x69, 0x6e, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x65, 0x78, 0x70, 0x22, 0xb3, 0x01, 0x0a, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, + 0x74, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x62, 0x49, + 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6f, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x22, 0x2c, 0x0a, 0x04, 0x50, + 0x72, 0x6f, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x80, 0x01, 0x0a, 0x04, 0x54, 0x65, + 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x68, + 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x31, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, + 0x65, 0x72, 0x6f, 0x49, 0x64, 0x31, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, + 0x64, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, + 0x32, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x33, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x33, 0x22, 0x2f, 0x0a, 0x09, + 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x76, + 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x99, 0x05, + 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x69, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, + 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, + 0x68, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x68, 0x70, 0x12, 0x15, 0x0a, 0x06, + 0x68, 0x70, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x68, 0x70, + 0x4d, 0x61, 0x78, 0x12, 0x13, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x5f, 0x72, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x62, 0x75, 0x79, 0x52, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x5f, + 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x79, 0x52, 0x12, 0x10, 0x0a, + 0x03, 0x64, 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, + 0x30, 0x0a, 0x06, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x2e, 0x49, 0x6e, + 0x63, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x63, 0x72, 0x65, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x74, 0x68, + 0x65, 0x73, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, + 0x6c, 0x6f, 0x74, 0x68, 0x65, 0x73, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x77, + 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0c, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x1e, 0x0a, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x12, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x22, 0x0a, 0x0c, 0x6a, 0x65, 0x77, 0x65, 0x6c, 0x72, 0x79, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6a, 0x65, 0x77, 0x65, 0x6c, 0x72, 0x79, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x70, 0x61, 0x73, + 0x73, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x2e, 0x50, 0x61, + 0x73, 0x73, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0c, 0x70, 0x61, 0x73, 0x73, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x39, 0x0a, + 0x0b, 0x49, 0x6e, 0x63, 0x72, 0x65, 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, 0x0d, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x50, 0x61, 0x73, 0x73, + 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, + 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -766,21 +824,22 @@ func file_models_proto_rawDescGZIP() []byte { return file_models_proto_rawDescData } -var file_models_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_models_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_models_proto_goTypes = []interface{}{ (*Account)(nil), // 0: models.Account - (*Hero)(nil), // 1: models.Hero - (*Equipment)(nil), // 2: models.Equipment - (*Prop)(nil), // 3: models.Prop - (*Team)(nil), // 4: models.Team - (*Increment)(nil), // 5: models.Increment - (*Role)(nil), // 6: models.Role - nil, // 7: models.Role.IncresEntry - nil, // 8: models.Role.PasschaptersEntry + (*Config)(nil), // 1: models.Config + (*Hero)(nil), // 2: models.Hero + (*Equipment)(nil), // 3: models.Equipment + (*Prop)(nil), // 4: models.Prop + (*Team)(nil), // 5: models.Team + (*Increment)(nil), // 6: models.Increment + (*Role)(nil), // 7: models.Role + nil, // 8: models.Role.IncresEntry + nil, // 9: models.Role.PasschaptersEntry } var file_models_proto_depIdxs = []int32{ - 7, // 0: models.Role.incres:type_name -> models.Role.IncresEntry - 8, // 1: models.Role.passchapters:type_name -> models.Role.PasschaptersEntry + 8, // 0: models.Role.incres:type_name -> models.Role.IncresEntry + 9, // 1: models.Role.passchapters:type_name -> models.Role.PasschaptersEntry 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -807,7 +866,7 @@ func file_models_proto_init() { } } file_models_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Hero); i { + switch v := v.(*Config); i { case 0: return &v.state case 1: @@ -819,7 +878,7 @@ func file_models_proto_init() { } } file_models_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Equipment); i { + switch v := v.(*Hero); i { case 0: return &v.state case 1: @@ -831,7 +890,7 @@ func file_models_proto_init() { } } file_models_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Prop); i { + switch v := v.(*Equipment); i { case 0: return &v.state case 1: @@ -843,7 +902,7 @@ func file_models_proto_init() { } } file_models_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Team); i { + switch v := v.(*Prop); i { case 0: return &v.state case 1: @@ -855,7 +914,7 @@ func file_models_proto_init() { } } file_models_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Increment); i { + switch v := v.(*Team); i { case 0: return &v.state case 1: @@ -867,6 +926,18 @@ func file_models_proto_init() { } } file_models_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Increment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Role); i { case 0: return &v.state @@ -885,7 +956,7 @@ func file_models_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_models_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/protocode.pb.go b/pb/protocode.pb.go index 6dbdf3e..a04ca4b 100644 --- a/pb/protocode.pb.go +++ b/pb/protocode.pb.go @@ -35,13 +35,9 @@ const ( ProtoCode_EquipmentDelRpc ProtoCode = 9 ProtoCode_HeroUpLevelRpc ProtoCode = 10 ProtoCode_DisConnectNty ProtoCode = 11 - ProtoCode_RoleUpdateItemsNty ProtoCode = 12 - ProtoCode_HeartRsp ProtoCode = 13 - ProtoCode_RoleRsp ProtoCode = 14 - ProtoCode_RoleUpdatePropertyRsp ProtoCode = 15 - ProtoCode_RoleEndBattleRsp ProtoCode = 16 - ProtoCode_EquipmentAddRsp ProtoCode = 17 - ProtoCode_HeroUpLevelRsp ProtoCode = 18 + ProtoCode_RoleUpdatePropertyNty ProtoCode = 12 + ProtoCode_RoleUpdateItemsNty ProtoCode = 13 + ProtoCode_EquipmentAddNty ProtoCode = 14 ) // Enum value maps for ProtoCode. @@ -59,13 +55,9 @@ var ( 9: "EquipmentDelRpc", 10: "HeroUpLevelRpc", 11: "DisConnectNty", - 12: "RoleUpdateItemsNty", - 13: "HeartRsp", - 14: "RoleRsp", - 15: "RoleUpdatePropertyRsp", - 16: "RoleEndBattleRsp", - 17: "EquipmentAddRsp", - 18: "HeroUpLevelRsp", + 12: "RoleUpdatePropertyNty", + 13: "RoleUpdateItemsNty", + 14: "EquipmentAddNty", } ProtoCode_value = map[string]int32{ "UNKNOWN": 0, @@ -80,13 +72,9 @@ var ( "EquipmentDelRpc": 9, "HeroUpLevelRpc": 10, "DisConnectNty": 11, - "RoleUpdateItemsNty": 12, - "HeartRsp": 13, - "RoleRsp": 14, - "RoleUpdatePropertyRsp": 15, - "RoleEndBattleRsp": 16, - "EquipmentAddRsp": 17, - "HeroUpLevelRsp": 18, + "RoleUpdatePropertyNty": 12, + "RoleUpdateItemsNty": 13, + "EquipmentAddNty": 14, } ) @@ -121,7 +109,7 @@ var File_protocode_proto protoreflect.FileDescriptor var file_protocode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xfb, 0x02, 0x0a, + 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xb6, 0x02, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x65, 0x61, 0x72, 0x74, 0x52, 0x70, 0x63, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x70, @@ -136,17 +124,13 @@ var file_protocode_proto_rawDesc = []byte{ 0x08, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x52, 0x70, 0x63, 0x10, 0x09, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x55, 0x70, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x70, 0x63, 0x10, 0x0a, 0x12, 0x11, 0x0a, 0x0d, 0x44, 0x69, - 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x4e, 0x74, 0x79, 0x10, 0x0b, 0x12, 0x16, 0x0a, - 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x4e, 0x74, 0x79, 0x10, 0x0c, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x65, 0x61, 0x72, 0x74, 0x52, 0x73, - 0x70, 0x10, 0x0d, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, 0x0e, - 0x12, 0x19, 0x0a, 0x15, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x73, 0x70, 0x10, 0x0f, 0x12, 0x14, 0x0a, 0x10, 0x52, - 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, - 0x10, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, - 0x64, 0x52, 0x73, 0x70, 0x10, 0x11, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x55, 0x70, - 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x73, 0x70, 0x10, 0x12, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, - 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x4e, 0x74, 0x79, 0x10, 0x0b, 0x12, 0x19, 0x0a, + 0x15, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x4e, 0x74, 0x79, 0x10, 0x0c, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x74, 0x79, 0x10, 0x0d, + 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, + 0x4e, 0x74, 0x79, 0x10, 0x0e, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protos b/protos index c196389..b064539 160000 --- a/protos +++ b/protos @@ -1 +1 @@ -Subproject commit c1963893851348082d49e07a02b762bde8aac6f5 +Subproject commit b06453989759451c4808e52f854a20c12f6b683d diff --git a/tools/generator.py b/tools/generator.py index e1e2259..9123d4e 100644 --- a/tools/generator.py +++ b/tools/generator.py @@ -9,7 +9,7 @@ ProtoCodeStr = "syntax = \"proto3\";\noption go_package = \"../pb;pb\";\n\npacka "UNKNOWN = 0;\n {}\n}} " ProtoCodeLineReq = "\t{}Rpc = {};\n" ProtoCodeLineRsp = "\t{}Rsp = {};\n" -ProtoCodeLineNty = "\t{}Nty= {};\n" +ProtoCodeLineNty = "\t{}Nty = {};\n" GoProtoCodeStr = "package action\n\nimport (\n\t\"pro2d/common/logger\"\n\t\"pro2d/pb\"\n)\n\nfunc GetActionMap() " \ "map[interface{{}}]interface{{}} {{\n\tlogger.Debug(\"init protocode...\")\n\tam := make(map[interface{{" \ @@ -81,22 +81,22 @@ def generatorProto(path): GoCodeTestData += GoProtoCodeTestNtyLine.format(messageStr[:n3], messageStr[:n3]) # rsp 满足客户端需要 - for line in lines: - if line.find("message") == -1: - continue - sline = line.split(' ') - if len(sline) < 2: - continue - - messageStr = sline[1].replace('\n', '').replace('{', "") - n2 = messageStr.find('Rsp') - loginReq = messageStr.find('LoginReq') - if n2 != -1: - code += 1 - ProtoCodeData += ProtoCodeLineRsp.format(messageStr[:n2], code) - if loginReq != -1: - continue - GoCodeTestData += GoProtoCodeTestRspLine.format(messageStr[:n2], messageStr[:n2]) + # for line in lines: + # if line.find("message") == -1: + # continue + # sline = line.split(' ') + # if len(sline) < 2: + # continue + # + # messageStr = sline[1].replace('\n', '').replace('{', "") + # n2 = messageStr.find('Rsp') + # loginReq = messageStr.find('LoginReq') + # if n2 != -1: + # code += 1 + # ProtoCodeData += ProtoCodeLineRsp.format(messageStr[:n2], code) + # if loginReq != -1: + # continue + # GoCodeTestData += GoProtoCodeTestRspLine.format(messageStr[:n2], messageStr[:n2]) # protocode.go -- libgit2 0.21.2