From c8509ef6462db5baf31e63f5e4121c5f519f11a1 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Fri, 6 May 2022 10:40:36 +0800 Subject: [PATCH] fix: notify equipment add --- cmd/gameserver/action/GmAction.go | 15 +-------------- common/components/conn.go | 17 +++++++++++++++++ common/components/icompontents.go | 3 ++- models/role.go | 33 +++------------------------------ models/rolePlugin.go | 42 ++++++++++++++++++++++++++++++++++++++++++ models/schema.go | 15 +++------------ pb/game.pb.go | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------- pb/models.pb.go | 89 +++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------- pb/protocode.pb.go | 11 ++++++++--- 9 files changed, 210 insertions(+), 119 deletions(-) diff --git a/cmd/gameserver/action/GmAction.go b/cmd/gameserver/action/GmAction.go index 7394ee5..7916905 100644 --- a/cmd/gameserver/action/GmAction.go +++ b/cmd/gameserver/action/GmAction.go @@ -13,7 +13,7 @@ type GmAction struct { func (gm *GmAction) AddExp(role *models.RoleModel, properties map[string]interface{}) int { logger.Debug(properties) exp, _ := strconv.Atoi(properties["exp"].(string)) - role.IncrPropertyChan("exp", int64(exp)) + role.IncrPropertyChan("exp", int64(exp), true) return 0 } @@ -29,16 +29,3 @@ func (gm *GmAction) AddEquip(role *models.RoleModel, properties map[string]inter role.AddEquip(equip) return 0 } - -func (gm *GmAction) DelEquip(role *models.RoleModel, properties map[string]interface{}) int { - logger.Debug(properties) - equip := &pb.Equipment{ - Id: role.IncreEquipByKey(1), - RoleId: role.Role.Id, - Type: properties["id"].(string), - } - //TODO 验证装备是否存在 - - role.AddEquip(equip) - return 0 -} diff --git a/common/components/conn.go b/common/components/conn.go index b80d140..229b8e7 100644 --- a/common/components/conn.go +++ b/common/components/conn.go @@ -140,6 +140,23 @@ func (c *Connection) Send(errCode int32, cmd uint32, data []byte) error { } } +func (c *Connection) SendSuccess(cmd uint32, data []byte) error { + buf, err := c.splitter.Pack(cmd, data, 0, 0) + if err != nil { + return err + } + + sendTimeout := time.NewTimer(5 * time.Millisecond) + defer sendTimeout.Stop() + // 发送超时 + select { + case <-sendTimeout.C: + return fmt.Errorf("send buff msg timeout") + case c.WBuffer <- buf: + return nil + } +} + func (c *Connection) CustomChan() chan<- func() { return c.customizeFunc } diff --git a/common/components/icompontents.go b/common/components/icompontents.go index 345997b..8c67f32 100644 --- a/common/components/icompontents.go +++ b/common/components/icompontents.go @@ -51,6 +51,7 @@ type ( Start() Stop() Send(errCode int32, cmd uint32, b []byte) error + SendSuccess(cmd uint32, b []byte) error CustomChan() chan<- func() SetConnectionCallback(ConnectionCallback) @@ -152,7 +153,7 @@ type ( SetProperty(key string, val interface{}) SetProperties(properties map[string]interface{}) - IncrProperty(key string, val int64) + IncrProperty(key string, val int64) int64 ParseFields(message protoreflect.Message, properties map[string]interface{}) []int32 } ) diff --git a/models/role.go b/models/role.go index 8575251..a1aac65 100644 --- a/models/role.go +++ b/models/role.go @@ -235,34 +235,6 @@ func (m *RoleModel) GetEquipments() []*pb.Equipment { return equips } -func (m *RoleModel) AddHero(hero *pb.Hero) { - h := NewHero(hero) - h.Create() - m.Heros[hero.Id] = h -} - -func (m *RoleModel) AddTeam(team *pb.Team) { - t := NewTeam(team) - t.Create() - m.Teams[team.Id] = t -} - -func (m *RoleModel) UpdateTeam(teams []*pb.Team) { - for _, team := range teams { - team.RoleId = m.Role.Id - t := m.Teams[team.Id] - if t != nil { - t.UpdateSchema(team) - } - } -} - -func (m *RoleModel) AddEquip(equip *pb.Equipment) { - e := NewEquip(equip) - e.Create() - m.Equipments[equip.Id] = e -} - func (m *RoleModel) OnRecoverTimer(now int64) { m.SaveRoleData(now) } @@ -296,10 +268,11 @@ func (m *RoleModel) SaveRoleData(now int64) { } } -func (m *RoleModel) IncrPropertyChan(key string, val int64) { +func (m *RoleModel) IncrPropertyChan(key string, val int64, notify bool) { if m.GetConn() != nil { m.GetConn().CustomChan() <- func() { - m.IncrProperty(key, val) + incr := m.IncrProperty(key, val) + m.UpdateProperty(key, incr, notify) } } else { m.IncrProperty(key, val) diff --git a/models/rolePlugin.go b/models/rolePlugin.go index d43ccea..593ee27 100644 --- a/models/rolePlugin.go +++ b/models/rolePlugin.go @@ -83,3 +83,45 @@ func (m *RoleModel) AddItems(params common.IMapString) bool { return true } + +func (m *RoleModel) AddHero(hero *pb.Hero) { + h := NewHero(hero) + h.Create() + m.Heros[hero.Id] = h +} + +func (m *RoleModel) AddTeam(team *pb.Team) { + t := NewTeam(team) + t.Create() + m.Teams[team.Id] = t +} + +func (m *RoleModel) UpdateTeam(teams []*pb.Team) { + for _, team := range teams { + team.RoleId = m.Role.Id + t := m.Teams[team.Id] + if t != nil { + t.UpdateSchema(team) + } + } +} + +func (m *RoleModel) AddEquip(equip *pb.Equipment) *EquipModel { + e := NewEquip(equip) + e.Create() + m.Equipments[equip.Id] = e + m.EquipmentAddNotify(equip) + return e +} + +func (m *RoleModel) EquipmentAddNotify(equip *pb.Equipment) { + update := &pb.EquipmentAddRsp{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) + } + } +} diff --git a/models/schema.go b/models/schema.go index df987df..1ad08be 100644 --- a/models/schema.go +++ b/models/schema.go @@ -176,10 +176,10 @@ func (s *Schema) SetProperties(properties map[string]interface{}) { } } -func (s *Schema) IncrProperty(key string, val int64) { +func (s *Schema) IncrProperty(key string, val int64) int64 { idx, ok := s.reflectIndex[strings.ToLower(key)] if !ok { - return + return 0 } field := s.reflectValue.Field(idx) var v int64 @@ -190,6 +190,7 @@ func (s *Schema) IncrProperty(key string, val int64) { v = field.Int() + val } s.SetProperty(key, v) + return v } func (s *Schema) ParseFields(message protoreflect.Message, properties map[string]interface{}) []int32 { @@ -208,13 +209,3 @@ func (s *Schema) ParseFields(message protoreflect.Message, properties map[string return ids } - -func (s *Schema) IncrPropertyChan(conn components.IConnection, key string, val int64) { - if conn != nil { - conn.CustomChan() <- func() { - s.IncrProperty(key, val) - } - } else { - s.IncrProperty(key, val) - } -} diff --git a/pb/game.pb.go b/pb/game.pb.go index 5e88787..afafe4e 100644 --- a/pb/game.pb.go +++ b/pb/game.pb.go @@ -514,6 +514,54 @@ func (x *RoleUpdateItemsRsp) GetItems() string { return "" } +//ResponseCmd EquipmentAddRsp +type EquipmentAddRsp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Equip *Equipment `protobuf:"bytes,1,opt,name=equip,proto3" json:"equip,omitempty"` +} + +func (x *EquipmentAddRsp) Reset() { + *x = EquipmentAddRsp{} + if protoimpl.UnsafeEnabled { + mi := &file_game_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EquipmentAddRsp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EquipmentAddRsp) ProtoMessage() {} + +func (x *EquipmentAddRsp) ProtoReflect() protoreflect.Message { + mi := &file_game_proto_msgTypes[9] + 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 EquipmentAddRsp.ProtoReflect.Descriptor instead. +func (*EquipmentAddRsp) Descriptor() ([]byte, []int) { + return file_game_proto_rawDescGZIP(), []int{9} +} + +func (x *EquipmentAddRsp) GetEquip() *Equipment { + if x != nil { + return x.Equip + } + return nil +} + var File_game_proto protoreflect.FileDescriptor var file_game_proto_rawDesc = []byte{ @@ -557,8 +605,12 @@ var file_game_proto_rawDesc = []byte{ 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, + 0x6d, 0x73, 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, 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, 0x42, 0x0a, + 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -573,7 +625,7 @@ func file_game_proto_rawDescGZIP() []byte { return file_game_proto_rawDescData } -var file_game_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_game_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_game_proto_goTypes = []interface{}{ (*HeartReq)(nil), // 0: game.HeartReq (*HeartRsp)(nil), // 1: game.HeartRsp @@ -584,23 +636,25 @@ var file_game_proto_goTypes = []interface{}{ (*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 + (*EquipmentAddRsp)(nil), // 9: game.EquipmentAddRsp + (*Team)(nil), // 10: models.Team + (*Role)(nil), // 11: models.Role + (*Hero)(nil), // 12: models.Hero + (*Equipment)(nil), // 13: models.Equipment } var file_game_proto_depIdxs = []int32{ - 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 + 10, // 0: game.ChangeTeamReq.team:type_name -> models.Team + 11, // 1: game.RoleRsp.role:type_name -> models.Role + 12, // 2: game.RoleRsp.hero:type_name -> models.Hero + 10, // 3: game.RoleRsp.team:type_name -> models.Team + 13, // 4: game.RoleRsp.equipments:type_name -> models.Equipment + 11, // 5: game.RoleUpdatePropertyRsp.role:type_name -> models.Role + 13, // 6: game.EquipmentAddRsp.equip:type_name -> models.Equipment + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_game_proto_init() } @@ -718,6 +772,18 @@ func file_game_proto_init() { return nil } } + file_game_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EquipmentAddRsp); 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{ @@ -725,7 +791,7 @@ func file_game_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_game_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/models.pb.go b/pb/models.pb.go index 98b54a6..bcdf591 100644 --- a/pb/models.pb.go +++ b/pb/models.pb.go @@ -188,6 +188,7 @@ type Equipment struct { 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"` + Quality int32 `protobuf:"varint,6,opt,name=quality,proto3" json:"quality,omitempty"` } func (x *Equipment) Reset() { @@ -257,6 +258,13 @@ func (x *Equipment) GetHeroId() string { return "" } +func (x *Equipment) GetQuality() int32 { + if x != nil { + return x.Quality + } + return 0 +} + type Prop struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -610,7 +618,7 @@ 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, - 0x86, 0x01, 0x0a, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, + 0xa0, 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, @@ -618,45 +626,46 @@ var file_models_proto_rawDesc = []byte{ 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, 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, + 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, 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, 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 41e4b12..64f538e 100644 --- a/pb/protocode.pb.go +++ b/pb/protocode.pb.go @@ -34,6 +34,7 @@ const ( ProtoCode_RoleRsp ProtoCode = 8 ProtoCode_RoleUpdatePropertyRsp ProtoCode = 9 ProtoCode_RoleUpdateItemsRsp ProtoCode = 10 + ProtoCode_EquipmentAddRsp ProtoCode = 11 ) // Enum value maps for ProtoCode. @@ -50,6 +51,7 @@ var ( 8: "RoleRsp", 9: "RoleUpdatePropertyRsp", 10: "RoleUpdateItemsRsp", + 11: "EquipmentAddRsp", } ProtoCode_value = map[string]int32{ "UNKNOWN": 0, @@ -63,6 +65,7 @@ var ( "RoleRsp": 8, "RoleUpdatePropertyRsp": 9, "RoleUpdateItemsRsp": 10, + "EquipmentAddRsp": 11, } ) @@ -97,7 +100,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, 0xc9, 0x01, 0x0a, + 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xde, 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, @@ -110,8 +113,10 @@ var file_protocode_proto_rawDesc = []byte{ 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, + 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x10, 0x0a, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x10, 0x0b, 0x42, 0x0a, 0x5a, + 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( -- libgit2 0.21.2