活动测试数据

This commit is contained in:
meixiongfeng 2023-06-20 19:57:04 +08:00
parent 5c4af0cc68
commit cb34105c7a
12 changed files with 1047 additions and 126 deletions

197
bin/json/game_drawpool.json Normal file
View File

@ -0,0 +1,197 @@
[
{
"key": 1,
"recruitment_type": [
{
"k": 3,
"s": "base_pool1"
},
{
"k": 6,
"s": "base_pool1"
},
{
"k": 9,
"s": "base_pool1"
}
],
"star3w": 900,
"star4w": 94,
"star5w": 6,
"protect": 0,
"p3pool": "base_pool7",
"p4pool": "base_pool8",
"p5pool": "base_pool9",
"n3pool": "base_pool10",
"n4pool": "base_pool11",
"n5pool": "base_pool12",
"b4": 10,
"b6": 90,
"etime": -1,
"permission": 1,
"consumeA": [
{
"a": "item",
"t": "10000001",
"n": 1
}
],
"consumeB": []
},
{
"key": 2,
"recruitment_type": [
{
"k": 3,
"s": "base_pool1"
},
{
"k": 6,
"s": "base_pool1"
},
{
"k": 9,
"s": "base_pool1"
}
],
"star3w": 900,
"star4w": 94,
"star5w": 6,
"protect": 50,
"p3pool": "base_pool7",
"p4pool": "base_pool8",
"p5pool": "base_pool9",
"n3pool": "base_pool10",
"n4pool": "base_pool11",
"n5pool": "base_pool12",
"b4": 10,
"b6": 0,
"etime": -1,
"permission": 1,
"consumeA": [
{
"a": "item",
"t": "10000001",
"n": 2
}
],
"consumeB": []
},
{
"key": 3,
"recruitment_type": [
{
"k": 3,
"s": "base_pool1"
},
{
"k": 6,
"s": "base_pool1"
},
{
"k": 9,
"s": "base_pool1"
}
],
"star3w": 900,
"star4w": 94,
"star5w": 6,
"protect": 50,
"p3pool": "base_pool7",
"p4pool": "base_pool8",
"p5pool": "base_pool9",
"n3pool": "base_pool10",
"n4pool": "base_pool11",
"n5pool": "base_pool12",
"b4": 10,
"b6": 0,
"etime": -1,
"permission": 1,
"consumeA": [
{
"a": "item",
"t": "10000001",
"n": 3
}
],
"consumeB": []
},
{
"key": 4,
"recruitment_type": [
{
"k": 3,
"s": "base_pool1"
},
{
"k": 6,
"s": "base_pool1"
},
{
"k": 9,
"s": "base_pool1"
}
],
"star3w": 900,
"star4w": 94,
"star5w": 6,
"protect": 50,
"p3pool": "base_pool7",
"p4pool": "base_pool8",
"p5pool": "base_pool9",
"n3pool": "base_pool10",
"n4pool": "base_pool11",
"n5pool": "base_pool12",
"b4": 10,
"b6": 0,
"etime": -1,
"permission": 1,
"consumeA": [
{
"a": "item",
"t": "10000001",
"n": 4
}
],
"consumeB": []
},
{
"key": 5,
"recruitment_type": [
{
"k": 3,
"s": "base_pool1"
},
{
"k": 6,
"s": "base_pool1"
},
{
"k": 9,
"s": "base_pool1"
}
],
"star3w": 900,
"star4w": 94,
"star5w": 6,
"protect": 50,
"p3pool": "base_pool7",
"p4pool": "base_pool8",
"p5pool": "base_pool9",
"n3pool": "base_pool10",
"n4pool": "base_pool11",
"n5pool": "base_pool12",
"b4": 10,
"b6": 0,
"etime": -1,
"permission": 1,
"consumeA": [
{
"a": "item",
"t": "10000001",
"n": 5
}
],
"consumeB": []
}
]

View File

@ -0,0 +1,362 @@
[
{
"key": 1,
"weight": 0
},
{
"key": 2,
"weight": 0
},
{
"key": 3,
"weight": 0
},
{
"key": 4,
"weight": 0
},
{
"key": 5,
"weight": 0
},
{
"key": 6,
"weight": 0
},
{
"key": 7,
"weight": 0
},
{
"key": 8,
"weight": 0
},
{
"key": 9,
"weight": 0
},
{
"key": 10,
"weight": 0
},
{
"key": 11,
"weight": 0
},
{
"key": 12,
"weight": 0
},
{
"key": 13,
"weight": 0
},
{
"key": 14,
"weight": 0
},
{
"key": 15,
"weight": 0
},
{
"key": 16,
"weight": 0
},
{
"key": 17,
"weight": 0
},
{
"key": 18,
"weight": 0
},
{
"key": 19,
"weight": 0
},
{
"key": 20,
"weight": 0
},
{
"key": 21,
"weight": 0
},
{
"key": 22,
"weight": 0
},
{
"key": 23,
"weight": 0
},
{
"key": 24,
"weight": 0
},
{
"key": 25,
"weight": 0
},
{
"key": 26,
"weight": 0
},
{
"key": 27,
"weight": 0
},
{
"key": 28,
"weight": 0
},
{
"key": 29,
"weight": 0
},
{
"key": 30,
"weight": 0
},
{
"key": 31,
"weight": 0
},
{
"key": 32,
"weight": 0
},
{
"key": 33,
"weight": 0
},
{
"key": 34,
"weight": 0
},
{
"key": 35,
"weight": 0
},
{
"key": 36,
"weight": 0
},
{
"key": 37,
"weight": 0
},
{
"key": 38,
"weight": 0
},
{
"key": 39,
"weight": 0
},
{
"key": 40,
"weight": 0
},
{
"key": 41,
"weight": 0
},
{
"key": 42,
"weight": 0
},
{
"key": 43,
"weight": 0
},
{
"key": 44,
"weight": 0
},
{
"key": 45,
"weight": 0
},
{
"key": 46,
"weight": 0
},
{
"key": 47,
"weight": 0
},
{
"key": 48,
"weight": 0
},
{
"key": 49,
"weight": 0
},
{
"key": 50,
"weight": 0
},
{
"key": 51,
"weight": 0
},
{
"key": 52,
"weight": 0
},
{
"key": 53,
"weight": 0
},
{
"key": 54,
"weight": 0
},
{
"key": 55,
"weight": 0
},
{
"key": 56,
"weight": 0
},
{
"key": 57,
"weight": 0
},
{
"key": 58,
"weight": 0
},
{
"key": 59,
"weight": 0
},
{
"key": 60,
"weight": 0
},
{
"key": 61,
"weight": 10
},
{
"key": 62,
"weight": 20
},
{
"key": 63,
"weight": 30
},
{
"key": 64,
"weight": 40
},
{
"key": 65,
"weight": 50
},
{
"key": 66,
"weight": 60
},
{
"key": 67,
"weight": 70
},
{
"key": 68,
"weight": 80
},
{
"key": 69,
"weight": 90
},
{
"key": 70,
"weight": 100
},
{
"key": 71,
"weight": 110
},
{
"key": 72,
"weight": 120
},
{
"key": 73,
"weight": 130
},
{
"key": 74,
"weight": 140
},
{
"key": 75,
"weight": 150
},
{
"key": 76,
"weight": 160
},
{
"key": 77,
"weight": 170
},
{
"key": 78,
"weight": 180
},
{
"key": 79,
"weight": 190
},
{
"key": 80,
"weight": 200
},
{
"key": 81,
"weight": 210
},
{
"key": 82,
"weight": 220
},
{
"key": 83,
"weight": 230
},
{
"key": 84,
"weight": 240
},
{
"key": 85,
"weight": 250
},
{
"key": 86,
"weight": 260
},
{
"key": 87,
"weight": 270
},
{
"key": 88,
"weight": 280
},
{
"key": 89,
"weight": 290
},
{
"key": 90,
"weight": 300
}
]

View File

@ -33,3 +33,9 @@ func (this *modelHdList) getHdList(uid string) (result []*pb.DBHuodong, err erro
func (this *modelHdList) modifyHdList(uid string, data map[string]interface{}) error {
return this.Change(uid, data)
}
func (this *modelHdList) addHdList(hd *pb.DBHuodong) error {
if _, err := this.DB.InsertOne(core.SqlTable("hdinfo"), hd); err != nil {
return err
}
return nil
}

View File

@ -1,9 +1,13 @@
package activity
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Activity struct {
@ -26,6 +30,17 @@ func (this *Activity) GetType() core.M_Modules {
func (this *Activity) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
this.service = service
// ticker := time.NewTicker(time.Second * 10)
// go func() {
// for {
// select {
// case <-ticker.C:
// this.CreateHdData()
// return
// }
// }
// }()
return
}
@ -37,7 +52,46 @@ func (this *Activity) OnInstallComp() {
this.modelhdList = this.RegisterComp(new(modelHdList)).(*modelHdList)
}
func (this *Activity) CheckActivateActivityCollect(uid string, id string) (err error) {
// 创建一条活动数据
func (this *Activity) CreateHdData() (err error) {
var db *pb.DBHuodong
db = &pb.DBHuodong{
Id: primitive.NewObjectID().Hex(),
Hdid: 10001,
Rtime: 1680105599,
Itype: 0,
Name: "累计充值活动",
Img: "",
Showtime: "03月15日00:00-03月20日23:59",
PressImg: "huodong_btn4_1.png",
Intr: "累计充值,限时福利",
Etime: 1680105599,
NormalImg: "huodong_btn4.png",
Stime: 1679414400,
Tab: 2,
Ttype: 0,
Icon: "ico_event_yxjl",
Open: 1,
Order: 102,
Stype: 10009,
Htype: 9,
Data: &pb.ActivityInfo{},
}
for i := 0; i < 6; i++ {
var p []*pb.UserAssets
p = append(p, &pb.UserAssets{
A: "item",
T: "10000001",
N: 1,
})
db.Data.Prize = append(db.Data.Prize, &pb.Arr{
Prize: p,
Val: int32(i) + 1,
})
}
this.modelhdList.addHdList(db)
fmt.Printf("%v", db)
return
}

View File

@ -25,8 +25,8 @@ type Arr struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
P []*UserAssets `protobuf:"bytes,1,rep,name=p,proto3" json:"p"` // 奖励数据
Val int32 `protobuf:"varint,2,opt,name=val,proto3" json:"val"`
Prize []*UserAssets `protobuf:"bytes,1,rep,name=prize,proto3" json:"prize"` // 奖励数据
Val int32 `protobuf:"varint,2,opt,name=val,proto3" json:"val"`
}
func (x *Arr) Reset() {
@ -61,9 +61,9 @@ func (*Arr) Descriptor() ([]byte, []int) {
return file_activity_activity_db_proto_rawDescGZIP(), []int{0}
}
func (x *Arr) GetP() []*UserAssets {
func (x *Arr) GetPrize() []*UserAssets {
if x != nil {
return x.P
return x.Prize
}
return nil
}
@ -80,9 +80,7 @@ type ActivityInfo struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Arr []*Arr `protobuf:"bytes,1,rep,name=arr,proto3" json:"arr"`
Btn string `protobuf:"bytes,2,opt,name=btn,proto3" json:"btn"` // 领取
Show string `protobuf:"bytes,3,opt,name=show,proto3" json:"show"` // 累计充值{1}天
Prize []*Arr `protobuf:"bytes,1,rep,name=prize,proto3" json:"prize"`
}
func (x *ActivityInfo) Reset() {
@ -117,48 +115,38 @@ func (*ActivityInfo) Descriptor() ([]byte, []int) {
return file_activity_activity_db_proto_rawDescGZIP(), []int{1}
}
func (x *ActivityInfo) GetArr() []*Arr {
func (x *ActivityInfo) GetPrize() []*Arr {
if x != nil {
return x.Arr
return x.Prize
}
return nil
}
func (x *ActivityInfo) GetBtn() string {
if x != nil {
return x.Btn
}
return ""
}
func (x *ActivityInfo) GetShow() string {
if x != nil {
return x.Show
}
return ""
}
type DBHuodong struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Hdid int32 `protobuf:"varint,2,opt,name=hdid,proto3" json:"hdid"` // 活动ID
Showtime string `protobuf:"bytes,3,opt,name=showtime,proto3" json:"showtime"` // 客户端显示的时间
Stime int64 `protobuf:"varint,4,opt,name=stime,proto3" json:"stime"` // 开始时间
Etime int64 `protobuf:"varint,5,opt,name=etime,proto3" json:"etime"` // 结束时间
Rtime int64 `protobuf:"varint,6,opt,name=rtime,proto3" json:"rtime"` // 刷新时间
Ttype int32 `protobuf:"varint,7,opt,name=ttype,proto3" json:"ttype"`
Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name"` // 活动名称
Htype int32 `protobuf:"varint,9,opt,name=htype,proto3" json:"htype"` // 活动类型 自定义
Stype int32 `protobuf:"varint,10,opt,name=stype,proto3" json:"stype"`
Itype int32 `protobuf:"varint,11,opt,name=itype,proto3" json:"itype"`
Intr string `protobuf:"bytes,12,opt,name=intr,proto3" json:"intr"` // 活动说明
Img string `protobuf:"bytes,13,opt,name=img,proto3" json:"img"` //
Icon string `protobuf:"bytes,14,opt,name=icon,proto3" json:"icon"`
Showtype int32 `protobuf:"varint,15,opt,name=showtype,proto3" json:"showtype"` // 显示类型
Data *ActivityInfo `protobuf:"bytes,16,opt,name=data,proto3" json:"data"` // 活动详细数据
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Hdid int32 `protobuf:"varint,2,opt,name=hdid,proto3" json:"hdid"` // 活动ID
Rtime int64 `protobuf:"varint,3,opt,name=rtime,proto3" json:"rtime"` // 客户端显示的时间
Itype int32 `protobuf:"varint,4,opt,name=itype,proto3" json:"itype"`
Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name"`
Img string `protobuf:"bytes,6,opt,name=img,proto3" json:"img"`
Showtime string `protobuf:"bytes,7,opt,name=showtime,proto3" json:"showtime"`
PressImg string `protobuf:"bytes,8,opt,name=pressImg,proto3" json:"pressImg"`
Intr string `protobuf:"bytes,9,opt,name=intr,proto3" json:"intr"` // "累计充值,限时福利",
Etime int64 `protobuf:"varint,10,opt,name=etime,proto3" json:"etime"` // 1680105599,
NormalImg string `protobuf:"bytes,11,opt,name=normalImg,proto3" json:"normalImg"` // "huodong_btn4.png",
Stime int64 `protobuf:"varint,12,opt,name=stime,proto3" json:"stime"` // 1679414400,
Tab int32 `protobuf:"varint,13,opt,name=tab,proto3" json:"tab"`
Ttype int32 `protobuf:"varint,14,opt,name=ttype,proto3" json:"ttype"`
Icon string `protobuf:"bytes,15,opt,name=icon,proto3" json:"icon"` //"ico_event_yxjl",
Open int32 `protobuf:"varint,16,opt,name=open,proto3" json:"open"`
Order int32 `protobuf:"varint,17,opt,name=order,proto3" json:"order"`
Stype int32 `protobuf:"varint,18,opt,name=stype,proto3" json:"stype"`
Htype int32 `protobuf:"varint,19,opt,name=htype,proto3" json:"htype"`
Data *ActivityInfo `protobuf:"bytes,20,opt,name=data,proto3" json:"data"` // 活动详细数据
}
func (x *DBHuodong) Reset() {
@ -207,27 +195,6 @@ func (x *DBHuodong) GetHdid() int32 {
return 0
}
func (x *DBHuodong) GetShowtime() string {
if x != nil {
return x.Showtime
}
return ""
}
func (x *DBHuodong) GetStime() int64 {
if x != nil {
return x.Stime
}
return 0
}
func (x *DBHuodong) GetEtime() int64 {
if x != nil {
return x.Etime
}
return 0
}
func (x *DBHuodong) GetRtime() int64 {
if x != nil {
return x.Rtime
@ -235,34 +202,6 @@ func (x *DBHuodong) GetRtime() int64 {
return 0
}
func (x *DBHuodong) GetTtype() int32 {
if x != nil {
return x.Ttype
}
return 0
}
func (x *DBHuodong) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *DBHuodong) GetHtype() int32 {
if x != nil {
return x.Htype
}
return 0
}
func (x *DBHuodong) GetStype() int32 {
if x != nil {
return x.Stype
}
return 0
}
func (x *DBHuodong) GetItype() int32 {
if x != nil {
return x.Itype
@ -270,9 +209,9 @@ func (x *DBHuodong) GetItype() int32 {
return 0
}
func (x *DBHuodong) GetIntr() string {
func (x *DBHuodong) GetName() string {
if x != nil {
return x.Intr
return x.Name
}
return ""
}
@ -284,6 +223,62 @@ func (x *DBHuodong) GetImg() string {
return ""
}
func (x *DBHuodong) GetShowtime() string {
if x != nil {
return x.Showtime
}
return ""
}
func (x *DBHuodong) GetPressImg() string {
if x != nil {
return x.PressImg
}
return ""
}
func (x *DBHuodong) GetIntr() string {
if x != nil {
return x.Intr
}
return ""
}
func (x *DBHuodong) GetEtime() int64 {
if x != nil {
return x.Etime
}
return 0
}
func (x *DBHuodong) GetNormalImg() string {
if x != nil {
return x.NormalImg
}
return ""
}
func (x *DBHuodong) GetStime() int64 {
if x != nil {
return x.Stime
}
return 0
}
func (x *DBHuodong) GetTab() int32 {
if x != nil {
return x.Tab
}
return 0
}
func (x *DBHuodong) GetTtype() int32 {
if x != nil {
return x.Ttype
}
return 0
}
func (x *DBHuodong) GetIcon() string {
if x != nil {
return x.Icon
@ -291,9 +286,30 @@ func (x *DBHuodong) GetIcon() string {
return ""
}
func (x *DBHuodong) GetShowtype() int32 {
func (x *DBHuodong) GetOpen() int32 {
if x != nil {
return x.Showtype
return x.Open
}
return 0
}
func (x *DBHuodong) GetOrder() int32 {
if x != nil {
return x.Order
}
return 0
}
func (x *DBHuodong) GetStype() int32 {
if x != nil {
return x.Stype
}
return 0
}
func (x *DBHuodong) GetHtype() int32 {
if x != nil {
return x.Htype
}
return 0
}
@ -398,37 +414,41 @@ var File_activity_activity_db_proto protoreflect.FileDescriptor
var file_activity_activity_db_proto_rawDesc = []byte{
0x0a, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76,
0x69, 0x74, 0x79, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f,
0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x32, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x12,
0x19, 0x0a, 0x01, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x01, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61,
0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x4c, 0x0a, 0x0c,
0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x03,
0x61, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x41, 0x72, 0x72, 0x52,
0x03, 0x61, 0x72, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x74, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x62, 0x74, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x68, 0x6f, 0x77, 0x22, 0xf2, 0x02, 0x0a, 0x09, 0x44,
0x42, 0x48, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x64, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x64, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08,
0x73, 0x68, 0x6f, 0x77, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x73, 0x68, 0x6f, 0x77, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65,
0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20,
0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x74,
0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x74, 0x79, 0x70, 0x65,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74,
0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65,
0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x74, 0x72, 0x18, 0x0c,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x74, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x6d,
0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04,
0x69, 0x63, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e,
0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0f, 0x20, 0x01,
0x28, 0x05, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x04,
0x64, 0x61, 0x74, 0x61, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74,
0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x12,
0x21, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x70, 0x72, 0x69,
0x7a, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x76, 0x61, 0x6c, 0x22, 0x2a, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x41, 0x72, 0x72, 0x52, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65,
0x22, 0xcc, 0x03, 0x0a, 0x09, 0x44, 0x42, 0x48, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x68, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x64,
0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x69, 0x6d, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x74, 0x69, 0x6d, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6d, 0x67, 0x18, 0x08, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04,
0x69, 0x6e, 0x74, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x74, 0x72,
0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52,
0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c,
0x49, 0x6d, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x72, 0x6d, 0x61,
0x6c, 0x49, 0x6d, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20,
0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61,
0x62, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61, 0x62, 0x12, 0x14, 0x0a, 0x05,
0x74, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x74, 0x79,
0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x10,
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x18,
0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x04,
0x64, 0x61, 0x74, 0x61, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74,
0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
0x8a, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61,
0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
@ -463,8 +483,8 @@ var file_activity_activity_db_proto_goTypes = []interface{}{
(*UserAssets)(nil), // 4: UserAssets
}
var file_activity_activity_db_proto_depIdxs = []int32{
4, // 0: Arr.p:type_name -> UserAssets
0, // 1: ActivityInfo.arr:type_name -> Arr
4, // 0: Arr.prize:type_name -> UserAssets
0, // 1: ActivityInfo.prize:type_name -> Arr
1, // 2: DBHuodong.data:type_name -> ActivityInfo
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type

View File

@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"go_dreamfactory/modules/academy"
"go_dreamfactory/modules/activity"
"go_dreamfactory/modules/arena"
"go_dreamfactory/modules/atlas"
"go_dreamfactory/modules/battle"
@ -122,6 +123,7 @@ func main() {
oldtimes.NewModule(),
caravan.NewModule(),
buried.NewModule(),
activity.NewModule(),
)
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameDrawPool struct {
_dataMap map[int32]*GameDrawPoolData
_dataList []*GameDrawPoolData
}
func NewGameDrawPool(_buf []map[string]interface{}) (*GameDrawPool, error) {
_dataList := make([]*GameDrawPoolData, 0, len(_buf))
dataMap := make(map[int32]*GameDrawPoolData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameDrawPoolData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Key] = _v
}
}
return &GameDrawPool{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameDrawPool) GetDataMap() map[int32]*GameDrawPoolData {
return table._dataMap
}
func (table *GameDrawPool) GetDataList() []*GameDrawPoolData {
return table._dataList
}
func (table *GameDrawPool) Get(key int32) *GameDrawPoolData {
return table._dataMap[key]
}

View File

@ -0,0 +1,108 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameDrawPoolData struct {
Key int32
RecruitmentType []*Gameks
Star3w int32
Star4w int32
Star5w int32
Protect int32
P3pool string
P4pool string
P5pool string
N3pool string
N4pool string
N5pool string
B4 int32
B6 int32
Etime int32
Permission int32
ConsumeA []*Gameatn
ConsumeB []*Gameatn
}
const TypeId_GameDrawPoolData = 271747014
func (*GameDrawPoolData) GetTypeId() int32 {
return 271747014
}
func (_v *GameDrawPoolData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["recruitment_type"].([]interface{}); !_ok_ { err = errors.New("recruitment_type error"); return }
_v.RecruitmentType = make([]*Gameks, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameks
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameks(_x_); err != nil { return } }
_v.RecruitmentType = append(_v.RecruitmentType, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star3w"].(float64); !_ok_ { err = errors.New("star3w error"); return }; _v.Star3w = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star4w"].(float64); !_ok_ { err = errors.New("star4w error"); return }; _v.Star4w = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star5w"].(float64); !_ok_ { err = errors.New("star5w error"); return }; _v.Star5w = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["protect"].(float64); !_ok_ { err = errors.New("protect error"); return }; _v.Protect = int32(_tempNum_) }
{ var _ok_ bool; if _v.P3pool, _ok_ = _buf["p3pool"].(string); !_ok_ { err = errors.New("p3pool error"); return } }
{ var _ok_ bool; if _v.P4pool, _ok_ = _buf["p4pool"].(string); !_ok_ { err = errors.New("p4pool error"); return } }
{ var _ok_ bool; if _v.P5pool, _ok_ = _buf["p5pool"].(string); !_ok_ { err = errors.New("p5pool error"); return } }
{ var _ok_ bool; if _v.N3pool, _ok_ = _buf["n3pool"].(string); !_ok_ { err = errors.New("n3pool error"); return } }
{ var _ok_ bool; if _v.N4pool, _ok_ = _buf["n4pool"].(string); !_ok_ { err = errors.New("n4pool error"); return } }
{ var _ok_ bool; if _v.N5pool, _ok_ = _buf["n5pool"].(string); !_ok_ { err = errors.New("n5pool error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["b4"].(float64); !_ok_ { err = errors.New("b4 error"); return }; _v.B4 = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["b6"].(float64); !_ok_ { err = errors.New("b6 error"); return }; _v.B6 = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["etime"].(float64); !_ok_ { err = errors.New("etime error"); return }; _v.Etime = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["permission"].(float64); !_ok_ { err = errors.New("permission error"); return }; _v.Permission = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["consumeA"].([]interface{}); !_ok_ { err = errors.New("consumeA error"); return }
_v.ConsumeA = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.ConsumeA = append(_v.ConsumeA, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["consumeB"].([]interface{}); !_ok_ { err = errors.New("consumeB error"); return }
_v.ConsumeB = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.ConsumeB = append(_v.ConsumeB, _list_v_)
}
}
return
}
func DeserializeGameDrawPoolData(_buf map[string]interface{}) (*GameDrawPoolData, error) {
v := &GameDrawPoolData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameDrawWeigth struct {
_dataMap map[int32]*GameDrawWeigthData
_dataList []*GameDrawWeigthData
}
func NewGameDrawWeigth(_buf []map[string]interface{}) (*GameDrawWeigth, error) {
_dataList := make([]*GameDrawWeigthData, 0, len(_buf))
dataMap := make(map[int32]*GameDrawWeigthData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameDrawWeigthData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Key] = _v
}
}
return &GameDrawWeigth{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameDrawWeigth) GetDataMap() map[int32]*GameDrawWeigthData {
return table._dataMap
}
func (table *GameDrawWeigth) GetDataList() []*GameDrawWeigthData {
return table._dataList
}
func (table *GameDrawWeigth) Get(key int32) *GameDrawWeigthData {
return table._dataMap[key]
}

View File

@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameDrawWeigthData struct {
Key int32
Weight int32
}
const TypeId_GameDrawWeigthData = -1955284598
func (*GameDrawWeigthData) GetTypeId() int32 {
return -1955284598
}
func (_v *GameDrawWeigthData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weight"].(float64); !_ok_ { err = errors.New("weight error"); return }; _v.Weight = int32(_tempNum_) }
return
}
func DeserializeGameDrawWeigthData(_buf map[string]interface{}) (*GameDrawWeigthData, error) {
v := &GameDrawWeigthData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type Gameks struct {
K int32
S string
}
const TypeId_Gameks = 1468999876
func (*Gameks) GetTypeId() int32 {
return 1468999876
}
func (_v *Gameks)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["k"].(float64); !_ok_ { err = errors.New("k error"); return }; _v.K = int32(_tempNum_) }
{ var _ok_ bool; if _v.S, _ok_ = _buf["s"].(string); !_ok_ { err = errors.New("s error"); return } }
return
}
func DeserializeGameks(_buf map[string]interface{}) (*Gameks, error) {
v := &Gameks{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -182,6 +182,8 @@ type Tables struct {
BuriedType *GameBuriedType
PhotoAction *GamePhotoAction
PhotoFilter *GamePhotoFilter
DrawPool *GameDrawPool
DrawWeigth *GameDrawWeigth
}
func NewTables(loader JsonLoader) (*Tables, error) {
@ -1215,5 +1217,17 @@ func NewTables(loader JsonLoader) (*Tables, error) {
if tables.PhotoFilter, err = NewGamePhotoFilter(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_drawpool") ; err != nil {
return nil, err
}
if tables.DrawPool, err = NewGameDrawPool(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_drawweigth") ; err != nil {
return nil, err
}
if tables.DrawWeigth, err = NewGameDrawWeigth(buf) ; err != nil {
return nil, err
}
return tables, nil
}