diff --git a/DesignerConfigs b/DesignerConfigs index 1ec8028..e062c50 160000 --- a/DesignerConfigs +++ b/DesignerConfigs @@ -1 +1 @@ -Subproject commit 1ec80286186bbff099911043511ea7d59b64ce44 +Subproject commit e062c5009b60e14a5d2eca3d1cfef903bce81d4c diff --git a/cmd/gameserver/action/HeroAction.go b/cmd/gameserver/action/HeroAction.go new file mode 100644 index 0000000..590c17d --- /dev/null +++ b/cmd/gameserver/action/HeroAction.go @@ -0,0 +1,83 @@ +package action + +import ( + "fmt" + "github.com/golang/protobuf/proto" + "go.mongodb.org/mongo-driver/bson" + "pro2d/common/components" + "pro2d/common/db/mongoproxy" + "pro2d/common/logger" + "pro2d/csvdata" + "pro2d/models" + "pro2d/pb" +) + +/* +EquipmentDelRpc 删除装备 + 2 删除失败 +*/ +func EquipmentDelRpc(role *models.RoleModel, msg components.IMessage) (int32, interface{}) { + req := pb.EquipmentDelReq{} + if err := proto.Unmarshal(msg.GetData(), &req); err != nil { + logger.Error("loginRpc err: %v", err) + return 1, nil + } + filter := bson.D{{"id", bson.D{{"$in", req.Id}}}} + if err := mongoproxy.DelMany("equipment", filter); err != nil { + logger.Error(err.Error()) + return 2, nil + } + + for _, id := range req.Id { + delete(role.Equipments, id) + } + + return 0, nil +} + +/* +HeroUpLevelRpc 英雄升级 + 2 item不存在 + 3 itemType错误 + 4 itemExp 不存在 + 5 英雄不存在 + 6 消耗物品失败 +*/ +func HeroUpLevelRpc(role *models.RoleModel, msg components.IMessage) (int32, interface{}) { + req := pb.HeroUpLevelReq{} + if err := proto.Unmarshal(msg.GetData(), &req); err != nil { + logger.Error("loginRpc err: %v", err) + return 1, nil + } + if req.Count <= 0 { + req.Count = 1 + } + + item := csvdata.Get().TbItemData.Get(req.ItemId) + if item == nil { + return 2, nil + } + if item.Type != 2003 { + return 3, nil + } + + itemExp := csvdata.Get().TbExpItemData.Get(item.ID) + if itemExp == nil { + return 4, nil + } + + hero, ok := role.Heros[req.HeroId] + if !ok { + return 5, nil + } + + if !role.CostItem(fmt.Sprintf("%d", item.ID), req.Count) { + return 6, nil + } + + h := hero.(*models.HeroModel) + level, exp := h.UpLevel(itemExp.Exp) + h.SetProperty("level", level) + h.SetProperty("exp", exp) + return 0, h.Hero +} diff --git a/cmd/gameserver/action/RoleAction.go b/cmd/gameserver/action/RoleAction.go index 28d28af..5d4df4e 100644 --- a/cmd/gameserver/action/RoleAction.go +++ b/cmd/gameserver/action/RoleAction.go @@ -4,10 +4,8 @@ package action import ( "fmt" "github.com/golang/protobuf/proto" - "go.mongodb.org/mongo-driver/bson" "pro2d/common" "pro2d/common/components" - "pro2d/common/db/mongoproxy" "pro2d/common/db/redisproxy" "pro2d/common/logger" "pro2d/csvdata" @@ -136,29 +134,6 @@ func RoleClearItemsRpc(role *models.RoleModel, msg components.IMessage) (int32, } /* -EquipmentDelRpc 删除装备 - 2 删除失败 -*/ -func EquipmentDelRpc(role *models.RoleModel, msg components.IMessage) (int32, interface{}) { - req := pb.EquipmentDelReq{} - if err := proto.Unmarshal(msg.GetData(), &req); err != nil { - logger.Error("loginRpc err: %v", err) - return 1, nil - } - filter := bson.D{{"id", bson.D{{"$in", req.Id}}}} - if err := mongoproxy.DelMany("equipment", filter); err != nil { - logger.Error(err.Error()) - return 2, nil - } - - for _, id := range req.Id { - delete(role.Equipments, id) - } - - return 0, nil -} - -/* RoleStartBattleRpc 开始战斗 */ func RoleStartBattleRpc(role *models.RoleModel, msg components.IMessage) (int32, interface{}) { diff --git a/cmd/gameserver/action/protocode.go b/cmd/gameserver/action/protocode.go index c687269..ff4f641 100644 --- a/cmd/gameserver/action/protocode.go +++ b/cmd/gameserver/action/protocode.go @@ -16,6 +16,7 @@ func GetActionMap() map[interface{}]interface{} { am[uint32(pb.ProtoCode_RoleStartBattleReq)] = RoleStartBattleRpc am[uint32(pb.ProtoCode_RoleEndBattleReq)] = RoleEndBattleRpc am[uint32(pb.ProtoCode_EquipmentDelReq)] = EquipmentDelRpc + am[uint32(pb.ProtoCode_HeroUpLevelReq)] = HeroUpLevelRpc return am -} \ No newline at end of file +} diff --git a/cmd/test/action/protocode.go b/cmd/test/action/protocode.go index db18f4b..659f6c3 100644 --- a/cmd/test/action/protocode.go +++ b/cmd/test/action/protocode.go @@ -16,13 +16,13 @@ func GetTestActionMap() map[interface{}]interface{} { am[uint32(pb.ProtoCode_RoleRsp)] = RoleRsp am[uint32(pb.ProtoCode_RoleUpdatePropertyRsp)] = RoleUpdatePropertyRsp am[uint32(pb.ProtoCode_RoleUpdateItemsRsp)] = RoleUpdateItemsRsp - am[uint32(pb.ProtoCode_RoleUpdateChangeRsp)] = RoleUpdateChangeRsp am[uint32(pb.ProtoCode_RoleClearItemsReq)] = RoleClearItemsRsp am[uint32(pb.ProtoCode_RoleStartBattleReq)] = RoleStartBattleRsp am[uint32(pb.ProtoCode_RoleEndBattleReq)] = RoleEndBattleRsp am[uint32(pb.ProtoCode_RoleEndBattleRsp)] = RoleEndBattleRsp am[uint32(pb.ProtoCode_EquipmentDelReq)] = EquipmentDelRsp am[uint32(pb.ProtoCode_EquipmentAddRsp)] = EquipmentAddRsp + am[uint32(pb.ProtoCode_HeroUpLevelReq)] = HeroUpLevelRsp return am } diff --git a/pb/game.pb.go b/pb/game.pb.go index 670f550..2d7241c 100644 --- a/pb/game.pb.go +++ b/pb/game.pb.go @@ -607,44 +607,6 @@ func (x *RoleUpdateItemsRsp) GetItems() string { return "" } -type RoleUpdateChangeRsp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RoleUpdateChangeRsp) Reset() { - *x = RoleUpdateChangeRsp{} - if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoleUpdateChangeRsp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoleUpdateChangeRsp) ProtoMessage() {} - -func (x *RoleUpdateChangeRsp) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[11] - 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 RoleUpdateChangeRsp.ProtoReflect.Descriptor instead. -func (*RoleUpdateChangeRsp) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{11} -} - //ResponseCmd RoleClearItemsReq type RoleClearItemsReq struct { state protoimpl.MessageState @@ -657,7 +619,7 @@ type RoleClearItemsReq struct { func (x *RoleClearItemsReq) Reset() { *x = RoleClearItemsReq{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[12] + mi := &file_game_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -670,7 +632,7 @@ func (x *RoleClearItemsReq) String() string { func (*RoleClearItemsReq) ProtoMessage() {} func (x *RoleClearItemsReq) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[12] + mi := &file_game_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -683,7 +645,7 @@ func (x *RoleClearItemsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RoleClearItemsReq.ProtoReflect.Descriptor instead. func (*RoleClearItemsReq) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{12} + return file_game_proto_rawDescGZIP(), []int{11} } func (x *RoleClearItemsReq) GetItems() []string { @@ -705,7 +667,7 @@ type RoleStartBattleReq struct { func (x *RoleStartBattleReq) Reset() { *x = RoleStartBattleReq{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[13] + mi := &file_game_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -718,7 +680,7 @@ func (x *RoleStartBattleReq) String() string { func (*RoleStartBattleReq) ProtoMessage() {} func (x *RoleStartBattleReq) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[13] + mi := &file_game_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -731,7 +693,7 @@ func (x *RoleStartBattleReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RoleStartBattleReq.ProtoReflect.Descriptor instead. func (*RoleStartBattleReq) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{13} + return file_game_proto_rawDescGZIP(), []int{12} } func (x *RoleStartBattleReq) GetChapterId() int32 { @@ -763,7 +725,7 @@ type RoleEndBattleReq struct { func (x *RoleEndBattleReq) Reset() { *x = RoleEndBattleReq{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[14] + mi := &file_game_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -776,7 +738,7 @@ func (x *RoleEndBattleReq) String() string { func (*RoleEndBattleReq) ProtoMessage() {} func (x *RoleEndBattleReq) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[14] + mi := &file_game_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -789,7 +751,7 @@ func (x *RoleEndBattleReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RoleEndBattleReq.ProtoReflect.Descriptor instead. func (*RoleEndBattleReq) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{14} + return file_game_proto_rawDescGZIP(), []int{13} } func (x *RoleEndBattleReq) GetChapterId() int32 { @@ -837,7 +799,7 @@ type RoleEndBattleRsp struct { func (x *RoleEndBattleRsp) Reset() { *x = RoleEndBattleRsp{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[15] + mi := &file_game_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -850,7 +812,7 @@ func (x *RoleEndBattleRsp) String() string { func (*RoleEndBattleRsp) ProtoMessage() {} func (x *RoleEndBattleRsp) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[15] + mi := &file_game_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -863,7 +825,7 @@ func (x *RoleEndBattleRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use RoleEndBattleRsp.ProtoReflect.Descriptor instead. func (*RoleEndBattleRsp) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{15} + return file_game_proto_rawDescGZIP(), []int{14} } func (x *RoleEndBattleRsp) GetRoleLevel() int32 { @@ -920,7 +882,7 @@ type EquipmentDelReq struct { func (x *EquipmentDelReq) Reset() { *x = EquipmentDelReq{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[16] + mi := &file_game_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -933,7 +895,7 @@ func (x *EquipmentDelReq) String() string { func (*EquipmentDelReq) ProtoMessage() {} func (x *EquipmentDelReq) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[16] + mi := &file_game_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -946,7 +908,7 @@ func (x *EquipmentDelReq) ProtoReflect() protoreflect.Message { // Deprecated: Use EquipmentDelReq.ProtoReflect.Descriptor instead. func (*EquipmentDelReq) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{16} + return file_game_proto_rawDescGZIP(), []int{15} } func (x *EquipmentDelReq) GetId() []string { @@ -968,7 +930,7 @@ type EquipmentAddRsp struct { func (x *EquipmentAddRsp) Reset() { *x = EquipmentAddRsp{} if protoimpl.UnsafeEnabled { - mi := &file_game_proto_msgTypes[17] + mi := &file_game_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -981,7 +943,7 @@ func (x *EquipmentAddRsp) String() string { func (*EquipmentAddRsp) ProtoMessage() {} func (x *EquipmentAddRsp) ProtoReflect() protoreflect.Message { - mi := &file_game_proto_msgTypes[17] + mi := &file_game_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -994,7 +956,7 @@ func (x *EquipmentAddRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use EquipmentAddRsp.ProtoReflect.Descriptor instead. func (*EquipmentAddRsp) Descriptor() ([]byte, []int) { - return file_game_proto_rawDescGZIP(), []int{17} + return file_game_proto_rawDescGZIP(), []int{16} } func (x *EquipmentAddRsp) GetEquip() *Equipment { @@ -1004,6 +966,69 @@ func (x *EquipmentAddRsp) GetEquip() *Equipment { return nil } +type HeroUpLevelReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HeroId string `protobuf:"bytes,1,opt,name=heroId,proto3" json:"heroId,omitempty"` + ItemId int32 `protobuf:"varint,2,opt,name=itemId,proto3" json:"itemId,omitempty"` + Count int32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *HeroUpLevelReq) Reset() { + *x = HeroUpLevelReq{} + if protoimpl.UnsafeEnabled { + mi := &file_game_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeroUpLevelReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeroUpLevelReq) ProtoMessage() {} + +func (x *HeroUpLevelReq) ProtoReflect() protoreflect.Message { + mi := &file_game_proto_msgTypes[17] + 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 HeroUpLevelReq.ProtoReflect.Descriptor instead. +func (*HeroUpLevelReq) Descriptor() ([]byte, []int) { + return file_game_proto_rawDescGZIP(), []int{17} +} + +func (x *HeroUpLevelReq) GetHeroId() string { + if x != nil { + return x.HeroId + } + return "" +} + +func (x *HeroUpLevelReq) GetItemId() int32 { + if x != nil { + return x.ItemId + } + return 0 +} + +func (x *HeroUpLevelReq) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + var File_game_proto protoreflect.FileDescriptor var file_game_proto_rawDesc = []byte{ @@ -1053,43 +1078,47 @@ var file_game_proto_rawDesc = []byte{ 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, 0x22, - 0x15, 0x0a, 0x13, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x52, 0x73, 0x70, 0x22, 0x29, 0x0a, 0x11, 0x52, 0x6f, 0x6c, 0x65, 0x43, 0x6c, - 0x65, 0x61, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, - 0x73, 0x22, 0x50, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, - 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x72, 0x62, 0x6f, - 0x6e, 0x49, 0x64, 0x22, 0x7b, 0x0a, 0x10, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, - 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x72, 0x62, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x04, 0x70, 0x61, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, - 0x22, 0xc1, 0x01, 0x0a, 0x10, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x52, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x65, 0x78, 0x70, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x12, - 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x78, 0x70, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x61, - 0x73, 0x73, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, - 0x68, 0x65, 0x72, 0x6f, 0x22, 0x21, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, - 0x74, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3a, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, - 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x71, - 0x75, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 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, + 0x29, 0x0a, 0x11, 0x52, 0x6f, 0x6c, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x50, 0x0a, 0x12, 0x52, 0x6f, + 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x7b, 0x0a, 0x10, + 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x61, 0x73, 0x73, + 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0xc1, 0x01, 0x0a, 0x10, 0x52, 0x6f, + 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x19, 0x0a, + 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x6c, 0x65, + 0x5f, 0x65, 0x78, 0x70, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0d, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x61, 0x73, 0x73, 0x12, 0x20, 0x0a, 0x04, 0x68, + 0x65, 0x72, 0x6f, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x21, 0x0a, + 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x3a, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, + 0x52, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x71, 0x75, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x45, 0x71, 0x75, 0x69, + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x71, 0x75, 0x69, 0x70, 0x22, 0x56, 0x0a, 0x0e, + 0x48, 0x65, 0x72, 0x6f, 0x55, 0x70, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x16, + 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1117,13 +1146,13 @@ var file_game_proto_goTypes = []interface{}{ (*RoleRsp)(nil), // 8: game.RoleRsp (*RoleUpdatePropertyRsp)(nil), // 9: game.RoleUpdatePropertyRsp (*RoleUpdateItemsRsp)(nil), // 10: game.RoleUpdateItemsRsp - (*RoleUpdateChangeRsp)(nil), // 11: game.RoleUpdateChangeRsp - (*RoleClearItemsReq)(nil), // 12: game.RoleClearItemsReq - (*RoleStartBattleReq)(nil), // 13: game.RoleStartBattleReq - (*RoleEndBattleReq)(nil), // 14: game.RoleEndBattleReq - (*RoleEndBattleRsp)(nil), // 15: game.RoleEndBattleRsp - (*EquipmentDelReq)(nil), // 16: game.EquipmentDelReq - (*EquipmentAddRsp)(nil), // 17: game.EquipmentAddRsp + (*RoleClearItemsReq)(nil), // 11: game.RoleClearItemsReq + (*RoleStartBattleReq)(nil), // 12: game.RoleStartBattleReq + (*RoleEndBattleReq)(nil), // 13: game.RoleEndBattleReq + (*RoleEndBattleRsp)(nil), // 14: game.RoleEndBattleRsp + (*EquipmentDelReq)(nil), // 15: game.EquipmentDelReq + (*EquipmentAddRsp)(nil), // 16: game.EquipmentAddRsp + (*HeroUpLevelReq)(nil), // 17: game.HeroUpLevelReq (*Team)(nil), // 18: models.Team (*Role)(nil), // 19: models.Role (*Hero)(nil), // 20: models.Hero @@ -1286,7 +1315,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleUpdateChangeRsp); i { + switch v := v.(*RoleClearItemsReq); i { case 0: return &v.state case 1: @@ -1298,7 +1327,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleClearItemsReq); i { + switch v := v.(*RoleStartBattleReq); i { case 0: return &v.state case 1: @@ -1310,7 +1339,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleStartBattleReq); i { + switch v := v.(*RoleEndBattleReq); i { case 0: return &v.state case 1: @@ -1322,7 +1351,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleEndBattleReq); i { + switch v := v.(*RoleEndBattleRsp); i { case 0: return &v.state case 1: @@ -1334,7 +1363,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleEndBattleRsp); i { + switch v := v.(*EquipmentDelReq); i { case 0: return &v.state case 1: @@ -1346,7 +1375,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EquipmentDelReq); i { + switch v := v.(*EquipmentAddRsp); i { case 0: return &v.state case 1: @@ -1358,7 +1387,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EquipmentAddRsp); i { + switch v := v.(*HeroUpLevelReq); i { case 0: return &v.state case 1: diff --git a/pb/protocode.pb.go b/pb/protocode.pb.go index 1b4c1db..d394d47 100644 --- a/pb/protocode.pb.go +++ b/pb/protocode.pb.go @@ -35,13 +35,13 @@ const ( ProtoCode_RoleRsp ProtoCode = 9 ProtoCode_RoleUpdatePropertyRsp ProtoCode = 10 ProtoCode_RoleUpdateItemsRsp ProtoCode = 11 - ProtoCode_RoleUpdateChangeRsp ProtoCode = 12 - ProtoCode_RoleClearItemsReq ProtoCode = 13 - ProtoCode_RoleStartBattleReq ProtoCode = 14 - ProtoCode_RoleEndBattleReq ProtoCode = 15 - ProtoCode_RoleEndBattleRsp ProtoCode = 16 - ProtoCode_EquipmentDelReq ProtoCode = 17 - ProtoCode_EquipmentAddRsp ProtoCode = 18 + ProtoCode_RoleClearItemsReq ProtoCode = 12 + ProtoCode_RoleStartBattleReq ProtoCode = 13 + ProtoCode_RoleEndBattleReq ProtoCode = 14 + ProtoCode_RoleEndBattleRsp ProtoCode = 15 + ProtoCode_EquipmentDelReq ProtoCode = 16 + ProtoCode_EquipmentAddRsp ProtoCode = 17 + ProtoCode_HeroUpLevelReq ProtoCode = 18 ) // Enum value maps for ProtoCode. @@ -59,13 +59,13 @@ var ( 9: "RoleRsp", 10: "RoleUpdatePropertyRsp", 11: "RoleUpdateItemsRsp", - 12: "RoleUpdateChangeRsp", - 13: "RoleClearItemsReq", - 14: "RoleStartBattleReq", - 15: "RoleEndBattleReq", - 16: "RoleEndBattleRsp", - 17: "EquipmentDelReq", - 18: "EquipmentAddRsp", + 12: "RoleClearItemsReq", + 13: "RoleStartBattleReq", + 14: "RoleEndBattleReq", + 15: "RoleEndBattleRsp", + 16: "EquipmentDelReq", + 17: "EquipmentAddRsp", + 18: "HeroUpLevelReq", } ProtoCode_value = map[string]int32{ "UNKNOWN": 0, @@ -80,13 +80,13 @@ var ( "RoleRsp": 9, "RoleUpdatePropertyRsp": 10, "RoleUpdateItemsRsp": 11, - "RoleUpdateChangeRsp": 12, - "RoleClearItemsReq": 13, - "RoleStartBattleReq": 14, - "RoleEndBattleReq": 15, - "RoleEndBattleRsp": 16, - "EquipmentDelReq": 17, - "EquipmentAddRsp": 18, + "RoleClearItemsReq": 12, + "RoleStartBattleReq": 13, + "RoleEndBattleReq": 14, + "RoleEndBattleRsp": 15, + "EquipmentDelReq": 16, + "EquipmentAddRsp": 17, + "HeroUpLevelReq": 18, } ) @@ -121,7 +121,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, 0xfa, 0x02, 0x0a, + 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xf5, 0x02, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x73, 0x70, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x65, 0x61, 0x72, 0x74, 0x52, 0x65, @@ -135,18 +135,18 @@ var file_protocode_proto_rawDesc = []byte{ 0x6f, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, 0x09, 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, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x10, 0x0b, 0x12, 0x17, 0x0a, 0x13, 0x52, - 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, - 0x73, 0x70, 0x10, 0x0c, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x6f, 0x6c, 0x65, 0x43, 0x6c, 0x65, 0x61, - 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x10, 0x0d, 0x12, 0x16, 0x0a, 0x12, 0x52, - 0x6f, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x10, 0x0e, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x10, 0x0f, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x6f, 0x6c, - 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, 0x10, 0x12, - 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x52, - 0x65, 0x71, 0x10, 0x11, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, - 0x74, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x10, 0x12, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, - 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x10, 0x0b, 0x12, 0x15, 0x0a, 0x11, 0x52, + 0x6f, 0x6c, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x10, 0x0c, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x10, 0x0d, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x6f, + 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x10, 0x0e, + 0x12, 0x14, 0x0a, 0x10, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x52, 0x73, 0x70, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, + 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x10, 0x10, 0x12, 0x13, 0x0a, 0x0f, 0x45, + 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x10, 0x11, + 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x55, 0x70, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, + 0x65, 0x71, 0x10, 0x12, 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 9a1343a..753495c 160000 --- a/protos +++ b/protos @@ -1 +1 @@ -Subproject commit 9a1343a1d61885be03b96ecf329f2602ec99c8d1 +Subproject commit 753495c6eff899239365191a19507c564f161d37 -- libgit2 0.21.2