上传代码

This commit is contained in:
liwei 2023-07-18 18:25:31 +08:00
parent 8cde9ee7f0
commit e102d2f548
4 changed files with 157 additions and 35 deletions

View File

@ -113,11 +113,10 @@ func (this *modelActivityComp) deliverybyid(session comm.IUserSession, id int32)
info.Activitys[conf.Type] = item 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{ item.Items[conf.Id] = &pb.PayActivityGiftbagItem{
Id: conf.Id, Id: conf.Id,
} }
return
} }
item.Items[conf.Id].Buyunm++ item.Items[conf.Id].Buyunm++
item.Items[conf.Id].Totalbuynum++ item.Items[conf.Id].Totalbuynum++
@ -177,11 +176,10 @@ func (this *modelActivityComp) delivery(session comm.IUserSession, pid string) (
info.Activitys[conf.Type] = item 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{ item.Items[conf.Id] = &pb.PayActivityGiftbagItem{
Id: conf.Id, Id: conf.Id,
} }
return
} }
item.Items[conf.Id].Buyunm++ item.Items[conf.Id].Buyunm++
item.Items[conf.Id].Totalbuynum++ item.Items[conf.Id].Totalbuynum++

View File

@ -97,6 +97,33 @@ func (this *MCompConfigure) getguildbossByid(id int32) (results *cfg.GameGuildBo
return 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) { func (this *MCompConfigure) getguildbossscore(group int32, harm int32) (results *cfg.GameGuildBossScoreData, err error) {
var ( var (

View File

@ -61,6 +61,7 @@ func (this *ModelUniongve) getUnionGve(unionid string) (results *pb.DBUnionGve,
Currstage: 0, Currstage: 0,
Rtime: confs.Rtime, Rtime: confs.Rtime,
Boos: make([]*pb.DBUnionGveBoss, 0), Boos: make([]*pb.DBUnionGveBoss, 0),
Roulette: make([]*pb.DBGveRouletteRecord, 0),
} }
for _, v := range confs.Boos { for _, v := range confs.Boos {
if conf, err = this.module.configure.getguildbossByid(v); err != nil { 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, "currstage": data.Currstage,
"rtime": data.Rtime, "rtime": data.Rtime,
"boos": data.Boos, "boos": data.Boos,
"roulette": data.Roulette,
}); err != nil { }); err != nil {
this.module.Error("更新用户任务数据 错误!", log.Field{Key: "err", Value: err.Error()}) this.module.Error("更新用户任务数据 错误!", log.Field{Key: "err", Value: err.Error()})
return return
@ -203,4 +205,15 @@ func (this *ModelUniongve) booskill(unionid string, boosid int32, info *pb.DBUni
} }
defer lock.Unlock() 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)
}
} }

View File

@ -90,12 +90,13 @@ type DBUnionGve struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` //工会id Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` //工会id
Notice string `protobuf:"bytes,2,opt,name=notice,proto3" json:"notice"` //公告 Notice string `protobuf:"bytes,2,opt,name=notice,proto3" json:"notice"` //公告
Fire int32 `protobuf:"varint,3,opt,name=fire,proto3" json:"fire"` //火力 Fire int32 `protobuf:"varint,3,opt,name=fire,proto3" json:"fire"` //火力
Currstage int32 `protobuf:"varint,4,opt,name=currstage,proto3" json:"currstage"` //当前第几阶段 Currstage int32 `protobuf:"varint,4,opt,name=currstage,proto3" json:"currstage"` //当前第几阶段
Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` //刷新时间 Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` //刷新时间
Boos []*DBUnionGveBoss `protobuf:"bytes,6,rep,name=boos,proto3" json:"boos"` //boos列表 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() { func (x *DBUnionGve) Reset() {
@ -172,6 +173,13 @@ func (x *DBUnionGve) GetBoos() []*DBUnionGveBoss {
return nil return nil
} }
func (x *DBUnionGve) GetRoulette() []*DBGveRouletteRecord {
if x != nil {
return x.Roulette
}
return nil
}
//工会boos //工会boos
type DBUnionGveBoss struct { type DBUnionGveBoss struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -292,6 +300,61 @@ func (x *DBGveRecord) GetFormation() []string {
return nil 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 protoreflect.FileDescriptor
var file_uniongve_uniongve_db_proto_rawDesc = []byte{ 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x12, 0x30, 0x0a, 0x08,
0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x12, 0x16, 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14,
0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65,
0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, 0x20, 0x01, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x08, 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x22, 0x5e,
0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x0a, 0x0e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x3d, 0x0a, 0x0b, 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02,
0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65,
0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x3d,
0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x0a, 0x0b, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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 ( var (
@ -338,21 +408,23 @@ func file_uniongve_uniongve_db_proto_rawDescGZIP() []byte {
return file_uniongve_uniongve_db_proto_rawDescData 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{}{ var file_uniongve_uniongve_db_proto_goTypes = []interface{}{
(*DBUnionGveBossConf)(nil), // 0: DBUnionGveBossConf (*DBUnionGveBossConf)(nil), // 0: DBUnionGveBossConf
(*DBUnionGve)(nil), // 1: DBUnionGve (*DBUnionGve)(nil), // 1: DBUnionGve
(*DBUnionGveBoss)(nil), // 2: DBUnionGveBoss (*DBUnionGveBoss)(nil), // 2: DBUnionGveBoss
(*DBGveRecord)(nil), // 3: DBGveRecord (*DBGveRecord)(nil), // 3: DBGveRecord
(*DBGveRouletteRecord)(nil), // 4: DBGveRouletteRecord
} }
var file_uniongve_uniongve_db_proto_depIdxs = []int32{ var file_uniongve_uniongve_db_proto_depIdxs = []int32{
2, // 0: DBUnionGve.boos:type_name -> DBUnionGveBoss 2, // 0: DBUnionGve.boos:type_name -> DBUnionGveBoss
3, // 1: DBUnionGveBoss.record:type_name -> DBGveRecord 4, // 1: DBUnionGve.roulette:type_name -> DBGveRouletteRecord
2, // [2:2] is the sub-list for method output_type 3, // 2: DBUnionGveBoss.record:type_name -> DBGveRecord
2, // [2:2] is the sub-list for method input_type 3, // [3:3] is the sub-list for method output_type
2, // [2:2] is the sub-list for extension type_name 3, // [3:3] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension extendee 3, // [3:3] is the sub-list for extension type_name
0, // [0:2] is the sub-list for field 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() } func init() { file_uniongve_uniongve_db_proto_init() }
@ -409,6 +481,18 @@ func file_uniongve_uniongve_db_proto_init() {
return nil 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{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -416,7 +500,7 @@ func file_uniongve_uniongve_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_uniongve_uniongve_db_proto_rawDesc, RawDescriptor: file_uniongve_uniongve_db_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 4, NumMessages: 5,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },