Compare commits

...

5 Commits

Author SHA1 Message Date
sk 4cf1b00b4d update protocol 2024-08-08 18:30:05 +08:00
sk 239c93ea04 解决冲突 2024-08-08 18:27:31 +08:00
sk c8ba3b74ee vip特权1数据结构调整 2024-08-08 18:25:18 +08:00
sk 1c61b86681 新手引导启用时间 2024-08-08 17:37:57 +08:00
sk 61523b30d5 兑换礼包记录 2024-08-08 17:26:30 +08:00
8 changed files with 69 additions and 28 deletions

View File

@ -354,6 +354,11 @@ func (svc *PlayerDataSvc) GetPlayerDataBySnId(args *model.GetPlayerDataBySnIdArg
} }
cplayerdata.Update(bson.M{"snid": args.SnId}, bson.M{"$set": param}) cplayerdata.Update(bson.M{"snid": args.SnId}, bson.M{"$set": param})
} }
if p.GuideStep >= 0 && p.CreateTime.Unix() < model.GameParamData.GuideTs {
p.GuideStep = -1
param["guidestep"] = p.GuideStep
cplayerdata.Update(bson.M{"snid": args.SnId}, bson.M{"$set": param})
}
} }
var code string var code string

View File

@ -15,8 +15,10 @@ type ClientLog struct {
} }
type CustomData struct { type CustomData struct {
GuideTp int32 `json:"guide_tp"` Event string `json:"event"` // 新手引导 guide
N int64 `json:"n"` Platform string `json:"platform"` // 平台id
GuideTp int32 `json:"guide_tp"` // 新手引导类型 1完成步骤 2跳过新手引导
N int64 `json:"n"` // 完成步骤的序号,或者跳过新手引导的序号
} }
type ClientLogMysql ClientLog type ClientLogMysql ClientLog

View File

@ -82,7 +82,8 @@ type GameParam struct {
TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励 TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励
RankPlayerPermitMaxNum int32 // 赛季通行证积分排行榜最大人数 RankPlayerPermitMaxNum int32 // 赛季通行证积分排行榜最大人数
PermitInitScore int64 // 赛季通行证初始积分 PermitInitScore int64 // 赛季通行证初始积分
GuideStepMaxNum int32 // 引导步骤最大值 GuideStepMaxNum int32 // 新手引导步骤最大值
GuideTs int64 // 新手引导时间戳,小于这个时间的玩家不显示新手引导
} }
var GameParamPath = "../data/gameparam.json" var GameParamPath = "../data/gameparam.json"
@ -213,4 +214,7 @@ func InitGameParam() {
if GameParamData.GuideStepMaxNum == 0 { if GameParamData.GuideStepMaxNum == 0 {
GameParamData.GuideStepMaxNum = 4 GameParamData.GuideStepMaxNum = 4
} }
if GameParamData.GuideTs == 0 {
GameParamData.GuideTs = 1724623200
}
} }

View File

@ -286,9 +286,10 @@ type JybItem struct {
} }
type JybLog struct { type JybLog struct {
Ts int64 `json:"ts"` Id string `json:"jybId"` // 礼包id
SnId int32 `json:"snid"` Ts int64 `json:"ts"` // 时间戳
SnId int32 `json:"snid"` // 玩家id
Tp int32 `json:"tp"` // 礼包类型 1:通用礼包 2:专属礼包 Tp int32 `json:"tp"` // 礼包类型 1:通用礼包 2:专属礼包
Name string `json:"name"` // 礼包名称 Name string `json:"name"` // 礼包名称
Award []*JybItem `json:"award"` Award []*JybItem `json:"award"` // 礼包奖励
} }

2
public

@ -1 +1 @@
Subproject commit 677abd66845fe40919e38580a3e269b5343b8b1c Subproject commit 5f2585b78dd35b299adec741802c83e4961de5e8

View File

@ -3054,6 +3054,8 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
switch msg.GetTp() { switch msg.GetTp() {
case common.AttributeGuideStep, common.AttributeGuideSkip: case common.AttributeGuideStep, common.AttributeGuideSkip:
d := model.CustomData{ d := model.CustomData{
Event: "guide",
Platform: p.Platform,
GuideTp: msg.GetTp(), GuideTp: msg.GetTp(),
N: int64(stepId), N: int64(stepId),
} }

View File

@ -593,6 +593,7 @@ func (this *BagMgr) VerifyUpJybInfo(p *Player, args *model.VerifyUpJybInfoArgs)
} }
} }
jybLog := &model.JybLog{ jybLog := &model.JybLog{
Id: jyb.JybId.Hex(),
Ts: time.Now().Unix(), Ts: time.Now().Unix(),
SnId: p.SnId, SnId: p.SnId,
Tp: jyb.CodeType, Tp: jyb.CodeType,

View File

@ -3771,15 +3771,20 @@ func (this *Player) SCVIPInfo() {
ShopId7: cfg.ShopId7, ShopId7: cfg.ShopId7,
MatchFreeTimes: cfg.MatchFreeTimes + this.GetSkillAdd(common.SkillIdVipTimes), MatchFreeTimes: cfg.MatchFreeTimes + this.GetSkillAdd(common.SkillIdVipTimes),
} }
money := cfg.Privilege1[0] data.Privilege1 = make([]int32, len(cfg.Privilege1))
copy(data.Privilege1, cfg.Privilege1)
for i := 0; i < len(cfg.Privilege1); {
if cfg.Privilege1[i] == common.ItemIDCoin && i+1 < len(cfg.Privilege1) {
money := cfg.Privilege1[i+1]
// 皮肤技能加成 // 皮肤技能加成
add := this.GetSkillAdd(common.SkillIdVipGift) add := this.GetSkillAdd(common.SkillIdVipGift)
if add > 0 { if add > 0 {
money += int32((float64(money) * float64(add)) / 100.00) money += int32((float64(money) * float64(add)) / 100.00)
} }
data.Privilege1 = make([]int32, len(cfg.Privilege1)) cfg.Privilege1[i+1] = money
copy(data.Privilege1, cfg.Privilege1) }
data.Privilege1[0] = money i += 2
}
for itemId, itemNum := range cfg.Award { for itemId, itemNum := range cfg.Award {
data.Item = append(data.Item, &playerproto.ItemInfo{ data.Item = append(data.Item, &playerproto.ItemInfo{
ItemId: int32(itemId), ItemId: int32(itemId),
@ -3848,17 +3853,38 @@ func (this *Player) VIPDraw(id int32) {
if data.VipId == this.VIP { if data.VipId == this.VIP {
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
this.WelfData.VIPBag[this.VIP][0] = 1 this.WelfData.VIPBag[this.VIP][0] = 1
//金币数量 var money, addVipExp int64
money := data.Privilege1[0] for i := 0; i < len(data.Privilege1); {
if i+1 < len(data.Privilege1) {
switch data.Privilege1[i] {
case common.ItemIDCoin:
money = int64(data.Privilege1[i+1])
// 皮肤技能加成 // 皮肤技能加成
add := this.GetSkillAdd(common.SkillIdVipGift) add := this.GetSkillAdd(common.SkillIdVipGift)
if add > 0 { if add > 0 {
money += int32((float64(money) * float64(add)) / 100.00) money += int64((float64(money) * float64(add)) / 100.00)
} }
//vip经验 this.AddCoin(money, 0, common.GainWay_VIPGift, "sys", "VIP每日礼包")
addVipExp := int64(float64(data.Privilege1[1]) / vips.MoneyRatio) case common.ItemIDVipExp:
this.AddCoin(int64(money), 0, common.GainWay_VIPGift, "sys", "VIP每日礼包") addVipExp = int64(float64(data.Privilege1[i+1]) / vips.MoneyRatio)
this.AddMoneyPayTotal(addVipExp) this.AddMoneyPayTotal(addVipExp)
default:
BagMgrSingleton.AddItemsV2(&ItemParam{
P: this,
Change: []*Item{
{
ItemId: data.Privilege1[i],
ItemNum: int64(data.Privilege1[i+1]),
},
},
GainWay: common.GainWay_VIPGift,
Operator: "system",
Remark: "VIP每日礼包",
})
}
}
i += 2
}
pack.Vip = this.VIP pack.Vip = this.VIP
logger.Logger.Tracef("玩家领取VIP每日礼包成功snid = %v,Vip = %v,金币数量 = %vaddVipEx = %v", this.SnId, this.VIP, money, addVipExp) logger.Logger.Tracef("玩家领取VIP每日礼包成功snid = %v,Vip = %v,金币数量 = %vaddVipEx = %v", this.SnId, this.VIP, money, addVipExp)
//VIP礼包统计数据 //VIP礼包统计数据