diff --git a/modules/pay/modelActivity.go b/modules/pay/modelActivity.go index ec4e7d313..fcb0085e6 100644 --- a/modules/pay/modelActivity.go +++ b/modules/pay/modelActivity.go @@ -113,11 +113,10 @@ func (this *modelActivityComp) deliverybyid(session comm.IUserSession, id int32) info.Activitys[conf.Type] = item } - if _, ok = item.Items[conf.Id]; ok { + if _, ok = item.Items[conf.Id]; !ok { item.Items[conf.Id] = &pb.PayActivityGiftbagItem{ Id: conf.Id, } - return } item.Items[conf.Id].Buyunm++ item.Items[conf.Id].Totalbuynum++ @@ -177,11 +176,10 @@ func (this *modelActivityComp) delivery(session comm.IUserSession, pid string) ( info.Activitys[conf.Type] = item } - if _, ok = item.Items[conf.Id]; ok { + if _, ok = item.Items[conf.Id]; !ok { item.Items[conf.Id] = &pb.PayActivityGiftbagItem{ Id: conf.Id, } - return } item.Items[conf.Id].Buyunm++ item.Items[conf.Id].Totalbuynum++ diff --git a/modules/uniongve/comp_configure.go b/modules/uniongve/comp_configure.go index 1b1d129c1..3aca237f2 100644 --- a/modules/uniongve/comp_configure.go +++ b/modules/uniongve/comp_configure.go @@ -97,6 +97,33 @@ func (this *MCompConfigure) getguildbossByid(id int32) (results *cfg.GameGuildBo return } +// 获取所有难度一的boos +func (this *MCompConfigure) getguildbossByNext(id int32, lv int32) (results *cfg.GameGuildBossData, err error) { + var ( + v interface{} + conf *cfg.GameGuildBossData + ok bool + ) + + if v, err = this.GetConfigure(game_guildboss); err != nil { + return + } else { + if conf, ok = v.(*cfg.GameGuildBoss).GetDataMap()[id]; !ok { + err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_guildboss, id) + this.module.Errorf("err:%v", err) + return + } + + for _, results = range v.(*cfg.GameGuildBoss).GetDataList() { + if conf.Group == results.Group && results.BossLv == lv { + return + } + } + err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_guildboss, fmt.Sprintf("id:%d lv:%d", id, lv)) + } + return +} + // 获取伤害对应的评分组 func (this *MCompConfigure) getguildbossscore(group int32, harm int32) (results *cfg.GameGuildBossScoreData, err error) { var ( diff --git a/modules/uniongve/modelUniongve.go b/modules/uniongve/modelUniongve.go index d94bf7416..1d9148f1d 100644 --- a/modules/uniongve/modelUniongve.go +++ b/modules/uniongve/modelUniongve.go @@ -61,6 +61,7 @@ func (this *ModelUniongve) getUnionGve(unionid string) (results *pb.DBUnionGve, Currstage: 0, Rtime: confs.Rtime, Boos: make([]*pb.DBUnionGveBoss, 0), + Roulette: make([]*pb.DBGveRouletteRecord, 0), } for _, v := range confs.Boos { if conf, err = this.module.configure.getguildbossByid(v); err != nil { @@ -84,6 +85,7 @@ func (this *ModelUniongve) updateUnionGve(data *pb.DBUnionGve) (err error) { "currstage": data.Currstage, "rtime": data.Rtime, "boos": data.Boos, + "roulette": data.Roulette, }); err != nil { this.module.Error("更新用户任务数据 错误!", log.Field{Key: "err", Value: err.Error()}) return @@ -203,4 +205,15 @@ func (this *ModelUniongve) booskill(unionid string, boosid int32, info *pb.DBUni } defer lock.Unlock() + info.Currstage++ + + for _, v := range info.Boos { + if conf, err = this.module.configure.getguildbossByNext(v.Boosid, info.Currstage); err != nil { + this.module.Errorln(err) + return + } + v.Boosid = conf.BossId + v.Hp = v.Hp + v.Record = make([]*pb.DBGveRecord, 0) + } } diff --git a/pb/uniongve_db.pb.go b/pb/uniongve_db.pb.go index 67581adcf..5c12f8b64 100644 --- a/pb/uniongve_db.pb.go +++ b/pb/uniongve_db.pb.go @@ -90,12 +90,13 @@ type DBUnionGve struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` //工会id - Notice string `protobuf:"bytes,2,opt,name=notice,proto3" json:"notice"` //公告 - Fire int32 `protobuf:"varint,3,opt,name=fire,proto3" json:"fire"` //火力 - Currstage int32 `protobuf:"varint,4,opt,name=currstage,proto3" json:"currstage"` //当前第几阶段 - Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` //刷新时间 - Boos []*DBUnionGveBoss `protobuf:"bytes,6,rep,name=boos,proto3" json:"boos"` //boos列表 + Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` //工会id + Notice string `protobuf:"bytes,2,opt,name=notice,proto3" json:"notice"` //公告 + Fire int32 `protobuf:"varint,3,opt,name=fire,proto3" json:"fire"` //火力 + Currstage int32 `protobuf:"varint,4,opt,name=currstage,proto3" json:"currstage"` //当前第几阶段 + Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` //刷新时间 + Boos []*DBUnionGveBoss `protobuf:"bytes,6,rep,name=boos,proto3" json:"boos"` //boos列表 + Roulette []*DBGveRouletteRecord `protobuf:"bytes,7,rep,name=roulette,proto3" json:"roulette"` //轮盘记录 } func (x *DBUnionGve) Reset() { @@ -172,6 +173,13 @@ func (x *DBUnionGve) GetBoos() []*DBUnionGveBoss { return nil } +func (x *DBUnionGve) GetRoulette() []*DBGveRouletteRecord { + if x != nil { + return x.Roulette + } + return nil +} + //工会boos type DBUnionGveBoss struct { state protoimpl.MessageState @@ -292,6 +300,61 @@ func (x *DBGveRecord) GetFormation() []string { return nil } +type DBGveRouletteRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` + Cid int32 `protobuf:"varint,2,opt,name=cid,proto3" json:"cid"` +} + +func (x *DBGveRouletteRecord) Reset() { + *x = DBGveRouletteRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_uniongve_uniongve_db_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBGveRouletteRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBGveRouletteRecord) ProtoMessage() {} + +func (x *DBGveRouletteRecord) ProtoReflect() protoreflect.Message { + mi := &file_uniongve_uniongve_db_proto_msgTypes[4] + 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 DBGveRouletteRecord.ProtoReflect.Descriptor instead. +func (*DBGveRouletteRecord) Descriptor() ([]byte, []int) { + return file_uniongve_uniongve_db_proto_rawDescGZIP(), []int{4} +} + +func (x *DBGveRouletteRecord) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBGveRouletteRecord) GetCid() int32 { + if x != nil { + return x.Cid + } + return 0 +} + var File_uniongve_uniongve_db_proto protoreflect.FileDescriptor var file_uniongve_uniongve_db_proto_rawDesc = []byte{ @@ -301,7 +364,7 @@ var file_uniongve_uniongve_db_proto_rawDesc = []byte{ 0x6e, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, - 0x6f, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x22, 0xab, + 0x6f, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x22, 0xdd, 0x01, 0x0a, 0x0a, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, @@ -312,18 +375,25 @@ var file_uniongve_uniongve_db_proto_rawDesc = []byte{ 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, - 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x22, 0x5e, 0x0a, 0x0e, - 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x12, 0x16, - 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, - 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x3d, 0x0a, 0x0b, - 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, - 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, - 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x12, 0x30, 0x0a, 0x08, + 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x52, 0x08, 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x22, 0x5e, + 0x0a, 0x0e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x3d, + 0x0a, 0x0b, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x0a, + 0x13, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -338,21 +408,23 @@ func file_uniongve_uniongve_db_proto_rawDescGZIP() []byte { return file_uniongve_uniongve_db_proto_rawDescData } -var file_uniongve_uniongve_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_uniongve_uniongve_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_uniongve_uniongve_db_proto_goTypes = []interface{}{ - (*DBUnionGveBossConf)(nil), // 0: DBUnionGveBossConf - (*DBUnionGve)(nil), // 1: DBUnionGve - (*DBUnionGveBoss)(nil), // 2: DBUnionGveBoss - (*DBGveRecord)(nil), // 3: DBGveRecord + (*DBUnionGveBossConf)(nil), // 0: DBUnionGveBossConf + (*DBUnionGve)(nil), // 1: DBUnionGve + (*DBUnionGveBoss)(nil), // 2: DBUnionGveBoss + (*DBGveRecord)(nil), // 3: DBGveRecord + (*DBGveRouletteRecord)(nil), // 4: DBGveRouletteRecord } var file_uniongve_uniongve_db_proto_depIdxs = []int32{ 2, // 0: DBUnionGve.boos:type_name -> DBUnionGveBoss - 3, // 1: DBUnionGveBoss.record:type_name -> DBGveRecord - 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 - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 4, // 1: DBUnionGve.roulette:type_name -> DBGveRouletteRecord + 3, // 2: DBUnionGveBoss.record:type_name -> DBGveRecord + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_uniongve_uniongve_db_proto_init() } @@ -409,6 +481,18 @@ func file_uniongve_uniongve_db_proto_init() { return nil } } + file_uniongve_uniongve_db_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBGveRouletteRecord); 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{ @@ -416,7 +500,7 @@ func file_uniongve_uniongve_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_uniongve_uniongve_db_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 0, },