解决冲突
This commit is contained in:
commit
0c846595eb
|
|
@ -272,8 +272,9 @@ const (
|
||||||
GainWayBuyItem = 86 // 商城购买道具
|
GainWayBuyItem = 86 // 商城购买道具
|
||||||
GainWayBuyWeekCard = 87 // 商城购买周卡
|
GainWayBuyWeekCard = 87 // 商城购买周卡
|
||||||
GainWayVipBuyCoin = 88 // vip商城购买金币
|
GainWayVipBuyCoin = 88 // vip商城购买金币
|
||||||
GainWaySign7 = 89 // 连续签到7天进阶消耗
|
GainWaySign7Con = 89 // 累计签到进阶奖励消耗
|
||||||
GainWay_PigrankGainDiamond = 90 //存钱罐打开获取钻石
|
GainWaySign7Add = 90 // 累计签到进阶奖励获得
|
||||||
|
GainWay_PigrankGainDiamond = 91 //存钱罐打开获取钻石
|
||||||
)
|
)
|
||||||
|
|
||||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -3,6 +3,7 @@
|
||||||
LoseCoinRate
|
LoseCoinRate
|
||||||
|
|
||||||
DayBuyMaxCnt
|
DayBuyMaxCnt
|
||||||
WinCoinRateDiamond
|
WinCoinRateDiamond
|
||||||
LoseCoinRateDiamond
|
LoseCoinRateDiamond
|
||||||
|
|
||||||
DayBuyMaxCntDiamond
|
DayBuyMaxCntDiamond
|
||||||
|
|
@ -17,11 +17,13 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 4,
|
"Id": 4,
|
||||||
"PorpName": "WinCoinRateDiamond"
|
"PorpName": "WinCoinRateDiamond",
|
||||||
|
"PropValue": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 5,
|
"Id": 5,
|
||||||
"PorpName": "LoseCoinRateDiamond"
|
"PorpName": "LoseCoinRateDiamond",
|
||||||
|
"PropValue": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 6,
|
"Id": 6,
|
||||||
|
|
|
||||||
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
|
@ -105,12 +105,17 @@ func (t *TaskHandle) TaskUpdate(id int, data any) {
|
||||||
|
|
||||||
case common.TaskTypeWinOrLose: // 游戏输赢金币数量
|
case common.TaskTypeWinOrLose: // 游戏输赢金币数量
|
||||||
p.PhoneLotteryTask(common.TaskTypeWinOrLose, num)
|
p.PhoneLotteryTask(common.TaskTypeWinOrLose, num)
|
||||||
|
if !p.IsRob {
|
||||||
|
WelfareMgrSington.UpdateDiamondBankData(p, num, false)
|
||||||
|
}
|
||||||
case common.TaskTypeTienlenCount: //tienlen游戏场次
|
case common.TaskTypeTienlenCount: //tienlen游戏场次
|
||||||
p.PhoneLotteryTask(common.TaskTypeTienlenCount, 1)
|
p.PhoneLotteryTask(common.TaskTypeTienlenCount, 1)
|
||||||
case common.TaskTypeBindInviter: // 绑定邀请人数量
|
case common.TaskTypeBindInviter: // 绑定邀请人数量
|
||||||
|
|
||||||
case common.TaskTypeWinCoin: // 赢取金币数量
|
case common.TaskTypeWinCoin: // 赢取金币数量
|
||||||
|
if !p.IsRob {
|
||||||
|
WelfareMgrSington.UpdateDiamondBankData(p, num, true)
|
||||||
|
}
|
||||||
case common.TaskTypeTienlenWinTimes: // tienlen游戏赢取次数
|
case common.TaskTypeTienlenWinTimes: // tienlen游戏赢取次数
|
||||||
|
|
||||||
case common.TaskTypeActivityScore: // 活跃积分数量
|
case common.TaskTypeActivityScore: // 活跃积分数量
|
||||||
|
|
|
||||||
|
|
@ -837,7 +837,7 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) {
|
||||||
if p.Diamond < int64(addUpDate2Num) {
|
if p.Diamond < int64(addUpDate2Num) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
p.AddDiamond(int64(-addUpDate2Num), 0, common.GainWaySign7, "system", "累计签到进阶奖励钻石消耗")
|
p.AddDiamond(int64(-addUpDate2Num), 0, common.GainWaySign7Con, "system", "累计签到进阶奖励钻石消耗")
|
||||||
logger.Logger.Trace("累计签到进阶奖励,扣除钻石uid = ", p.SnId)
|
logger.Logger.Trace("累计签到进阶奖励,扣除钻石uid = ", p.SnId)
|
||||||
EndTime = -1
|
EndTime = -1
|
||||||
}
|
}
|
||||||
|
|
@ -858,7 +858,7 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) {
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BagMgrSingleton.AddItems(p, items, 0, common.GainWaySign7, "system", "累计签到进阶奖励钻石消耗", 0, 0, false)
|
BagMgrSingleton.AddItems(p, items, 0, common.GainWaySign7Add, "system", "累计签到进阶奖励获得", 0, 0, false)
|
||||||
}
|
}
|
||||||
//通知客户端
|
//通知客户端
|
||||||
this.UpdateAddUp2Date(p, Num, day, EndTime)
|
this.UpdateAddUp2Date(p, Num, day, EndTime)
|
||||||
|
|
@ -1897,9 +1897,29 @@ func (this *WelfareMgr) DiamondBankTakeCoin(p *Player) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新数据
|
// 更新钻石存储罐数据
|
||||||
func (this *WelfareMgr) UpdateDiamondBankData(p *Player) {
|
func (this *WelfareMgr) UpdateDiamondBankData(p *Player, coinNum int64, isWin bool) {
|
||||||
|
logger.Logger.Trace("更新钻石存储罐数据!!!!!!!!!!")
|
||||||
|
if p.WelfData.DiamondBank == nil {
|
||||||
|
p.WelfData.DiamondBank = &model.DiamondBankData{}
|
||||||
|
}
|
||||||
|
fGetPropValue := func(propName string) int32 {
|
||||||
|
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||||
|
for _, PropItem := range pool {
|
||||||
|
if PropItem.PorpName == propName {
|
||||||
|
return PropItem.PropValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
WinCoinRate := fGetPropValue("WinCoinRateDiamond")
|
||||||
|
LoseCoinRate := fGetPropValue("LoseCoinRateDiamond")
|
||||||
|
if isWin {
|
||||||
|
p.WelfData.DiamondBank.BankDiamond += float64(coinNum) * float64(WinCoinRate/10000000)
|
||||||
|
} else {
|
||||||
|
p.WelfData.DiamondBank.BankDiamond += float64(coinNum) * float64(LoseCoinRate/10000000)
|
||||||
|
}
|
||||||
|
logger.Logger.Tracef("更新钻石存储罐数据 snid = %d,coinNum = %d,isWin = %s,当前钻石存储罐钻石数量:%f", p.SnId, coinNum, isWin, p.WelfData.DiamondBank.BankDiamond)
|
||||||
}
|
}
|
||||||
func (this *WelfareMgr) Update() {
|
func (this *WelfareMgr) Update() {
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue