Commit c8509ef6462db5baf31e63f5e4121c5f519f11a1
1 parent
fdc93a6b
fix: notify equipment add
Showing
9 changed files
with
210 additions
and
119 deletions
 
Show diff stats
cmd/gameserver/action/GmAction.go
| ... | ... | @@ -13,7 +13,7 @@ type GmAction struct { | 
| 13 | 13 | func (gm *GmAction) AddExp(role *models.RoleModel, properties map[string]interface{}) int { | 
| 14 | 14 | logger.Debug(properties) | 
| 15 | 15 | exp, _ := strconv.Atoi(properties["exp"].(string)) | 
| 16 | - role.IncrPropertyChan("exp", int64(exp)) | |
| 16 | + role.IncrPropertyChan("exp", int64(exp), true) | |
| 17 | 17 | return 0 | 
| 18 | 18 | } | 
| 19 | 19 | |
| ... | ... | @@ -29,16 +29,3 @@ func (gm *GmAction) AddEquip(role *models.RoleModel, properties map[string]inter | 
| 29 | 29 | role.AddEquip(equip) | 
| 30 | 30 | return 0 | 
| 31 | 31 | } | 
| 32 | - | |
| 33 | -func (gm *GmAction) DelEquip(role *models.RoleModel, properties map[string]interface{}) int { | |
| 34 | - logger.Debug(properties) | |
| 35 | - equip := &pb.Equipment{ | |
| 36 | - Id: role.IncreEquipByKey(1), | |
| 37 | - RoleId: role.Role.Id, | |
| 38 | - Type: properties["id"].(string), | |
| 39 | - } | |
| 40 | - //TODO 验证装备是否存在 | |
| 41 | - | |
| 42 | - role.AddEquip(equip) | |
| 43 | - return 0 | |
| 44 | -} | ... | ... | 
common/components/conn.go
| ... | ... | @@ -140,6 +140,23 @@ func (c *Connection) Send(errCode int32, cmd uint32, data []byte) error { | 
| 140 | 140 | } | 
| 141 | 141 | } | 
| 142 | 142 | |
| 143 | +func (c *Connection) SendSuccess(cmd uint32, data []byte) error { | |
| 144 | + buf, err := c.splitter.Pack(cmd, data, 0, 0) | |
| 145 | + if err != nil { | |
| 146 | + return err | |
| 147 | + } | |
| 148 | + | |
| 149 | + sendTimeout := time.NewTimer(5 * time.Millisecond) | |
| 150 | + defer sendTimeout.Stop() | |
| 151 | + // 发送超时 | |
| 152 | + select { | |
| 153 | + case <-sendTimeout.C: | |
| 154 | + return fmt.Errorf("send buff msg timeout") | |
| 155 | + case c.WBuffer <- buf: | |
| 156 | + return nil | |
| 157 | + } | |
| 158 | +} | |
| 159 | + | |
| 143 | 160 | func (c *Connection) CustomChan() chan<- func() { | 
| 144 | 161 | return c.customizeFunc | 
| 145 | 162 | } | ... | ... | 
common/components/icompontents.go
| ... | ... | @@ -51,6 +51,7 @@ type ( | 
| 51 | 51 | Start() | 
| 52 | 52 | Stop() | 
| 53 | 53 | Send(errCode int32, cmd uint32, b []byte) error | 
| 54 | + SendSuccess(cmd uint32, b []byte) error | |
| 54 | 55 | CustomChan() chan<- func() | 
| 55 | 56 | |
| 56 | 57 | SetConnectionCallback(ConnectionCallback) | 
| ... | ... | @@ -152,7 +153,7 @@ type ( | 
| 152 | 153 | |
| 153 | 154 | SetProperty(key string, val interface{}) | 
| 154 | 155 | SetProperties(properties map[string]interface{}) | 
| 155 | - IncrProperty(key string, val int64) | |
| 156 | + IncrProperty(key string, val int64) int64 | |
| 156 | 157 | ParseFields(message protoreflect.Message, properties map[string]interface{}) []int32 | 
| 157 | 158 | } | 
| 158 | 159 | ) | ... | ... | 
models/role.go
| ... | ... | @@ -235,34 +235,6 @@ func (m *RoleModel) GetEquipments() []*pb.Equipment { | 
| 235 | 235 | return equips | 
| 236 | 236 | } | 
| 237 | 237 | |
| 238 | -func (m *RoleModel) AddHero(hero *pb.Hero) { | |
| 239 | - h := NewHero(hero) | |
| 240 | - h.Create() | |
| 241 | - m.Heros[hero.Id] = h | |
| 242 | -} | |
| 243 | - | |
| 244 | -func (m *RoleModel) AddTeam(team *pb.Team) { | |
| 245 | - t := NewTeam(team) | |
| 246 | - t.Create() | |
| 247 | - m.Teams[team.Id] = t | |
| 248 | -} | |
| 249 | - | |
| 250 | -func (m *RoleModel) UpdateTeam(teams []*pb.Team) { | |
| 251 | - for _, team := range teams { | |
| 252 | - team.RoleId = m.Role.Id | |
| 253 | - t := m.Teams[team.Id] | |
| 254 | - if t != nil { | |
| 255 | - t.UpdateSchema(team) | |
| 256 | - } | |
| 257 | - } | |
| 258 | -} | |
| 259 | - | |
| 260 | -func (m *RoleModel) AddEquip(equip *pb.Equipment) { | |
| 261 | - e := NewEquip(equip) | |
| 262 | - e.Create() | |
| 263 | - m.Equipments[equip.Id] = e | |
| 264 | -} | |
| 265 | - | |
| 266 | 238 | func (m *RoleModel) OnRecoverTimer(now int64) { | 
| 267 | 239 | m.SaveRoleData(now) | 
| 268 | 240 | } | 
| ... | ... | @@ -296,10 +268,11 @@ func (m *RoleModel) SaveRoleData(now int64) { | 
| 296 | 268 | } | 
| 297 | 269 | } | 
| 298 | 270 | |
| 299 | -func (m *RoleModel) IncrPropertyChan(key string, val int64) { | |
| 271 | +func (m *RoleModel) IncrPropertyChan(key string, val int64, notify bool) { | |
| 300 | 272 | if m.GetConn() != nil { | 
| 301 | 273 | m.GetConn().CustomChan() <- func() { | 
| 302 | - m.IncrProperty(key, val) | |
| 274 | + incr := m.IncrProperty(key, val) | |
| 275 | + m.UpdateProperty(key, incr, notify) | |
| 303 | 276 | } | 
| 304 | 277 | } else { | 
| 305 | 278 | m.IncrProperty(key, val) | ... | ... | 
models/rolePlugin.go
| ... | ... | @@ -83,3 +83,45 @@ func (m *RoleModel) AddItems(params common.IMapString) bool { | 
| 83 | 83 | |
| 84 | 84 | return true | 
| 85 | 85 | } | 
| 86 | + | |
| 87 | +func (m *RoleModel) AddHero(hero *pb.Hero) { | |
| 88 | + h := NewHero(hero) | |
| 89 | + h.Create() | |
| 90 | + m.Heros[hero.Id] = h | |
| 91 | +} | |
| 92 | + | |
| 93 | +func (m *RoleModel) AddTeam(team *pb.Team) { | |
| 94 | + t := NewTeam(team) | |
| 95 | + t.Create() | |
| 96 | + m.Teams[team.Id] = t | |
| 97 | +} | |
| 98 | + | |
| 99 | +func (m *RoleModel) UpdateTeam(teams []*pb.Team) { | |
| 100 | + for _, team := range teams { | |
| 101 | + team.RoleId = m.Role.Id | |
| 102 | + t := m.Teams[team.Id] | |
| 103 | + if t != nil { | |
| 104 | + t.UpdateSchema(team) | |
| 105 | + } | |
| 106 | + } | |
| 107 | +} | |
| 108 | + | |
| 109 | +func (m *RoleModel) AddEquip(equip *pb.Equipment) *EquipModel { | |
| 110 | + e := NewEquip(equip) | |
| 111 | + e.Create() | |
| 112 | + m.Equipments[equip.Id] = e | |
| 113 | + m.EquipmentAddNotify(equip) | |
| 114 | + return e | |
| 115 | +} | |
| 116 | + | |
| 117 | +func (m *RoleModel) EquipmentAddNotify(equip *pb.Equipment) { | |
| 118 | + update := &pb.EquipmentAddRsp{Equip: equip} | |
| 119 | + if rsp, err := proto.Marshal(update); err != nil { | |
| 120 | + logger.Error(" EquipmentAddNotify err:", err.Error()) | |
| 121 | + return | |
| 122 | + } else { | |
| 123 | + if m.GetConn() != nil { | |
| 124 | + m.GetConn().SendSuccess(uint32(pb.ProtoCode_EquipmentAddRsp), rsp) | |
| 125 | + } | |
| 126 | + } | |
| 127 | +} | ... | ... | 
models/schema.go
| ... | ... | @@ -176,10 +176,10 @@ func (s *Schema) SetProperties(properties map[string]interface{}) { | 
| 176 | 176 | } | 
| 177 | 177 | } | 
| 178 | 178 | |
| 179 | -func (s *Schema) IncrProperty(key string, val int64) { | |
| 179 | +func (s *Schema) IncrProperty(key string, val int64) int64 { | |
| 180 | 180 | idx, ok := s.reflectIndex[strings.ToLower(key)] | 
| 181 | 181 | if !ok { | 
| 182 | - return | |
| 182 | + return 0 | |
| 183 | 183 | } | 
| 184 | 184 | field := s.reflectValue.Field(idx) | 
| 185 | 185 | var v int64 | 
| ... | ... | @@ -190,6 +190,7 @@ func (s *Schema) IncrProperty(key string, val int64) { | 
| 190 | 190 | v = field.Int() + val | 
| 191 | 191 | } | 
| 192 | 192 | s.SetProperty(key, v) | 
| 193 | + return v | |
| 193 | 194 | } | 
| 194 | 195 | |
| 195 | 196 | 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 | 
| 208 | 209 | |
| 209 | 210 | return ids | 
| 210 | 211 | } | 
| 211 | - | |
| 212 | -func (s *Schema) IncrPropertyChan(conn components.IConnection, key string, val int64) { | |
| 213 | - if conn != nil { | |
| 214 | - conn.CustomChan() <- func() { | |
| 215 | - s.IncrProperty(key, val) | |
| 216 | - } | |
| 217 | - } else { | |
| 218 | - s.IncrProperty(key, val) | |
| 219 | - } | |
| 220 | -} | ... | ... | 
pb/game.pb.go
| ... | ... | @@ -514,6 +514,54 @@ func (x *RoleUpdateItemsRsp) GetItems() string { | 
| 514 | 514 | return "" | 
| 515 | 515 | } | 
| 516 | 516 | |
| 517 | +//ResponseCmd EquipmentAddRsp | |
| 518 | +type EquipmentAddRsp struct { | |
| 519 | + state protoimpl.MessageState | |
| 520 | + sizeCache protoimpl.SizeCache | |
| 521 | + unknownFields protoimpl.UnknownFields | |
| 522 | + | |
| 523 | + Equip *Equipment `protobuf:"bytes,1,opt,name=equip,proto3" json:"equip,omitempty"` | |
| 524 | +} | |
| 525 | + | |
| 526 | +func (x *EquipmentAddRsp) Reset() { | |
| 527 | + *x = EquipmentAddRsp{} | |
| 528 | + if protoimpl.UnsafeEnabled { | |
| 529 | + mi := &file_game_proto_msgTypes[9] | |
| 530 | + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 531 | + ms.StoreMessageInfo(mi) | |
| 532 | + } | |
| 533 | +} | |
| 534 | + | |
| 535 | +func (x *EquipmentAddRsp) String() string { | |
| 536 | + return protoimpl.X.MessageStringOf(x) | |
| 537 | +} | |
| 538 | + | |
| 539 | +func (*EquipmentAddRsp) ProtoMessage() {} | |
| 540 | + | |
| 541 | +func (x *EquipmentAddRsp) ProtoReflect() protoreflect.Message { | |
| 542 | + mi := &file_game_proto_msgTypes[9] | |
| 543 | + if protoimpl.UnsafeEnabled && x != nil { | |
| 544 | + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 545 | + if ms.LoadMessageInfo() == nil { | |
| 546 | + ms.StoreMessageInfo(mi) | |
| 547 | + } | |
| 548 | + return ms | |
| 549 | + } | |
| 550 | + return mi.MessageOf(x) | |
| 551 | +} | |
| 552 | + | |
| 553 | +// Deprecated: Use EquipmentAddRsp.ProtoReflect.Descriptor instead. | |
| 554 | +func (*EquipmentAddRsp) Descriptor() ([]byte, []int) { | |
| 555 | + return file_game_proto_rawDescGZIP(), []int{9} | |
| 556 | +} | |
| 557 | + | |
| 558 | +func (x *EquipmentAddRsp) GetEquip() *Equipment { | |
| 559 | + if x != nil { | |
| 560 | + return x.Equip | |
| 561 | + } | |
| 562 | + return nil | |
| 563 | +} | |
| 564 | + | |
| 517 | 565 | var File_game_proto protoreflect.FileDescriptor | 
| 518 | 566 | |
| 519 | 567 | var file_game_proto_rawDesc = []byte{ | 
| ... | ... | @@ -557,8 +605,12 @@ var file_game_proto_rawDesc = []byte{ | 
| 557 | 605 | 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x2a, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, | 
| 558 | 606 | 0x64, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, | 
| 559 | 607 | 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, | 
| 560 | - 0x6d, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, | |
| 561 | - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, | |
| 608 | + 0x6d, 0x73, 0x22, 0x3a, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, | |
| 609 | + 0x64, 0x64, 0x52, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x71, 0x75, 0x69, 0x70, 0x18, 0x01, | |
| 610 | + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x45, 0x71, | |
| 611 | + 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x71, 0x75, 0x69, 0x70, 0x42, 0x0a, | |
| 612 | + 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, | |
| 613 | + 0x6f, 0x33, | |
| 562 | 614 | } | 
| 563 | 615 | |
| 564 | 616 | var ( | 
| ... | ... | @@ -573,7 +625,7 @@ func file_game_proto_rawDescGZIP() []byte { | 
| 573 | 625 | return file_game_proto_rawDescData | 
| 574 | 626 | } | 
| 575 | 627 | |
| 576 | -var file_game_proto_msgTypes = make([]protoimpl.MessageInfo, 9) | |
| 628 | +var file_game_proto_msgTypes = make([]protoimpl.MessageInfo, 10) | |
| 577 | 629 | var file_game_proto_goTypes = []interface{}{ | 
| 578 | 630 | (*HeartReq)(nil), // 0: game.HeartReq | 
| 579 | 631 | (*HeartRsp)(nil), // 1: game.HeartRsp | 
| ... | ... | @@ -584,23 +636,25 @@ var file_game_proto_goTypes = []interface{}{ | 
| 584 | 636 | (*RoleRsp)(nil), // 6: game.RoleRsp | 
| 585 | 637 | (*RoleUpdatePropertyRsp)(nil), // 7: game.RoleUpdatePropertyRsp | 
| 586 | 638 | (*RoleUpdateItemsRsp)(nil), // 8: game.RoleUpdateItemsRsp | 
| 587 | - (*Team)(nil), // 9: models.Team | |
| 588 | - (*Role)(nil), // 10: models.Role | |
| 589 | - (*Hero)(nil), // 11: models.Hero | |
| 590 | - (*Equipment)(nil), // 12: models.Equipment | |
| 639 | + (*EquipmentAddRsp)(nil), // 9: game.EquipmentAddRsp | |
| 640 | + (*Team)(nil), // 10: models.Team | |
| 641 | + (*Role)(nil), // 11: models.Role | |
| 642 | + (*Hero)(nil), // 12: models.Hero | |
| 643 | + (*Equipment)(nil), // 13: models.Equipment | |
| 591 | 644 | } | 
| 592 | 645 | var file_game_proto_depIdxs = []int32{ | 
| 593 | - 9, // 0: game.ChangeTeamReq.team:type_name -> models.Team | |
| 594 | - 10, // 1: game.RoleRsp.role:type_name -> models.Role | |
| 595 | - 11, // 2: game.RoleRsp.hero:type_name -> models.Hero | |
| 596 | - 9, // 3: game.RoleRsp.team:type_name -> models.Team | |
| 597 | - 12, // 4: game.RoleRsp.equipments:type_name -> models.Equipment | |
| 598 | - 10, // 5: game.RoleUpdatePropertyRsp.role:type_name -> models.Role | |
| 599 | - 6, // [6:6] is the sub-list for method output_type | |
| 600 | - 6, // [6:6] is the sub-list for method input_type | |
| 601 | - 6, // [6:6] is the sub-list for extension type_name | |
| 602 | - 6, // [6:6] is the sub-list for extension extendee | |
| 603 | - 0, // [0:6] is the sub-list for field type_name | |
| 646 | + 10, // 0: game.ChangeTeamReq.team:type_name -> models.Team | |
| 647 | + 11, // 1: game.RoleRsp.role:type_name -> models.Role | |
| 648 | + 12, // 2: game.RoleRsp.hero:type_name -> models.Hero | |
| 649 | + 10, // 3: game.RoleRsp.team:type_name -> models.Team | |
| 650 | + 13, // 4: game.RoleRsp.equipments:type_name -> models.Equipment | |
| 651 | + 11, // 5: game.RoleUpdatePropertyRsp.role:type_name -> models.Role | |
| 652 | + 13, // 6: game.EquipmentAddRsp.equip:type_name -> models.Equipment | |
| 653 | + 7, // [7:7] is the sub-list for method output_type | |
| 654 | + 7, // [7:7] is the sub-list for method input_type | |
| 655 | + 7, // [7:7] is the sub-list for extension type_name | |
| 656 | + 7, // [7:7] is the sub-list for extension extendee | |
| 657 | + 0, // [0:7] is the sub-list for field type_name | |
| 604 | 658 | } | 
| 605 | 659 | |
| 606 | 660 | func init() { file_game_proto_init() } | 
| ... | ... | @@ -718,6 +772,18 @@ func file_game_proto_init() { | 
| 718 | 772 | return nil | 
| 719 | 773 | } | 
| 720 | 774 | } | 
| 775 | + file_game_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { | |
| 776 | + switch v := v.(*EquipmentAddRsp); i { | |
| 777 | + case 0: | |
| 778 | + return &v.state | |
| 779 | + case 1: | |
| 780 | + return &v.sizeCache | |
| 781 | + case 2: | |
| 782 | + return &v.unknownFields | |
| 783 | + default: | |
| 784 | + return nil | |
| 785 | + } | |
| 786 | + } | |
| 721 | 787 | } | 
| 722 | 788 | type x struct{} | 
| 723 | 789 | out := protoimpl.TypeBuilder{ | 
| ... | ... | @@ -725,7 +791,7 @@ func file_game_proto_init() { | 
| 725 | 791 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), | 
| 726 | 792 | RawDescriptor: file_game_proto_rawDesc, | 
| 727 | 793 | NumEnums: 0, | 
| 728 | - NumMessages: 9, | |
| 794 | + NumMessages: 10, | |
| 729 | 795 | NumExtensions: 0, | 
| 730 | 796 | NumServices: 0, | 
| 731 | 797 | }, | ... | ... | 
pb/models.pb.go
| ... | ... | @@ -188,6 +188,7 @@ type Equipment struct { | 
| 188 | 188 | Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` | 
| 189 | 189 | EnhanceLevel int32 `protobuf:"varint,4,opt,name=enhance_level,json=enhanceLevel,proto3" json:"enhance_level,omitempty"` | 
| 190 | 190 | HeroId string `protobuf:"bytes,5,opt,name=hero_id,json=heroId,proto3" json:"hero_id,omitempty"` | 
| 191 | + Quality int32 `protobuf:"varint,6,opt,name=quality,proto3" json:"quality,omitempty"` | |
| 191 | 192 | } | 
| 192 | 193 | |
| 193 | 194 | func (x *Equipment) Reset() { | 
| ... | ... | @@ -257,6 +258,13 @@ func (x *Equipment) GetHeroId() string { | 
| 257 | 258 | return "" | 
| 258 | 259 | } | 
| 259 | 260 | |
| 261 | +func (x *Equipment) GetQuality() int32 { | |
| 262 | + if x != nil { | |
| 263 | + return x.Quality | |
| 264 | + } | |
| 265 | + return 0 | |
| 266 | +} | |
| 267 | + | |
| 260 | 268 | type Prop struct { | 
| 261 | 269 | state protoimpl.MessageState | 
| 262 | 270 | sizeCache protoimpl.SizeCache | 
| ... | ... | @@ -610,7 +618,7 @@ var file_models_proto_rawDesc = []byte{ | 
| 610 | 618 | 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x69, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, | 
| 611 | 619 | 0x1e, 0x0a, 0x0a, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, | 
| 612 | 620 | 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, | 
| 613 | - 0x86, 0x01, 0x0a, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, | |
| 621 | + 0xa0, 0x01, 0x0a, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, | |
| 614 | 622 | 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, | 
| 615 | 623 | 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, | 
| 616 | 624 | 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{ | 
| 618 | 626 | 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, | 
| 619 | 627 | 0x05, 0x52, 0x0c, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, | 
| 620 | 628 | 0x17, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, | 
| 621 | - 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x04, 0x50, 0x72, 0x6f, 0x70, | |
| 622 | - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, | |
| 623 | - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, | |
| 624 | - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x80, 0x01, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, | |
| 625 | - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, | |
| 626 | - 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, | |
| 627 | - 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, | |
| 628 | - 0x5f, 0x69, 0x64, 0x31, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, | |
| 629 | - 0x49, 0x64, 0x31, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x32, 0x18, | |
| 630 | - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x32, 0x12, 0x19, | |
| 631 | - 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x33, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, | |
| 632 | - 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x33, 0x22, 0x2f, 0x0a, 0x09, 0x49, 0x6e, 0x63, | |
| 633 | - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, | |
| 634 | - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, | |
| 635 | - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0xe2, 0x02, 0x0a, 0x04, 0x52, | |
| 636 | - 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, | |
| 637 | - 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, | |
| 638 | - 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, | |
| 639 | - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, | |
| 640 | - 0x04, 0x6e, 0x69, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x69, 0x63, | |
| 641 | - 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, | |
| 642 | - 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x06, | |
| 643 | - 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, | |
| 644 | - 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x68, 0x70, 0x12, 0x15, 0x0a, 0x06, 0x68, 0x70, 0x5f, | |
| 645 | - 0x6d, 0x61, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x68, 0x70, 0x4d, 0x61, 0x78, | |
| 646 | - 0x12, 0x13, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x5f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, | |
| 647 | - 0x04, 0x62, 0x75, 0x79, 0x52, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x5f, 0x72, 0x18, 0x0c, | |
| 648 | - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x79, 0x52, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x65, | |
| 649 | - 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x06, | |
| 650 | - 0x69, 0x6e, 0x63, 0x72, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, | |
| 651 | - 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x2e, 0x49, 0x6e, 0x63, 0x72, 0x65, | |
| 652 | - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x73, 0x12, 0x14, | |
| 653 | - 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, | |
| 654 | - 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x73, 0x45, 0x6e, | |
| 655 | - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, | |
| 656 | - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, | |
| 657 | - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, | |
| 658 | - 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, | |
| 659 | - 0x74, 0x6f, 0x33, | |
| 629 | + 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x71, 0x75, 0x61, 0x6c, | |
| 630 | + 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, | |
| 631 | + 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x04, 0x50, 0x72, 0x6f, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, | |
| 632 | + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, | |
| 633 | + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, | |
| 634 | + 0x22, 0x80, 0x01, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, | |
| 635 | + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, | |
| 636 | + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, | |
| 637 | + 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x31, 0x18, 0x03, | |
| 638 | + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x31, 0x12, 0x19, 0x0a, | |
| 639 | + 0x08, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x64, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, | |
| 640 | + 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x32, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, | |
| 641 | + 0x5f, 0x69, 0x64, 0x33, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, | |
| 642 | + 0x49, 0x64, 0x33, 0x22, 0x2f, 0x0a, 0x09, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, | |
| 643 | + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, | |
| 644 | + 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, | |
| 645 | + 0x03, 0x76, 0x61, 0x6c, 0x22, 0xe2, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, | |
| 646 | + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, | |
| 647 | + 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, | |
| 648 | + 0x16, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, | |
| 649 | + 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x69, 0x63, 0x6b, 0x18, | |
| 650 | + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x6c, | |
| 651 | + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, | |
| 652 | + 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, | |
| 653 | + 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, | |
| 654 | + 0x02, 0x68, 0x70, 0x12, 0x15, 0x0a, 0x06, 0x68, 0x70, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x08, 0x20, | |
| 655 | + 0x01, 0x28, 0x03, 0x52, 0x05, 0x68, 0x70, 0x4d, 0x61, 0x78, 0x12, 0x13, 0x0a, 0x05, 0x62, 0x75, | |
| 656 | + 0x79, 0x5f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x75, 0x79, 0x52, 0x12, | |
| 657 | + 0x13, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x5f, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, | |
| 658 | + 0x70, 0x61, 0x79, 0x52, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, | |
| 659 | + 0x08, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x06, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x73, | |
| 660 | + 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, | |
| 661 | + 0x52, 0x6f, 0x6c, 0x65, 0x2e, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, | |
| 662 | + 0x52, 0x06, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, | |
| 663 | + 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x39, | |
| 664 | + 0x0a, 0x0b, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, | |
| 665 | + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, | |
| 666 | + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, | |
| 667 | + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, | |
| 668 | + 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, | |
| 660 | 669 | } | 
| 661 | 670 | |
| 662 | 671 | var ( | ... | ... | 
pb/protocode.pb.go
| ... | ... | @@ -34,6 +34,7 @@ const ( | 
| 34 | 34 | ProtoCode_RoleRsp ProtoCode = 8 | 
| 35 | 35 | ProtoCode_RoleUpdatePropertyRsp ProtoCode = 9 | 
| 36 | 36 | ProtoCode_RoleUpdateItemsRsp ProtoCode = 10 | 
| 37 | + ProtoCode_EquipmentAddRsp ProtoCode = 11 | |
| 37 | 38 | ) | 
| 38 | 39 | |
| 39 | 40 | // Enum value maps for ProtoCode. | 
| ... | ... | @@ -50,6 +51,7 @@ var ( | 
| 50 | 51 | 8: "RoleRsp", | 
| 51 | 52 | 9: "RoleUpdatePropertyRsp", | 
| 52 | 53 | 10: "RoleUpdateItemsRsp", | 
| 54 | + 11: "EquipmentAddRsp", | |
| 53 | 55 | } | 
| 54 | 56 | ProtoCode_value = map[string]int32{ | 
| 55 | 57 | "UNKNOWN": 0, | 
| ... | ... | @@ -63,6 +65,7 @@ var ( | 
| 63 | 65 | "RoleRsp": 8, | 
| 64 | 66 | "RoleUpdatePropertyRsp": 9, | 
| 65 | 67 | "RoleUpdateItemsRsp": 10, | 
| 68 | + "EquipmentAddRsp": 11, | |
| 66 | 69 | } | 
| 67 | 70 | ) | 
| 68 | 71 | |
| ... | ... | @@ -97,7 +100,7 @@ var File_protocode_proto protoreflect.FileDescriptor | 
| 97 | 100 | |
| 98 | 101 | var file_protocode_proto_rawDesc = []byte{ | 
| 99 | 102 | 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, | 
| 100 | - 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xc9, 0x01, 0x0a, | |
| 103 | + 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xde, 0x01, 0x0a, | |
| 101 | 104 | 0x09, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, | 
| 102 | 105 | 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, | 
| 103 | 106 | 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{ | 
| 110 | 113 | 0x52, 0x73, 0x70, 0x10, 0x08, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, | 
| 111 | 114 | 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x73, 0x70, 0x10, 0x09, | 
| 112 | 115 | 0x12, 0x16, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x74, | 
| 113 | - 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x10, 0x0a, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, | |
| 114 | - 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, | |
| 116 | + 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x10, 0x0a, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, | |
| 117 | + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x10, 0x0b, 0x42, 0x0a, 0x5a, | |
| 118 | + 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, | |
| 119 | + 0x33, | |
| 115 | 120 | } | 
| 116 | 121 | |
| 117 | 122 | var ( | ... | ... |