update
This commit is contained in:
parent
3cc286864b
commit
2cb0595452
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 50
|
||||
}
|
||||
},
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"drawkey": 2,
|
||||
@ -27,7 +28,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 50
|
||||
}
|
||||
},
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"drawkey": 3,
|
||||
@ -42,7 +44,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 50
|
||||
}
|
||||
},
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"drawkey": 4,
|
||||
@ -57,7 +60,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 100
|
||||
}
|
||||
},
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"drawkey": 5,
|
||||
@ -72,7 +76,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 100
|
||||
}
|
||||
},
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"drawkey": 6,
|
||||
@ -87,7 +92,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 100
|
||||
}
|
||||
},
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"drawkey": 7,
|
||||
@ -102,7 +108,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 150
|
||||
}
|
||||
},
|
||||
"type": 2
|
||||
},
|
||||
{
|
||||
"drawkey": 8,
|
||||
@ -117,7 +124,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 150
|
||||
}
|
||||
},
|
||||
"type": 2
|
||||
},
|
||||
{
|
||||
"drawkey": 9,
|
||||
@ -132,7 +140,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 150
|
||||
}
|
||||
},
|
||||
"type": 2
|
||||
},
|
||||
{
|
||||
"drawkey": 10,
|
||||
@ -147,7 +156,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 200
|
||||
}
|
||||
},
|
||||
"type": 2
|
||||
},
|
||||
{
|
||||
"drawkey": 11,
|
||||
@ -162,7 +172,8 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 200
|
||||
}
|
||||
},
|
||||
"type": 2
|
||||
},
|
||||
{
|
||||
"drawkey": 12,
|
||||
@ -177,6 +188,7 @@
|
||||
"a": "item",
|
||||
"t": "23000001",
|
||||
"n": 200
|
||||
}
|
||||
},
|
||||
"type": 2
|
||||
}
|
||||
]
|
@ -5533,7 +5533,7 @@
|
||||
"lock": 1,
|
||||
"lockend": 999,
|
||||
"ontxe": 300010,
|
||||
"id_after": 0,
|
||||
"id_after": 300030,
|
||||
"group": 301,
|
||||
"exgroup": 310,
|
||||
"des": 3,
|
||||
@ -5787,7 +5787,7 @@
|
||||
"lock": 1,
|
||||
"lockend": 999,
|
||||
"ontxe": 300061,
|
||||
"id_after": 0,
|
||||
"id_after": 300070,
|
||||
"group": 301,
|
||||
"exgroup": 310,
|
||||
"des": 3,
|
||||
@ -5827,7 +5827,7 @@
|
||||
"lock": 1,
|
||||
"lockend": 999,
|
||||
"ontxe": 300062,
|
||||
"id_after": 0,
|
||||
"id_after": 300080,
|
||||
"group": 301,
|
||||
"exgroup": 310,
|
||||
"des": 3,
|
||||
|
@ -69,7 +69,7 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.ActivityGetRew
|
||||
}
|
||||
}
|
||||
}
|
||||
data.Gotarr[req.Val] = true
|
||||
data.Gotarr[req.Val] = 1
|
||||
update := make(map[string]interface{})
|
||||
update["gotarr"] = data.Gotarr
|
||||
this.module.modelhdData.ModifyActivityList(session.GetUserId(), data.Id, update)
|
||||
|
@ -1,23 +1,60 @@
|
||||
package activity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const ()
|
||||
const (
|
||||
venturegiftsdraw = "game_venturegiftsdraw.json" //大转盘
|
||||
)
|
||||
|
||||
// /配置管理基础组件
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
module *Activity
|
||||
hlock sync.RWMutex
|
||||
pool1 map[int32]*cfg.GameVenturegiftsDrawData
|
||||
pool2 map[int32]*cfg.GameVenturegiftsDrawData
|
||||
}
|
||||
|
||||
// 组件初始化接口
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*Activity)
|
||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||
venturegiftsdraw: cfg.NewGameVenturegiftsDraw,
|
||||
})
|
||||
|
||||
configure.RegisterConfigure(venturegiftsdraw, cfg.NewGameVenturegiftsDraw, func() {
|
||||
var pool1 string
|
||||
if v, err := this.GetConfigure(venturegiftsdraw); err == nil {
|
||||
this.hlock.Lock()
|
||||
this.pool1 = make(map[int32]*cfg.GameVenturegiftsDrawData)
|
||||
this.pool2 = make(map[int32]*cfg.GameVenturegiftsDrawData)
|
||||
defer this.hlock.Unlock()
|
||||
if _configure, ok := v.(*cfg.GameVenturegiftsDraw); ok {
|
||||
for _, v := range _configure.GetDataList() {
|
||||
if pool1 == "" {
|
||||
pool1 = v.DrawType
|
||||
}
|
||||
if pool1 == v.DrawType {
|
||||
this.pool1[v.Drawkey] = v
|
||||
} else {
|
||||
this.pool2[v.Drawkey] = v
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
} else {
|
||||
err = fmt.Errorf("%T no is *cfg.GameHeroAwaken", v)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@ -37,3 +74,26 @@ func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err
|
||||
func (this *configureComp) GetConfigure(name string) (v interface{}, err error) {
|
||||
return configure.GetConfigure(name)
|
||||
}
|
||||
|
||||
// 获取抽奖数据
|
||||
func (this *configureComp) GetVenturegiftsDraw(id int32) (configure *cfg.GameVenturegiftsDrawData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(venturegiftsdraw); err == nil {
|
||||
if configure, ok = v.(*cfg.GameVenturegiftsDraw).GetDataMap()[id]; !ok {
|
||||
err = fmt.Errorf("%T no is *cfg.GameVenturegiftsDrawData", v)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) GetPool1() (m map[int32]*cfg.GameVenturegiftsDrawData) {
|
||||
return this.pool1
|
||||
}
|
||||
|
||||
func (this *configureComp) GetPool2() (m map[int32]*cfg.GameVenturegiftsDrawData) {
|
||||
return this.pool2
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/sys/db"
|
||||
)
|
||||
|
||||
@ -157,3 +158,26 @@ func (this *Activity) UpdateSingnActivitySlider(session comm.IUserSession) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 大转盘奖励
|
||||
func (this *Activity) Turntable(drawIndex int32, reward []int32) (item *cfg.Gameatn, err error) {
|
||||
var (
|
||||
conf *cfg.GameVenturegiftsDrawData
|
||||
)
|
||||
if conf, err = this.configure.GetVenturegiftsDraw(drawIndex); err != nil {
|
||||
return
|
||||
}
|
||||
// 过滤已经获得的道具
|
||||
if conf.Type == 1 { // 只取第一个卡池
|
||||
|
||||
for _, v := range this.configure.pool1 {
|
||||
for _, v1 := range reward {
|
||||
if v.Drawkey == v1 {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
item = conf.Id // 最终获得的道具
|
||||
return
|
||||
}
|
||||
|
@ -327,12 +327,12 @@ type DBActivityData struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
|
||||
Hdoid string `protobuf:"bytes,3,opt,name=hdoid,proto3" json:"hdoid"` // 活动唯一id
|
||||
Gotarr map[int32]bool `protobuf:"bytes,4,rep,name=gotarr,proto3" json:"gotarr" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
||||
Lasttime int64 `protobuf:"varint,5,opt,name=lasttime,proto3" json:"lasttime"`
|
||||
Val int32 `protobuf:"varint,6,opt,name=val,proto3" json:"val"` // 第几天登录
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
|
||||
Hdoid string `protobuf:"bytes,3,opt,name=hdoid,proto3" json:"hdoid"` // 活动唯一id
|
||||
Gotarr map[int32]int32 `protobuf:"bytes,4,rep,name=gotarr,proto3" json:"gotarr" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
||||
Lasttime int64 `protobuf:"varint,5,opt,name=lasttime,proto3" json:"lasttime"`
|
||||
Val int32 `protobuf:"varint,6,opt,name=val,proto3" json:"val"` // 第几天登录
|
||||
}
|
||||
|
||||
func (x *DBActivityData) Reset() {
|
||||
@ -388,7 +388,7 @@ func (x *DBActivityData) GetHdoid() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBActivityData) GetGotarr() map[int32]bool {
|
||||
func (x *DBActivityData) GetGotarr() map[int32]int32 {
|
||||
if x != nil {
|
||||
return x.Gotarr
|
||||
}
|
||||
@ -463,7 +463,7 @@ var file_activity_activity_db_proto_rawDesc = []byte{
|
||||
0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x1a, 0x39, 0x0a,
|
||||
0x0b, 0x47, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76,
|
||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
@ -91,4 +91,6 @@ const (
|
||||
GameBuffType_FIXED_DEF = 79
|
||||
GameBuffType_FIXED_DEF_PRO = 80
|
||||
GameBuffType_IMMDOT = 81
|
||||
GameBuffType_NO_BUFFEFFECT_ADD_DMG = 82
|
||||
GameBuffType_BE_CRIT_ADD_THIS_TIME_DMG = 83
|
||||
)
|
||||
|
@ -16,6 +16,7 @@ type GameVenturegiftsDrawData struct {
|
||||
Id *Gameatn
|
||||
Weight int32
|
||||
Cost *Gameatn
|
||||
Type int32
|
||||
}
|
||||
|
||||
const TypeId_GameVenturegiftsDrawData = -742747078
|
||||
@ -30,6 +31,7 @@ func (_v *GameVenturegiftsDrawData)Deserialize(_buf map[string]interface{}) (err
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["id"].(map[string]interface{}); !_ok_ { err = errors.New("id error"); return }; if _v.Id, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weight"].(float64); !_ok_ { err = errors.New("weight error"); return }; _v.Weight = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["cost"].(map[string]interface{}); !_ok_ { err = errors.New("cost error"); return }; if _v.Cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -217,7 +217,6 @@ type Tables struct {
|
||||
CompositeAll *GameCompositeAll
|
||||
StoneBoss *GameStoneBoss
|
||||
VenturegiftsTask *GameVenturegiftsTask
|
||||
VenturegiftsLottery *GameVenturegiftsLottery
|
||||
VenturegiftsDraw *GameVenturegiftsDraw
|
||||
VenturegiftsLogin *GameVenturegiftsLogin
|
||||
VenturegiftsLvaward *GameVenturegiftsLvaward
|
||||
@ -1466,12 +1465,6 @@ func NewTables(loader JsonLoader) (*Tables, error) {
|
||||
if tables.VenturegiftsTask, err = NewGameVenturegiftsTask(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_venturegiftslottery") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.VenturegiftsLottery, err = NewGameVenturegiftsLottery(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_venturegiftsdraw") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user