Compare commits
5 Commits
6ab8c5506e
...
4cf1b00b4d
Author | SHA1 | Date |
---|---|---|
|
4cf1b00b4d | |
|
239c93ea04 | |
|
c8ba3b74ee | |
|
1c61b86681 | |
|
61523b30d5 |
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
11
model/jyb.go
11
model/jyb.go
|
@ -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"` // 时间戳
|
||||||
Tp int32 `json:"tp"` // 礼包类型 1:通用礼包 2:专属礼包
|
SnId int32 `json:"snid"` // 玩家id
|
||||||
Name string `json:"name"` // 礼包名称
|
Tp int32 `json:"tp"` // 礼包类型 1:通用礼包 2:专属礼包
|
||||||
Award []*JybItem `json:"award"`
|
Name string `json:"name"` // 礼包名称
|
||||||
|
Award []*JybItem `json:"award"` // 礼包奖励
|
||||||
}
|
}
|
||||||
|
|
2
public
2
public
|
@ -1 +1 @@
|
||||||
Subproject commit 677abd66845fe40919e38580a3e269b5343b8b1c
|
Subproject commit 5f2585b78dd35b299adec741802c83e4961de5e8
|
|
@ -3054,8 +3054,10 @@ 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{
|
||||||
GuideTp: msg.GetTp(),
|
Event: "guide",
|
||||||
N: int64(stepId),
|
Platform: p.Platform,
|
||||||
|
GuideTp: msg.GetTp(),
|
||||||
|
N: int64(stepId),
|
||||||
}
|
}
|
||||||
b, _ := json.Marshal(d)
|
b, _ := json.Marshal(d)
|
||||||
LogChannelSingleton.WriteLog(&model.ClientLogMysql{
|
LogChannelSingleton.WriteLog(&model.ClientLogMysql{
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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]
|
|
||||||
// 皮肤技能加成
|
|
||||||
add := this.GetSkillAdd(common.SkillIdVipGift)
|
|
||||||
if add > 0 {
|
|
||||||
money += int32((float64(money) * float64(add)) / 100.00)
|
|
||||||
}
|
|
||||||
data.Privilege1 = make([]int32, len(cfg.Privilege1))
|
data.Privilege1 = make([]int32, len(cfg.Privilege1))
|
||||||
copy(data.Privilege1, cfg.Privilege1)
|
copy(data.Privilege1, cfg.Privilege1)
|
||||||
data.Privilege1[0] = money
|
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)
|
||||||
|
if add > 0 {
|
||||||
|
money += int32((float64(money) * float64(add)) / 100.00)
|
||||||
|
}
|
||||||
|
cfg.Privilege1[i+1] = 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) {
|
||||||
add := this.GetSkillAdd(common.SkillIdVipGift)
|
switch data.Privilege1[i] {
|
||||||
if add > 0 {
|
case common.ItemIDCoin:
|
||||||
money += int32((float64(money) * float64(add)) / 100.00)
|
money = int64(data.Privilege1[i+1])
|
||||||
|
// 皮肤技能加成
|
||||||
|
add := this.GetSkillAdd(common.SkillIdVipGift)
|
||||||
|
if add > 0 {
|
||||||
|
money += int64((float64(money) * float64(add)) / 100.00)
|
||||||
|
}
|
||||||
|
this.AddCoin(money, 0, common.GainWay_VIPGift, "sys", "VIP每日礼包")
|
||||||
|
case common.ItemIDVipExp:
|
||||||
|
addVipExp = int64(float64(data.Privilege1[i+1]) / vips.MoneyRatio)
|
||||||
|
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
|
||||||
}
|
}
|
||||||
//vip经验
|
|
||||||
addVipExp := int64(float64(data.Privilege1[1]) / vips.MoneyRatio)
|
|
||||||
this.AddCoin(int64(money), 0, common.GainWay_VIPGift, "sys", "VIP每日礼包")
|
|
||||||
this.AddMoneyPayTotal(addVipExp)
|
|
||||||
pack.Vip = this.VIP
|
pack.Vip = this.VIP
|
||||||
logger.Logger.Tracef("玩家领取VIP每日礼包成功!snid = %v,Vip = %v,金币数量 = %v,addVipEx = %v", this.SnId, this.VIP, money, addVipExp)
|
logger.Logger.Tracef("玩家领取VIP每日礼包成功!snid = %v,Vip = %v,金币数量 = %v,addVipEx = %v", this.SnId, this.VIP, money, addVipExp)
|
||||||
//VIP礼包统计数据
|
//VIP礼包统计数据
|
||||||
|
|
Loading…
Reference in New Issue