上传装备协议代码优化
This commit is contained in:
parent
b7e83a6371
commit
191d416405
@ -24,8 +24,7 @@ func (this *MComp_Configure) Init(service core.IService, module core.IModule, co
|
||||
|
||||
//加载配置文件
|
||||
func (this *MComp_Configure) LoadConfigure(name string, fn interface{}) (err error) {
|
||||
configure.RegisterConfigure(name, fn)
|
||||
return
|
||||
return configure.RegisterConfigure(name, fn)
|
||||
}
|
||||
|
||||
//读取配置数据
|
||||
|
@ -10,31 +10,37 @@ import (
|
||||
//参数校验
|
||||
func (this *Api_Comp) Equip_Check(session comm.IUserSession, req *pb.Equipment_Equip_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
var (
|
||||
err error
|
||||
errorCode pb.ErrorCode
|
||||
conf *cfg.Game_equipmentData
|
||||
equipment *pb.DB_Equipment
|
||||
hero *pb.DB_HeroData
|
||||
err error
|
||||
errorCode pb.ErrorCode
|
||||
confs []*cfg.Game_equipmentData
|
||||
equipments []*pb.DB_Equipment
|
||||
hero *pb.DB_HeroData
|
||||
)
|
||||
if equipment, err = this.module.model_equipment_comp.Equipment_QueryUserEquipmentsPackById(session.GetUserId(), req.EquipmentId); err != nil {
|
||||
log.Errorf("Equip_Check err:%v", err)
|
||||
code.Code = pb.ErrorCode_EquipmentOnFoundEquipment
|
||||
return
|
||||
confs = make([]*cfg.Game_equipmentData, len(req.EquipmentId))
|
||||
equipments = make([]*pb.DB_Equipment, len(req.EquipmentId))
|
||||
for i, v := range req.EquipmentId {
|
||||
if v != "" {
|
||||
if equipments[i], err = this.module.model_equipment_comp.Equipment_QueryUserEquipmentsPackById(session.GetUserId(), v); err != nil {
|
||||
log.Errorf("Equip_Check err:%v", err)
|
||||
code.Code = pb.ErrorCode_EquipmentOnFoundEquipment
|
||||
return
|
||||
}
|
||||
if confs[i], err = this.module.configure_comp.GetEquipmentConfigureById(equipments[i].CId); err != nil {
|
||||
log.Errorf("Equip_Check err:%v", err)
|
||||
code.Code = pb.ErrorCode_EquipmentOnFoundEquipment
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if hero, errorCode = this.module.hero.GetHero(req.HeroCardId); errorCode != pb.ErrorCode_Success {
|
||||
code.Code = errorCode
|
||||
return
|
||||
}
|
||||
if conf, err = this.module.configure_comp.GetEquipmentConfigureById(equipment.CId); err != nil {
|
||||
log.Errorf("Equip_Check err:%v", err)
|
||||
code.Code = pb.ErrorCode_EquipmentOnFoundEquipment
|
||||
return
|
||||
}
|
||||
result = map[string]interface{}{
|
||||
"conf": conf,
|
||||
"equipment": equipment,
|
||||
"hero": hero,
|
||||
"confs": confs,
|
||||
"equipments": equipments,
|
||||
"hero": hero,
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -42,37 +48,63 @@ func (this *Api_Comp) Equip_Check(session comm.IUserSession, req *pb.Equipment_E
|
||||
///英雄挂在装备
|
||||
func (this *Api_Comp) Equip(session comm.IUserSession, agrs map[string]interface{}, req *pb.Equipment_Equip_Req) (code pb.ErrorCode) {
|
||||
var (
|
||||
err error
|
||||
conf *cfg.Game_equipmentData
|
||||
equipment *pb.DB_Equipment
|
||||
equipments []*pb.DB_Equipment
|
||||
hero *pb.DB_HeroData
|
||||
err error
|
||||
confs []*cfg.Game_equipmentData
|
||||
equipment *pb.DB_Equipment
|
||||
equipments []*pb.DB_Equipment
|
||||
updatequipment []*pb.DB_Equipment
|
||||
hero *pb.DB_HeroData
|
||||
)
|
||||
defer func() {
|
||||
if code == pb.ErrorCode_Success {
|
||||
session.SendMsg(string(this.module.GetType()), "", &pb.Equipment_Equip_Resp{})
|
||||
}
|
||||
}()
|
||||
conf = agrs["conf"].(*cfg.Game_equipmentData)
|
||||
equipment = agrs["equipment"].(*pb.DB_Equipment)
|
||||
confs = agrs["conf"].([]*cfg.Game_equipmentData)
|
||||
equipments = agrs["equipment"].([]*pb.DB_Equipment)
|
||||
updatequipment = make([]*pb.DB_Equipment, 0)
|
||||
hero = agrs["hero"].(*pb.DB_HeroData)
|
||||
if int(conf.Station) < len(hero.EquipID) {
|
||||
equipments = make([]*pb.DB_Equipment, len(hero.EquipID))
|
||||
for i, v := range hero.EquipID {
|
||||
if v != "" {
|
||||
if equipments[i], err = this.module.model_equipment_comp.Equipment_QueryUserEquipmentsPackById(session.GetUserId(), v); err != nil {
|
||||
|
||||
for i, v := range hero.EquipID {
|
||||
if v != "" {
|
||||
if equipments[i] != nil && v != equipments[i].Id {
|
||||
if equipment, err = this.module.model_equipment_comp.Equipment_QueryUserEquipmentsPackById(session.GetUserId(), v); err != nil {
|
||||
log.Errorf("Equip reader uid:%s equipment:%s err:%v", session.GetUserId(), v, err)
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
equipment.IsEquip = false
|
||||
equipments[i].IsEquip = true
|
||||
updatequipment = append(updatequipment, equipment, equipments[i])
|
||||
} else if equipments[i] == nil {
|
||||
if equipment, err = this.module.model_equipment_comp.Equipment_QueryUserEquipmentsPackById(session.GetUserId(), v); err != nil {
|
||||
log.Errorf("Equip reader uid:%s equipment:%s err:%v", session.GetUserId(), v, err)
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
equipment.IsEquip = false
|
||||
updatequipment = append(updatequipment, equipment)
|
||||
}
|
||||
} else {
|
||||
if equipments[i] != nil {
|
||||
equipments[i].IsEquip = true
|
||||
updatequipment = append(updatequipment, equipments[i])
|
||||
}
|
||||
}
|
||||
hero.EquipID[conf.Station] = equipment.Id
|
||||
equipments[conf.Station] = equipment
|
||||
code = this.module.hero.UpdateEquipment(hero, equipments)
|
||||
} else {
|
||||
log.Errorf("Equip conf:%v Station Incorrect range!", conf)
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
for i, _ := range equipments {
|
||||
if i != int(confs[i].Station) {
|
||||
log.Errorf("Equip conf:%v Target:%d Incorrect range!", confs[i], i)
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
}
|
||||
if code = this.module.hero.UpdateEquipment(hero, equipments); code == pb.ErrorCode_Success {
|
||||
if err = this.module.model_equipment_comp.Equipment_UpdateIsEquip(session.GetUserId(), updatequipment...); err != nil {
|
||||
log.Errorf("Equip err%v", err)
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -98,3 +98,15 @@ func (this *Model_Equipment_Comp) Equipment_AddEquipmentsToPack(uId string, cIds
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Model_Equipment_Comp) Equipment_UpdateIsEquip(uid string, equipments ...*pb.DB_Equipment) (err error) {
|
||||
for _, v := range equipments {
|
||||
if err = this.ChangeList(uid, v.Id, map[string]interface{}{
|
||||
"isEquip": v.IsEquip,
|
||||
}); err != nil {
|
||||
log.Errorf("Equipment_UpdateIsEquip err:%v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -113,16 +113,16 @@ type DB_Equipment struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id"` //装备id
|
||||
CId int32 `protobuf:"zigzag32,2,opt,name=cId,proto3" json:"cId"` //配置Id
|
||||
UId string `protobuf:"bytes,3,opt,name=uId,proto3" json:"uId"` //所属玩家Id
|
||||
IsEquip bool `protobuf:"varint,4,opt,name=IsEquip,proto3" json:"IsEquip"` //是否装备
|
||||
Lv int32 `protobuf:"zigzag32,5,opt,name=lv,proto3" json:"lv"` //装备强化等级
|
||||
KeepFailNum int32 `protobuf:"zigzag32,6,opt,name=keepFailNum,proto3" json:"keepFailNum"` //连续强化失败次数
|
||||
MainEntry map[uint32]int32 `protobuf:"bytes,7,rep,name=MainEntry,proto3" json:"MainEntry" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //装备主词条
|
||||
AdverbEntry map[uint32]int32 `protobuf:"bytes,8,rep,name=AdverbEntry,proto3" json:"AdverbEntry" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //装备副词条
|
||||
OverlayNum uint32 `protobuf:"varint,9,opt,name=OverlayNum,proto3" json:"OverlayNum"` //叠加数量
|
||||
IsInitialState bool `protobuf:"varint,10,opt,name=IsInitialState,proto3" json:"IsInitialState"` //是否初始状态
|
||||
Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id" bson:"_id"` //装备id
|
||||
CId int32 `protobuf:"zigzag32,2,opt,name=cId,proto3" json:"cId" bson:"cId"` // 配置Id
|
||||
UId string `protobuf:"bytes,3,opt,name=uId,proto3" json:"uId" bson:"uid"` // 所属玩家Id
|
||||
IsEquip bool `protobuf:"varint,4,opt,name=isEquip,proto3" json:"isEquip" bson:"isEquip"` // 是否装备
|
||||
Lv int32 `protobuf:"zigzag32,5,opt,name=lv,proto3" json:"lv" bson:"lv"` //装备强化等级
|
||||
KeepFailNum int32 `protobuf:"zigzag32,6,opt,name=keepFailNum,proto3" json:"keepFailNum" bson:"keepFailNum"` // 连续强化失败次数
|
||||
MainEntry map[uint32]int32 `protobuf:"bytes,7,rep,name=mainEntry,proto3" json:"mainEntry" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"mainEntry"` // 装备主词条
|
||||
AdverbEntry map[uint32]int32 `protobuf:"bytes,8,rep,name=adverbEntry,proto3" json:"adverbEntry" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"adverbEntry"` //装备副词条
|
||||
OverlayNum uint32 `protobuf:"varint,9,opt,name=overlayNum,proto3" json:"overlayNum" bson:"overlayNum"` //叠加数量
|
||||
IsInitialState bool `protobuf:"varint,10,opt,name=isInitialState,proto3" json:"isInitialState" bson:"isInitialState"` //是否初始状态
|
||||
}
|
||||
|
||||
func (x *DB_Equipment) Reset() {
|
||||
@ -236,23 +236,23 @@ var file_equipment_equipment_db_proto_rawDesc = []byte{
|
||||
0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x63, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x11, 0x52, 0x03, 0x63, 0x49,
|
||||
0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x75, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x49, 0x73, 0x45, 0x71, 0x75, 0x69, 0x70, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x49, 0x73, 0x45, 0x71, 0x75, 0x69, 0x70, 0x12, 0x0e, 0x0a,
|
||||
0x75, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x45, 0x71, 0x75, 0x69, 0x70, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x71, 0x75, 0x69, 0x70, 0x12, 0x0e, 0x0a,
|
||||
0x02, 0x6c, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x11, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x20, 0x0a,
|
||||
0x0b, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x61, 0x69, 0x6c, 0x4e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x11, 0x52, 0x0b, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x61, 0x69, 0x6c, 0x4e, 0x75, 0x6d, 0x12,
|
||||
0x3a, 0x0a, 0x09, 0x4d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x07, 0x20, 0x03,
|
||||
0x3a, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x07, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x52, 0x09, 0x4d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x0b, 0x41,
|
||||
0x52, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x0b, 0x61,
|
||||
0x64, 0x76, 0x65, 0x72, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x1e, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
|
||||
0x41, 0x64, 0x76, 0x65, 0x72, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x52, 0x0b, 0x41, 0x64, 0x76, 0x65, 0x72, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1e, 0x0a,
|
||||
0x0a, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x0a, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x4e, 0x75, 0x6d, 0x12, 0x26, 0x0a,
|
||||
0x0e, 0x49, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18,
|
||||
0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x49, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c,
|
||||
0x52, 0x0b, 0x61, 0x64, 0x76, 0x65, 0x72, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1e, 0x0a,
|
||||
0x0a, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x0a, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x4e, 0x75, 0x6d, 0x12, 0x26, 0x0a,
|
||||
0x0e, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18,
|
||||
0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c,
|
||||
0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x3c, 0x0a, 0x0e, 0x4d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74,
|
||||
0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
@ -291,8 +291,8 @@ var file_equipment_equipment_db_proto_goTypes = []interface{}{
|
||||
nil, // 4: DB_Equipment.AdverbEntryEntry
|
||||
}
|
||||
var file_equipment_equipment_db_proto_depIdxs = []int32{
|
||||
3, // 0: DB_Equipment.MainEntry:type_name -> DB_Equipment.MainEntryEntry
|
||||
4, // 1: DB_Equipment.AdverbEntry:type_name -> DB_Equipment.AdverbEntryEntry
|
||||
3, // 0: DB_Equipment.mainEntry:type_name -> DB_Equipment.MainEntryEntry
|
||||
4, // 1: DB_Equipment.adverbEntry:type_name -> DB_Equipment.AdverbEntryEntry
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
|
@ -113,8 +113,8 @@ type Equipment_Equip_Req struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
EquipmentId string `protobuf:"bytes,1,opt,name=EquipmentId,proto3" json:"EquipmentId"` //装备Id
|
||||
HeroCardId string `protobuf:"bytes,2,opt,name=HeroCardId,proto3" json:"HeroCardId"` //英雄卡Id
|
||||
HeroCardId string `protobuf:"bytes,1,opt,name=HeroCardId,proto3" json:"HeroCardId"` //英雄卡Id
|
||||
EquipmentId []string `protobuf:"bytes,2,rep,name=EquipmentId,proto3" json:"EquipmentId"` //装备Id 固定长度的数组 0-5 对应的装备栏
|
||||
}
|
||||
|
||||
func (x *Equipment_Equip_Req) Reset() {
|
||||
@ -149,13 +149,6 @@ func (*Equipment_Equip_Req) Descriptor() ([]byte, []int) {
|
||||
return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Equipment_Equip_Req) GetEquipmentId() string {
|
||||
if x != nil {
|
||||
return x.EquipmentId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Equipment_Equip_Req) GetHeroCardId() string {
|
||||
if x != nil {
|
||||
return x.HeroCardId
|
||||
@ -163,14 +156,18 @@ func (x *Equipment_Equip_Req) GetHeroCardId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Equipment_Equip_Req) GetEquipmentId() []string {
|
||||
if x != nil {
|
||||
return x.EquipmentId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//装备挂在到英雄上 回应
|
||||
type Equipment_Equip_Resp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
EquipmentId string `protobuf:"bytes,1,opt,name=EquipmentId,proto3" json:"EquipmentId"` //装备Id
|
||||
HeroCardId string `protobuf:"bytes,2,opt,name=HeroCardId,proto3" json:"HeroCardId"` //英雄卡Id
|
||||
}
|
||||
|
||||
func (x *Equipment_Equip_Resp) Reset() {
|
||||
@ -205,20 +202,6 @@ func (*Equipment_Equip_Resp) Descriptor() ([]byte, []int) {
|
||||
return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *Equipment_Equip_Resp) GetEquipmentId() string {
|
||||
if x != nil {
|
||||
return x.EquipmentId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Equipment_Equip_Resp) GetHeroCardId() string {
|
||||
if x != nil {
|
||||
return x.HeroCardId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
//装备升级
|
||||
type Equipment_Upgrade_Req struct {
|
||||
state protoimpl.MessageState
|
||||
@ -272,8 +255,6 @@ type Equipment_Upgrade_Resp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
EquipmentId string `protobuf:"bytes,1,opt,name=EquipmentId,proto3" json:"EquipmentId"` //装备Id
|
||||
}
|
||||
|
||||
func (x *Equipment_Upgrade_Resp) Reset() {
|
||||
@ -308,13 +289,6 @@ func (*Equipment_Upgrade_Resp) Descriptor() ([]byte, []int) {
|
||||
return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *Equipment_Upgrade_Resp) GetEquipmentId() string {
|
||||
if x != nil {
|
||||
return x.EquipmentId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_equipment_equipment_msg_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_equipment_equipment_msg_proto_rawDesc = []byte{
|
||||
@ -329,25 +303,19 @@ var file_equipment_equipment_msg_proto_rawDesc = []byte{
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x52, 0x0a, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22,
|
||||
0x57, 0x0a, 0x13, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x45, 0x71, 0x75,
|
||||
0x69, 0x70, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x71, 0x75,
|
||||
0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f,
|
||||
0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x48, 0x65,
|
||||
0x72, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x22, 0x58, 0x0a, 0x14, 0x45, 0x71, 0x75, 0x69,
|
||||
0x69, 0x70, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x61,
|
||||
0x72, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x48, 0x65, 0x72, 0x6f,
|
||||
0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x71, 0x75,
|
||||
0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x45, 0x71, 0x75, 0x69,
|
||||
0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x5f, 0x52, 0x65, 0x73, 0x70,
|
||||
0x12, 0x20, 0x0a, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x61, 0x72, 0x64,
|
||||
0x49, 0x64, 0x22, 0x39, 0x0a, 0x15, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f,
|
||||
0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x45,
|
||||
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x3a, 0x0a,
|
||||
0x16, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x55, 0x70, 0x67, 0x72, 0x61,
|
||||
0x64, 0x65, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x71,
|
||||
0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x22, 0x39, 0x0a, 0x15, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x55, 0x70,
|
||||
0x67, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x71, 0x75,
|
||||
0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
|
||||
0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x45,
|
||||
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65,
|
||||
0x5f, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -12,14 +12,14 @@ enum EquipmentAdverbEntry {
|
||||
}
|
||||
|
||||
message DB_Equipment {
|
||||
string Id = 1; //装备id
|
||||
sint32 cId = 2; //配置Id
|
||||
string uId = 3; //所属玩家Id
|
||||
bool IsEquip = 4; //是否装备
|
||||
sint32 lv = 5; //装备强化等级
|
||||
sint32 keepFailNum = 6; //连续强化失败次数
|
||||
map<uint32,int32> MainEntry = 7; //装备主词条
|
||||
map<uint32,int32> AdverbEntry = 8; //装备副词条
|
||||
uint32 OverlayNum = 9; //叠加数量
|
||||
bool IsInitialState = 10; //是否初始状态
|
||||
string Id = 1; //@go_tags(`bson:"_id"`) 装备id
|
||||
sint32 cId = 2; //@go_tags(`bson:"cId"`) 配置Id
|
||||
string uId = 3; //@go_tags(`bson:"uid"`) 所属玩家Id
|
||||
bool isEquip = 4; //@go_tags(`bson:"isEquip"`) 是否装备
|
||||
sint32 lv = 5; //@go_tags(`bson:"lv"`) 装备强化等级
|
||||
sint32 keepFailNum = 6; //@go_tags(`bson:"keepFailNum"`) 连续强化失败次数
|
||||
map<uint32,int32> mainEntry = 7; //@go_tags(`bson:"mainEntry"`) 装备主词条
|
||||
map<uint32,int32> adverbEntry = 8; //@go_tags(`bson:"adverbEntry"`) 装备副词条
|
||||
uint32 overlayNum = 9; //@go_tags(`bson:"overlayNum"`) 叠加数量
|
||||
bool isInitialState = 10; //@go_tags(`bson:"isInitialState"`) 是否初始状态
|
||||
}
|
@ -13,14 +13,13 @@ message Equipment_GetList_Resp {
|
||||
|
||||
//装备挂在到英雄上
|
||||
message Equipment_Equip_Req{
|
||||
string EquipmentId = 1; //装备Id
|
||||
string HeroCardId = 2; //英雄卡Id
|
||||
string HeroCardId = 1; //英雄卡Id
|
||||
repeated string EquipmentId = 2; //装备Id 固定长度的数组 0-5 对应的装备栏
|
||||
}
|
||||
|
||||
//装备挂在到英雄上 回应
|
||||
message Equipment_Equip_Resp{
|
||||
string EquipmentId = 1; //装备Id
|
||||
string HeroCardId = 2; //英雄卡Id
|
||||
|
||||
}
|
||||
|
||||
//装备升级
|
||||
@ -30,5 +29,5 @@ message Equipment_Upgrade_Req{
|
||||
|
||||
//装备升级 回应
|
||||
message Equipment_Upgrade_Resp{
|
||||
string EquipmentId = 1; //装备Id
|
||||
|
||||
}
|
@ -10,6 +10,18 @@ type Options struct {
|
||||
CheckInterval int //配置文件更新检查间隔时间 单位秒
|
||||
}
|
||||
|
||||
func Set_ConfigurePath(v string) Option {
|
||||
return func(o *Options) {
|
||||
o.ConfigurePath = v
|
||||
}
|
||||
}
|
||||
|
||||
func Set_CheckInterval(v int) Option {
|
||||
return func(o *Options) {
|
||||
o.CheckInterval = v
|
||||
}
|
||||
}
|
||||
|
||||
func newOptions(config map[string]interface{}, opts ...Option) (Options, error) {
|
||||
options := Options{
|
||||
CheckInterval: 60,
|
||||
|
Loading…
Reference in New Issue
Block a user