活动礼包
This commit is contained in:
parent
151a739dab
commit
05a54af2db
|
@ -156,10 +156,12 @@ func upJybUser(cjybuse, cjyb *mongo.Collection, snId, codeType int32, plt, useCo
|
||||||
if jybuser.JybInfos == nil {
|
if jybuser.JybInfos == nil {
|
||||||
jybuser.JybInfos = make(map[string]int32)
|
jybuser.JybInfos = make(map[string]int32)
|
||||||
} else if _, exist := jybuser.JybInfos[jybuseerid]; exist { // 该类型礼包玩家已经领取过
|
} else if _, exist := jybuser.JybInfos[jybuseerid]; exist { // 该类型礼包玩家已经领取过
|
||||||
return model.ErrJYBPlCode
|
if ret.CodeType != 3 {
|
||||||
|
return model.ErrJYBPlCode
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jybuser.JybInfos[jybuseerid] = 1
|
jybuser.JybInfos[jybuseerid]++
|
||||||
|
|
||||||
err = cjybuse.Update(bson.M{"_id": jybuser.JybUserId}, bson.D{{"$set", bson.D{{"jybinfos", jybuser.JybInfos}}}})
|
err = cjybuse.Update(bson.M{"_id": jybuser.JybUserId}, bson.D{{"$set", bson.D{{"jybinfos", jybuser.JybInfos}}}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -34,7 +34,7 @@ const (
|
||||||
|
|
||||||
type ShopInfo struct {
|
type ShopInfo struct {
|
||||||
Id int32 // 商品ID
|
Id int32 // 商品ID
|
||||||
Page int32 // 页面 1,金币页面 2,钻石页面 3,道具页面
|
Page int32 // 页面 1,金币页面 2,钻石页面 3,道具页面 4,房卡
|
||||||
Order int32 // 排序 页面内商品的位置排序
|
Order int32 // 排序 页面内商品的位置排序
|
||||||
Location []int32 // 显示位置 第1位,竖版大厅 第2位,Tienlen1级选场 第3位,捕鱼1级选场
|
Location []int32 // 显示位置 第1位,竖版大厅 第2位,Tienlen1级选场 第3位,捕鱼1级选场
|
||||||
Picture string // 图片id
|
Picture string // 图片id
|
||||||
|
@ -44,7 +44,7 @@ type ShopInfo struct {
|
||||||
AdTime int32 // 观看几次广告
|
AdTime int32 // 观看几次广告
|
||||||
RepeatTimes int32 // 领取次数
|
RepeatTimes int32 // 领取次数
|
||||||
CoolingTime []int32 // 观看冷却时间
|
CoolingTime []int32 // 观看冷却时间
|
||||||
Type int32 // 获得类型 1,金币 2,钻石 3,道具类型
|
Type int32 // 获得类型 1,金币 2,钻石 3,道具类型 4,房卡
|
||||||
Amount int64 // 获得数量
|
Amount int64 // 获得数量
|
||||||
AddArea []int32 // 加送百分比(比如加送10%,就配置110)
|
AddArea []int32 // 加送百分比(比如加送10%,就配置110)
|
||||||
ItemId int32 // 获得道具ID
|
ItemId int32 // 获得道具ID
|
||||||
|
|
|
@ -53,7 +53,7 @@ type JybInfo struct {
|
||||||
JybId bson.ObjectId `bson:"_id"` // 礼包ID
|
JybId bson.ObjectId `bson:"_id"` // 礼包ID
|
||||||
Platform string //平台
|
Platform string //平台
|
||||||
Name string // 礼包名称
|
Name string // 礼包名称
|
||||||
CodeType int32 // 礼包类型 1 通用 2 特殊
|
CodeType int32 // 礼包类型 1 通用 2专属(自动生成兑换码,每个玩家领一个) 3活动(自动生产兑换码,每个兑换码领一个)
|
||||||
StartTime int64 // 开始时间 Unix
|
StartTime int64 // 开始时间 Unix
|
||||||
EndTime int64 // 结束时间
|
EndTime int64 // 结束时间
|
||||||
Content string // 礼包内容
|
Content string // 礼包内容
|
||||||
|
|
|
@ -346,7 +346,7 @@ func (this *HundredSceneMgr) ModuleName() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) Init() {
|
func (this *HundredSceneMgr) Init() {
|
||||||
this.TryCreateRoom()
|
//this.TryCreateRoom()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) Update() {
|
func (this *HundredSceneMgr) Update() {
|
||||||
|
|
|
@ -63,6 +63,8 @@ const (
|
||||||
ShopTypeCoin = iota + 1 // 金币
|
ShopTypeCoin = iota + 1 // 金币
|
||||||
ShopTypeDiamond // 钻石
|
ShopTypeDiamond // 钻石
|
||||||
ShopTypeItem // 道具
|
ShopTypeItem // 道具
|
||||||
|
ShopTypeFangKa // 房卡
|
||||||
|
ShopTypeMax
|
||||||
)
|
)
|
||||||
|
|
||||||
// 兑换商品状态
|
// 兑换商品状态
|
||||||
|
@ -539,10 +541,10 @@ func (this *ShopMgr) shopAddItem(p *Player, shopInfo *model.ShopInfo, vipShopId
|
||||||
|
|
||||||
// createOrder 保存购买记录
|
// createOrder 保存购买记录
|
||||||
func (this *ShopMgr) createOrder(p *Player, shopInfo *model.ShopInfo, costNum int64, amount [3]int32) {
|
func (this *ShopMgr) createOrder(p *Player, shopInfo *model.ShopInfo, costNum int64, amount [3]int32) {
|
||||||
if shopInfo.Type < ShopTypeCoin && shopInfo.Type > ShopTypeItem {
|
//if shopInfo.Type < ShopTypeCoin && shopInfo.Type >= ShopTypeMax {
|
||||||
logger.Logger.Errorf("createOrder err: type = %v", shopInfo.Type)
|
// logger.Logger.Errorf("createOrder err: type = %v", shopInfo.Type)
|
||||||
return
|
// return
|
||||||
}
|
//}
|
||||||
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
dbShop := model.NewDbShop(p.Platform, shopInfo.Page, amount[:], "sys", 0, shopInfo.ConstType, int32(costNum),
|
dbShop := model.NewDbShop(p.Platform, shopInfo.Page, amount[:], "sys", 0, shopInfo.ConstType, int32(costNum),
|
||||||
|
@ -1228,17 +1230,15 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
|
||||||
amount[ShopTypeDiamond-1] = int32(addTotal)
|
amount[ShopTypeDiamond-1] = int32(addTotal)
|
||||||
var itemInfo []model.ItemInfo
|
var itemInfo []model.ItemInfo
|
||||||
var webItemInfo []*webapi_proto.ItemInfo
|
var webItemInfo []*webapi_proto.ItemInfo
|
||||||
if shopInfo.AddItemInfo != nil {
|
for _, info := range shopInfo.GetItems() {
|
||||||
for _, info := range shopInfo.AddItemInfo {
|
itemInfo = append(itemInfo, model.ItemInfo{
|
||||||
itemInfo = append(itemInfo, model.ItemInfo{
|
ItemId: info.ItemId,
|
||||||
ItemId: info.ItemId,
|
ItemNum: info.ItemNum,
|
||||||
ItemNum: int64(info.ItemNum),
|
})
|
||||||
})
|
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
|
||||||
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
|
ItemId: info.ItemId,
|
||||||
ItemId: info.ItemId,
|
ItemNum: info.ItemNum,
|
||||||
ItemNum: info.ItemNum,
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dbShop = this.NewDbShop(p, shopInfo.Page, amount[:], ShopConsumeMoney, costNum,
|
dbShop = this.NewDbShop(p, shopInfo.Page, amount[:], ShopConsumeMoney, costNum,
|
||||||
|
|
Loading…
Reference in New Issue