From 17fe96be5bbbf622bdbda304911a992fb237000c Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Wed, 27 Apr 2022 12:04:57 +0800 Subject: [PATCH] feat: 增加装备相关数据和协议 1.models.hero型增加装备字段,models.Equipment增加hero_id字段。 2.增加穿戴装备,脱下装备协议HeroEquipReferReq 3.RoleRsp数据模型增加装备列表 --- cmd/gameserver/action/RoleAction.go | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- cmd/gameserver/action/protocode.go | 1 + common/commonFunc.go | 27 +++++++++++++++++++++++++++ models/equip.go | 11 ++++------- models/hero.go | 21 +++++++++++++++++---- models/init.go | 24 ------------------------ models/role.go | 53 ++++++++++++++++++++++++++++++++++++----------------- models/rolePlugin.go | 51 +++++++++++---------------------------------------- models/role_test.go | 2 +- pb/game.pb.go | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------ pb/models.pb.go | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------- pb/protocode.pb.go | 50 +++++++++++++++++++++++++++----------------------- protos | 2 +- 13 files changed, 378 insertions(+), 223 deletions(-) delete mode 100644 models/init.go diff --git a/cmd/gameserver/action/RoleAction.go b/cmd/gameserver/action/RoleAction.go index c2c34f9..9702453 100644 --- a/cmd/gameserver/action/RoleAction.go +++ b/cmd/gameserver/action/RoleAction.go @@ -76,9 +76,10 @@ func LoginRpc(agent components.IAgent, msg components.IMessage) (int32, interfac } role.SetProperty("Device", req.Device) protoMsg := &pb.RoleRsp{ - Role: role.Role, - Hero: role.GetAllHero(), - Team: role.GetAllTeam(), + Role: role.Role, + Hero: role.GetAllHero(), + Team: role.GetAllTeam(), + Equipments: role.GetEquipments(), } //登录成功,存储agent role agent.SetSchema(role) @@ -99,3 +100,51 @@ func ChangeTeamRpc(agent components.IAgent, msg components.IMessage) (int32, int role.UpdateTeam(req.Team) return 0, nil } + +func HeroEquipReferRpc(agent components.IAgent, msg components.IMessage) (int32, interface{}) { + req := pb.HeroEquipReferReq{} + if err := proto.Unmarshal(msg.GetData(), &req); err != nil { + logger.Error("loginRpc err: %v", err) + return 1, nil + } + role := agent.GetSchema().(*models.RoleModel) + if role == nil { + return 2, nil + } + + e, ok := role.Equipments[req.EquipId] + if !ok { + return 3, nil + } + + equip := e.(*models.EquipModel) + + // 装备未被穿戴 + if equip.Equip.HeroId == "" { + + h, ok := role.Heros[req.HeroId] + if ok { + hero := h.(*models.HeroModel) + hero.UpdateEquipment(equip.Equip.Id, equip.Equip.Type) + } + equip.SetProperty("heroid", req.HeroId) + } else { + //装备已经被穿戴 + if req.HeroId != equip.Equip.HeroId { + h, ok := role.Heros[equip.Equip.HeroId] + if ok { + hero := h.(*models.HeroModel) + hero.UpdateEquipment(equip.Equip.Id, "") + } + + h, ok = role.Heros[req.HeroId] + if ok { + hero := h.(*models.HeroModel) + hero.UpdateEquipment(equip.Equip.Id, equip.Equip.Type) + } + + equip.SetProperty("heroid", req.HeroId) + } + } + return 0, nil +} diff --git a/cmd/gameserver/action/protocode.go b/cmd/gameserver/action/protocode.go index 665edd8..dc6be55 100644 --- a/cmd/gameserver/action/protocode.go +++ b/cmd/gameserver/action/protocode.go @@ -12,6 +12,7 @@ func GetActionMap() map[interface{}]interface{} { am[uint32(pb.ProtoCode_LoginReq)] = LoginRpc am[uint32(pb.ProtoCode_CreateReq)] = CreateRpc am[uint32(pb.ProtoCode_ChangeTeamReq)] = ChangeTeamRpc + am[uint32(pb.ProtoCode_HeroEquipReferReq)] = HeroEquipReferRpc return am } diff --git a/common/commonFunc.go b/common/commonFunc.go index 34a0729..511422a 100644 --- a/common/commonFunc.go +++ b/common/commonFunc.go @@ -1,10 +1,12 @@ package common import ( + "bytes" "errors" "fmt" "github.com/garyburd/redigo/redis" "pro2d/common/db/redisproxy" + "strings" ) func GetNextRoleId() (string, error) { @@ -49,3 +51,28 @@ func GetNextUId() (string, error) { } return fmt.Sprintf("%d", ID), nil } + +type IMapString map[string]interface{} + +func MapToString(params map[string]interface{}) string { + var items bytes.Buffer + for k, v := range params { + items.WriteString(k) + items.WriteString("=") + items.WriteString(fmt.Sprintf("%v", v)) + items.WriteString(" ") + } + return items.String() +} + +func StringToMap(items string) map[string]interface{} { + backPack := make(map[string]interface{}) + for _, v := range strings.Split(items, " ") { + ii := strings.Split(v, "=") + if len(ii) < 2 { + continue + } + backPack[ii[0]] = ii[1] + } + return backPack +} diff --git a/models/equip.go b/models/equip.go index a1262a5..603928c 100644 --- a/models/equip.go +++ b/models/equip.go @@ -10,14 +10,11 @@ type EquipModel struct { Equip *pb.Equipment } -func NewEquip(id string) *EquipModel { - data := &pb.Equipment{ - Id: id, - } +func NewEquip(data *pb.Equipment) *EquipModel { m := &EquipModel{ - ISchema: NewSchema(id, data), - Equip: data, + ISchema: NewSchema(data.Id, data), + Equip: data, } return m -} \ No newline at end of file +} diff --git a/models/hero.go b/models/hero.go index 5af70af..ac6ea8a 100644 --- a/models/hero.go +++ b/models/hero.go @@ -1,19 +1,32 @@ package models import ( + "pro2d/common" "pro2d/common/components" "pro2d/pb" ) type HeroModel struct { components.ISchema - Hero *pb.Hero + Hero *pb.Hero + Equipments common.IMapString } -type HeroMap map[string]components.ISchema + func NewHero(hero *pb.Hero) *HeroModel { m := &HeroModel{ - ISchema: NewSchema(hero.Id, hero), - Hero: hero, + ISchema: NewSchema(hero.Id, hero), + Hero: hero, + Equipments: common.StringToMap(hero.Equipments), } return m } + +func (m *HeroModel) UpdateEquipment(key string, typ string) { + if typ == "" { + delete(m.Equipments, key) + } else { + m.Equipments[key] = typ + } + + m.SetProperty("equipments", common.MapToString(m.Equipments)) +} diff --git a/models/init.go b/models/init.go deleted file mode 100644 index 8c194f3..0000000 --- a/models/init.go +++ /dev/null @@ -1,24 +0,0 @@ -package models - -import ( - "pro2d/common/db/mongoproxy" - "pro2d/pb" -) - -func InitAccountModels() { - var schema = []interface{}{ - pb.Account{}, - } - mongoproxy.InitDoc(schema...) -} - -func InitGameModels() { - var schema = []interface{}{ - pb.Equipment{}, - pb.Hero{}, - pb.Prop{}, - pb.Role{}, - pb.Team{}, - } - mongoproxy.InitDoc(schema...) -} diff --git a/models/role.go b/models/role.go index bcbdd58..8daf746 100644 --- a/models/role.go +++ b/models/role.go @@ -11,15 +11,14 @@ import ( "sync/atomic" ) -type BackPackItems map[string]uint32 - type RoleModel struct { components.ISchema - Role *pb.Role - Heros SchemaMap - Teams SchemaMap - Prop *PropModel - Items BackPackItems //背包 + Role *pb.Role + Heros SchemaMap + Teams SchemaMap + Equipments SchemaMap + Prop *PropModel + Items common.IMapString //背包 lastSaveTs int64 } @@ -38,7 +37,7 @@ func RoleExistByUid(uid string) *RoleModel { Heros: make(SchemaMap), Teams: make(SchemaMap), Prop: new(PropModel), - Items: make(BackPackItems), + Items: make(common.IMapString), } r.Load() r.LoadAll() @@ -53,7 +52,7 @@ func NewRole(id string) *RoleModel { Heros: make(SchemaMap), Teams: make(SchemaMap), Prop: new(PropModel), - Items: make(BackPackItems), + Items: make(common.IMapString), } return m } @@ -80,13 +79,12 @@ func (m *RoleModel) IncreTeamByKey(detal uint32) string { func (m *RoleModel) InitRole() { //init hero h1 := pb.Hero{ - Id: m.IncreHearByKey(1), - RoleId: m.Role.Id, - Type: 1, - Level: 1, - ReinCount: 0, - ReinPoint: 0, - Equipments: "", + Id: m.IncreHearByKey(1), + RoleId: m.Role.Id, + Type: 1, + Level: 1, + ReinCount: 0, + ReinPoint: 0, } m.AddHero(&h1) @@ -156,13 +154,26 @@ func (m *RoleModel) LoadTeams() { //加载背包数据到内存 func (m *RoleModel) LoadItems() { - m.Items = m.StringToItems(m.Role.Items) + m.Items = common.StringToMap(m.Role.Items) +} + +func (m *RoleModel) LoadEquipments() { + data := make([]*pb.Equipment, 10) + err := mongoproxy.FindMany("equipment", "roleid", m.Role.Id, &data) + if err != nil { + logger.Error(err) + return + } + for _, d := range data { + m.Equipments[d.Id] = NewEquip(d) + } } func (m *RoleModel) LoadAll() { m.LoadHero() m.LoadTeams() m.LoadItems() + m.LoadEquipments() } func (m *RoleModel) UpdateProperty(key string, val interface{}, notify bool) { @@ -211,6 +222,14 @@ func (m *RoleModel) GetAllTeam() []*pb.Team { return t } +func (m *RoleModel) GetEquipments() []*pb.Equipment { + var equips []*pb.Equipment + for _, e := range m.Equipments { + equips = append(equips, e.(*EquipModel).Equip) + } + return equips +} + func (m *RoleModel) AddHero(hero *pb.Hero) { h := NewHero(hero) h.Create() diff --git a/models/rolePlugin.go b/models/rolePlugin.go index 6ed4c49..d43ccea 100644 --- a/models/rolePlugin.go +++ b/models/rolePlugin.go @@ -1,13 +1,11 @@ package models import ( - "bytes" "fmt" "github.com/golang/protobuf/proto" + "pro2d/common" "pro2d/common/logger" "pro2d/pb" - "strconv" - "strings" ) //背包系统 @@ -16,7 +14,7 @@ func (m *RoleModel) GetItemCount(key string) uint32 { if !ok { c = 0 } - return c + return c.(uint32) } func (m *RoleModel) CostItem(key string, count int32) bool { @@ -26,13 +24,13 @@ func (m *RoleModel) CostItem(key string, count int32) bool { return m.AddItem(key, -count) } -func (m *RoleModel) CostItems(params BackPackItems) bool { +func (m *RoleModel) CostItems(params common.IMapString) bool { for k, v := range params { - if v > m.GetItemCount(k) { + if v.(uint32) > m.GetItemCount(k) { return false } - m.AddItem(k, -int32(v)) + m.AddItem(k, -v.(int32)) } return true } @@ -46,7 +44,7 @@ func (m *RoleModel) AddItem(key string, count int32) bool { } else { delete(m.Items, key) } - m.SetProperty("items", m.ItemsToString(m.Items)) + m.SetProperty("items", common.MapToString(m.Items)) rsp, err := proto.Marshal(&pb.RoleUpdateItemsRsp{Items: fmt.Sprintf("%s=%d", key, num)}) if err != nil { @@ -57,12 +55,12 @@ func (m *RoleModel) AddItem(key string, count int32) bool { return true } -func (m *RoleModel) AddItems(params BackPackItems) bool { - tmp := make(BackPackItems) +func (m *RoleModel) AddItems(params common.IMapString) bool { + tmp := make(common.IMapString) for k, v := range params { c := m.GetItemCount(k) - num := c + v + num := c + v.(uint32) if num > 0 { m.Items[k] = num tmp[k] = num @@ -71,9 +69,9 @@ func (m *RoleModel) AddItems(params BackPackItems) bool { } } - m.SetProperty("items", m.ItemsToString(m.Items)) + m.SetProperty("items", common.MapToString(m.Items)) - rsp, err := proto.Marshal(&pb.RoleUpdateItemsRsp{Items: m.ItemsToString(tmp)}) + rsp, err := proto.Marshal(&pb.RoleUpdateItemsRsp{Items: common.MapToString(tmp)}) if err != nil { logger.Error(err.Error()) return true @@ -85,30 +83,3 @@ func (m *RoleModel) AddItems(params BackPackItems) bool { return true } - -func (m *RoleModel) ItemsToString(params BackPackItems) string { - var items bytes.Buffer - for k, v := range params { - items.WriteString(k) - items.WriteString("=") - items.WriteString(fmt.Sprintf("%d", v)) - items.WriteString(" ") - } - return items.String() -} - -func (m *RoleModel) StringToItems(items string) BackPackItems { - backPack := make(BackPackItems) - for _, v := range strings.Split(items, " ") { - ii := strings.Split(v, "=") - if len(ii) < 2 { - continue - } - n, err := strconv.ParseUint(ii[1], 10, 32) - if err != nil { - continue - } - backPack[ii[0]] = uint32(n) - } - return backPack -} diff --git a/models/role_test.go b/models/role_test.go index e6965ca..4304e2b 100644 --- a/models/role_test.go +++ b/models/role_test.go @@ -126,7 +126,7 @@ func TestRoleModel_IncreByKey(t *testing.T) { ites := strings.SplitN("1=1 2=2 3=3", " ", -1) fmt.Println(ites) - items := make(BackPackItems) + items := make(IMapString) for _, v := range ites { ii := strings.Split(v, "=") if len(ii) < 2 { diff --git a/pb/game.pb.go b/pb/game.pb.go index f517c0c..5e88787 100644 --- a/pb/game.pb.go +++ b/pb/game.pb.go @@ -227,6 +227,7 @@ func (x *CreateReq) GetDevice() string { return "" } +//ResponseCmd ChangeTeamReq type ChangeTeamReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -274,20 +275,85 @@ func (x *ChangeTeamReq) GetTeam() []*Team { return nil } +//ResponseCmd HeroEquipReferReq +type HeroEquipReferReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EquipId string `protobuf:"bytes,1,opt,name=equipId,proto3" json:"equipId,omitempty"` + HeroId string `protobuf:"bytes,2,opt,name=hero_id,json=heroId,proto3" json:"hero_id,omitempty"` + Refer bool `protobuf:"varint,3,opt,name=refer,proto3" json:"refer,omitempty"` //true 穿戴, false 脱下 +} + +func (x *HeroEquipReferReq) Reset() { + *x = HeroEquipReferReq{} + if protoimpl.UnsafeEnabled { + mi := &file_game_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeroEquipReferReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeroEquipReferReq) ProtoMessage() {} + +func (x *HeroEquipReferReq) ProtoReflect() protoreflect.Message { + mi := &file_game_proto_msgTypes[5] + 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 HeroEquipReferReq.ProtoReflect.Descriptor instead. +func (*HeroEquipReferReq) Descriptor() ([]byte, []int) { + return file_game_proto_rawDescGZIP(), []int{5} +} + +func (x *HeroEquipReferReq) GetEquipId() string { + if x != nil { + return x.EquipId + } + return "" +} + +func (x *HeroEquipReferReq) GetHeroId() string { + if x != nil { + return x.HeroId + } + return "" +} + +func (x *HeroEquipReferReq) GetRefer() bool { + if x != nil { + return x.Refer + } + return false +} + type RoleRsp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Role *Role `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - Hero []*Hero `protobuf:"bytes,3,rep,name=hero,proto3" json:"hero,omitempty"` - Team []*Team `protobuf:"bytes,4,rep,name=team,proto3" json:"team,omitempty"` + Role *Role `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + Hero []*Hero `protobuf:"bytes,3,rep,name=hero,proto3" json:"hero,omitempty"` + Team []*Team `protobuf:"bytes,4,rep,name=team,proto3" json:"team,omitempty"` + Equipments []*Equipment `protobuf:"bytes,5,rep,name=equipments,proto3" json:"equipments,omitempty"` } func (x *RoleRsp) Reset() { *x = RoleRsp{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[5] + mi := &file_game_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -300,7 +366,7 @@ func (x *RoleRsp) String() string { func (*RoleRsp) ProtoMessage() {} func (x *RoleRsp) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[5] + mi := &file_game_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -313,7 +379,7 @@ func (x *RoleRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use RoleRsp.ProtoReflect.Descriptor instead. func (*RoleRsp) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{5} + return file_game_proto_rawDescGZIP(), []int{6} } func (x *RoleRsp) GetRole() *Role { @@ -337,6 +403,13 @@ func (x *RoleRsp) GetTeam() []*Team { return nil } +func (x *RoleRsp) GetEquipments() []*Equipment { + if x != nil { + return x.Equipments + } + return nil +} + //ResponseCmd RoleUpdatePropertyRsp type RoleUpdatePropertyRsp struct { state protoimpl.MessageState @@ -350,7 +423,7 @@ type RoleUpdatePropertyRsp struct { func (x *RoleUpdatePropertyRsp) Reset() { *x = RoleUpdatePropertyRsp{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[6] + mi := &file_game_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -363,7 +436,7 @@ func (x *RoleUpdatePropertyRsp) String() string { func (*RoleUpdatePropertyRsp) ProtoMessage() {} func (x *RoleUpdatePropertyRsp) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[6] + mi := &file_game_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -376,7 +449,7 @@ func (x *RoleUpdatePropertyRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use RoleUpdatePropertyRsp.ProtoReflect.Descriptor instead. func (*RoleUpdatePropertyRsp) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{6} + return file_game_proto_rawDescGZIP(), []int{7} } func (x *RoleUpdatePropertyRsp) GetId() []int32 { @@ -405,7 +478,7 @@ type RoleUpdateItemsRsp struct { func (x *RoleUpdateItemsRsp) Reset() { *x = RoleUpdateItemsRsp{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[7] + mi := &file_game_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -418,7 +491,7 @@ func (x *RoleUpdateItemsRsp) String() string { func (*RoleUpdateItemsRsp) ProtoMessage() {} func (x *RoleUpdateItemsRsp) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[7] + mi := &file_game_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -431,7 +504,7 @@ func (x *RoleUpdateItemsRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use RoleUpdateItemsRsp.ProtoReflect.Descriptor instead. func (*RoleUpdateItemsRsp) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{7} + return file_game_proto_rawDescGZIP(), []int{8} } func (x *RoleUpdateItemsRsp) GetItems() string { @@ -460,23 +533,32 @@ var file_game_proto_rawDesc = []byte{ 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x31, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x54, 0x65, - 0x61, 0x6d, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x22, 0x6f, 0x0a, 0x07, 0x52, 0x6f, 0x6c, 0x65, - 0x52, 0x73, 0x70, 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, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x48, 0x65, 0x72, - 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x20, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x54, - 0x65, 0x61, 0x6d, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 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, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x61, 0x6d, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x22, 0x5c, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6f, + 0x45, 0x71, 0x75, 0x69, 0x70, 0x52, 0x65, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, + 0x07, 0x65, 0x71, 0x75, 0x69, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x65, 0x71, 0x75, 0x69, 0x70, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x66, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x72, 0x65, 0x66, 0x65, 0x72, 0x22, 0xa2, 0x01, 0x0a, 0x07, 0x52, 0x6f, 0x6c, 0x65, 0x52, + 0x73, 0x70, 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, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x48, 0x65, 0x72, 0x6f, + 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x20, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x54, 0x65, + 0x61, 0x6d, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x31, 0x0a, 0x0a, 0x65, 0x71, 0x75, 0x69, + 0x70, 0x6d, 0x65, 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, 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, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -491,31 +573,34 @@ func file_game_proto_rawDescGZIP() []byte { return file_game_proto_rawDescData } -var file_game_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_game_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_game_proto_goTypes = []interface{}{ (*HeartReq)(nil), // 0: game.HeartReq (*HeartRsp)(nil), // 1: game.HeartRsp (*LoginReq)(nil), // 2: game.LoginReq (*CreateReq)(nil), // 3: game.CreateReq (*ChangeTeamReq)(nil), // 4: game.ChangeTeamReq - (*RoleRsp)(nil), // 5: game.RoleRsp - (*RoleUpdatePropertyRsp)(nil), // 6: game.RoleUpdatePropertyRsp - (*RoleUpdateItemsRsp)(nil), // 7: game.RoleUpdateItemsRsp - (*Team)(nil), // 8: models.Team - (*Role)(nil), // 9: models.Role - (*Hero)(nil), // 10: models.Hero + (*HeroEquipReferReq)(nil), // 5: game.HeroEquipReferReq + (*RoleRsp)(nil), // 6: game.RoleRsp + (*RoleUpdatePropertyRsp)(nil), // 7: game.RoleUpdatePropertyRsp + (*RoleUpdateItemsRsp)(nil), // 8: game.RoleUpdateItemsRsp + (*Team)(nil), // 9: models.Team + (*Role)(nil), // 10: models.Role + (*Hero)(nil), // 11: models.Hero + (*Equipment)(nil), // 12: models.Equipment } var file_game_proto_depIdxs = []int32{ - 8, // 0: game.ChangeTeamReq.team:type_name -> models.Team - 9, // 1: game.RoleRsp.role:type_name -> models.Role - 10, // 2: game.RoleRsp.hero:type_name -> models.Hero - 8, // 3: game.RoleRsp.team:type_name -> models.Team - 9, // 4: game.RoleUpdatePropertyRsp.role:type_name -> models.Role - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 9, // 0: game.ChangeTeamReq.team:type_name -> models.Team + 10, // 1: game.RoleRsp.role:type_name -> models.Role + 11, // 2: game.RoleRsp.hero:type_name -> models.Hero + 9, // 3: game.RoleRsp.team:type_name -> models.Team + 12, // 4: game.RoleRsp.equipments:type_name -> models.Equipment + 10, // 5: game.RoleUpdatePropertyRsp.role:type_name -> models.Role + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_game_proto_init() } @@ -586,7 +671,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleRsp); i { + switch v := v.(*HeroEquipReferReq); i { case 0: return &v.state case 1: @@ -598,7 +683,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleUpdatePropertyRsp); i { + switch v := v.(*RoleRsp); i { case 0: return &v.state case 1: @@ -610,6 +695,18 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoleUpdatePropertyRsp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_game_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RoleUpdateItemsRsp); i { case 0: return &v.state @@ -628,7 +725,7 @@ func file_game_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_game_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/models.pb.go b/pb/models.pb.go index d65da17..98b54a6 100644 --- a/pb/models.pb.go +++ b/pb/models.pb.go @@ -94,7 +94,7 @@ type Hero struct { Level int32 `protobuf:"varint,4,opt,name=level,proto3" json:"level,omitempty"` ReinCount int32 `protobuf:"varint,5,opt,name=rein_count,json=reinCount,proto3" json:"rein_count,omitempty"` ReinPoint int32 `protobuf:"varint,6,opt,name=rein_point,json=reinPoint,proto3" json:"rein_point,omitempty"` - Equipments string `protobuf:"bytes,7,opt,name=equipments,proto3" json:"equipments,omitempty"` + Equipments string `protobuf:"bytes,7,opt,name=equipments,proto3" json:"equipments,omitempty"` //"id=type id1=type1" } func (x *Hero) Reset() { @@ -185,9 +185,9 @@ type Equipment struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" index:"unique" pri:"1"` // @inject_tag: index:"unique" pri:"1" RoleId string `protobuf:"bytes,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - Type int64 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` - Equip bool `protobuf:"varint,4,opt,name=equip,proto3" json:"equip,omitempty"` - EnhanceLevel bool `protobuf:"varint,5,opt,name=enhance_level,json=enhanceLevel,proto3" json:"enhance_level,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + EnhanceLevel int32 `protobuf:"varint,4,opt,name=enhance_level,json=enhanceLevel,proto3" json:"enhance_level,omitempty"` + HeroId string `protobuf:"bytes,5,opt,name=hero_id,json=heroId,proto3" json:"hero_id,omitempty"` } func (x *Equipment) Reset() { @@ -236,25 +236,25 @@ func (x *Equipment) GetRoleId() string { return "" } -func (x *Equipment) GetType() int64 { +func (x *Equipment) GetType() string { if x != nil { return x.Type } - return 0 + return "" } -func (x *Equipment) GetEquip() bool { +func (x *Equipment) GetEnhanceLevel() int32 { if x != nil { - return x.Equip + return x.EnhanceLevel } - return false + return 0 } -func (x *Equipment) GetEnhanceLevel() bool { +func (x *Equipment) GetHeroId() string { if x != nil { - return x.EnhanceLevel + return x.HeroId } - return false + return "" } type Prop struct { @@ -463,7 +463,7 @@ type Role struct { PayR string `protobuf:"bytes,12,opt,name=pay_r,json=payR,proto3" json:"pay_r,omitempty"` Del bool `protobuf:"varint,13,opt,name=del,proto3" json:"del,omitempty"` Incres map[string]uint32 `protobuf:"bytes,14,rep,name=incres,proto3" json:"incres,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Items string `protobuf:"bytes,15,opt,name=items,proto3" json:"items,omitempty"` + Items string `protobuf:"bytes,15,opt,name=items,proto3" json:"items,omitempty"` //物品 "id=count id2=count2" } func (x *Role) Reset() { @@ -610,52 +610,53 @@ var file_models_proto_rawDesc = []byte{ 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, 0x22, - 0x83, 0x01, 0x0a, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, + 0x86, 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, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x71, - 0x75, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x71, 0x75, 0x69, 0x70, - 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, - 0x4c, 0x65, 0x76, 0x65, 0x6c, 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, 0xe2, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 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, 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, 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, - 0x03, 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, 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, 0x42, 0x0a, 0x5a, 0x08, - 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0xe2, 0x02, 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, 0x03, 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, 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, 0x42, + 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/pb/protocode.pb.go b/pb/protocode.pb.go index 642fe7b..41e4b12 100644 --- a/pb/protocode.pb.go +++ b/pb/protocode.pb.go @@ -30,24 +30,26 @@ const ( ProtoCode_LoginReq ProtoCode = 4 ProtoCode_CreateReq ProtoCode = 5 ProtoCode_ChangeTeamReq ProtoCode = 6 - ProtoCode_RoleRsp ProtoCode = 7 - ProtoCode_RoleUpdatePropertyRsp ProtoCode = 8 - ProtoCode_RoleUpdateItemsRsp ProtoCode = 9 + ProtoCode_HeroEquipReferReq ProtoCode = 7 + ProtoCode_RoleRsp ProtoCode = 8 + ProtoCode_RoleUpdatePropertyRsp ProtoCode = 9 + ProtoCode_RoleUpdateItemsRsp ProtoCode = 10 ) // Enum value maps for ProtoCode. var ( ProtoCode_name = map[int32]string{ - 0: "UNKNOWN", - 1: "LoginRsp", - 2: "HeartReq", - 3: "HeartRsp", - 4: "LoginReq", - 5: "CreateReq", - 6: "ChangeTeamReq", - 7: "RoleRsp", - 8: "RoleUpdatePropertyRsp", - 9: "RoleUpdateItemsRsp", + 0: "UNKNOWN", + 1: "LoginRsp", + 2: "HeartReq", + 3: "HeartRsp", + 4: "LoginReq", + 5: "CreateReq", + 6: "ChangeTeamReq", + 7: "HeroEquipReferReq", + 8: "RoleRsp", + 9: "RoleUpdatePropertyRsp", + 10: "RoleUpdateItemsRsp", } ProtoCode_value = map[string]int32{ "UNKNOWN": 0, @@ -57,9 +59,10 @@ var ( "LoginReq": 4, "CreateReq": 5, "ChangeTeamReq": 6, - "RoleRsp": 7, - "RoleUpdatePropertyRsp": 8, - "RoleUpdateItemsRsp": 9, + "HeroEquipReferReq": 7, + "RoleRsp": 8, + "RoleUpdatePropertyRsp": 9, + "RoleUpdateItemsRsp": 10, } ) @@ -94,7 +97,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, 0xb2, 0x01, 0x0a, + 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xc9, 0x01, 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, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x73, 0x70, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x65, 0x61, 0x72, 0x74, 0x52, 0x65, @@ -102,12 +105,13 @@ var file_protocode_proto_rawDesc = []byte{ 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x10, - 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, 0x07, 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, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x6f, 0x6c, - 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x10, - 0x09, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x06, 0x12, 0x15, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x10, 0x07, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x6f, 0x6c, 0x65, + 0x52, 0x73, 0x70, 0x10, 0x08, 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, 0x09, + 0x12, 0x16, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x10, 0x0a, 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 55f842e..6cc8a5a 160000 --- a/protos +++ b/protos @@ -1 +1 @@ -Subproject commit 55f842e18ed04c3b9841618400575e292aa5c1f3 +Subproject commit 6cc8a5a6a18abe2e1f4ab3813d0cfea4fba91c28 -- libgit2 0.21.2