活动礼包

This commit is contained in:
sk 2024-09-02 17:31:45 +08:00
parent 151a739dab
commit 05a54af2db
5 changed files with 23 additions and 21 deletions

View File

@ -156,10 +156,12 @@ func upJybUser(cjybuse, cjyb *mongo.Collection, snId, codeType int32, plt, useCo
if jybuser.JybInfos == nil {
jybuser.JybInfos = make(map[string]int32)
} 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}}}})
if err != nil {

View File

@ -34,7 +34,7 @@ const (
type ShopInfo struct {
Id int32 // 商品ID
Page int32 // 页面 1金币页面 2钻石页面 3道具页面
Page int32 // 页面 1金币页面 2钻石页面 3道具页面 4,房卡
Order int32 // 排序 页面内商品的位置排序
Location []int32 // 显示位置 第1位竖版大厅 第2位Tienlen1级选场 第3位捕鱼1级选场
Picture string // 图片id
@ -44,7 +44,7 @@ type ShopInfo struct {
AdTime int32 // 观看几次广告
RepeatTimes int32 // 领取次数
CoolingTime []int32 // 观看冷却时间
Type int32 // 获得类型 1金币 2钻石 3道具类型
Type int32 // 获得类型 1金币 2钻石 3道具类型 4房卡
Amount int64 // 获得数量
AddArea []int32 // 加送百分比比如加送10%就配置110
ItemId int32 // 获得道具ID

View File

@ -53,7 +53,7 @@ type JybInfo struct {
JybId bson.ObjectId `bson:"_id"` // 礼包ID
Platform string //平台
Name string // 礼包名称
CodeType int32 // 礼包类型 1 通用 2 特殊
CodeType int32 // 礼包类型 1 通用 2专属(自动生成兑换码,每个玩家领一个) 3活动(自动生产兑换码,每个兑换码领一个)
StartTime int64 // 开始时间 Unix
EndTime int64 // 结束时间
Content string // 礼包内容

View File

@ -346,7 +346,7 @@ func (this *HundredSceneMgr) ModuleName() string {
}
func (this *HundredSceneMgr) Init() {
this.TryCreateRoom()
//this.TryCreateRoom()
}
func (this *HundredSceneMgr) Update() {

View File

@ -63,6 +63,8 @@ const (
ShopTypeCoin = iota + 1 // 金币
ShopTypeDiamond // 钻石
ShopTypeItem // 道具
ShopTypeFangKa // 房卡
ShopTypeMax
)
// 兑换商品状态
@ -539,10 +541,10 @@ func (this *ShopMgr) shopAddItem(p *Player, shopInfo *model.ShopInfo, vipShopId
// createOrder 保存购买记录
func (this *ShopMgr) createOrder(p *Player, shopInfo *model.ShopInfo, costNum int64, amount [3]int32) {
if shopInfo.Type < ShopTypeCoin && shopInfo.Type > ShopTypeItem {
logger.Logger.Errorf("createOrder err: type = %v", shopInfo.Type)
return
}
//if shopInfo.Type < ShopTypeCoin && shopInfo.Type >= ShopTypeMax {
// logger.Logger.Errorf("createOrder err: type = %v", shopInfo.Type)
// return
//}
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
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)
var itemInfo []model.ItemInfo
var webItemInfo []*webapi_proto.ItemInfo
if shopInfo.AddItemInfo != nil {
for _, info := range shopInfo.AddItemInfo {
itemInfo = append(itemInfo, model.ItemInfo{
ItemId: info.ItemId,
ItemNum: int64(info.ItemNum),
})
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
ItemId: info.ItemId,
ItemNum: info.ItemNum,
})
}
for _, info := range shopInfo.GetItems() {
itemInfo = append(itemInfo, model.ItemInfo{
ItemId: info.ItemId,
ItemNum: info.ItemNum,
})
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
ItemId: info.ItemId,
ItemNum: info.ItemNum,
})
}
dbShop = this.NewDbShop(p, shopInfo.Page, amount[:], ShopConsumeMoney, costNum,