Compare commits
No commits in common. "425424c68b7b9e4a3d18dd2d73f1371752320886" and "f657773a5e1b61a3a5a9ae1ba3e41a0bf6d9852e" have entirely different histories.
425424c68b
...
f657773a5e
|
@ -1248,8 +1248,7 @@ func (this *Player) UpdatePigBankCoin(gainTexCoin int64) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fGetPropValue := func(propName string) int64 {
|
fGetPropValue := func(propName string) int64 {
|
||||||
//pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||||
pool := ConfigMgrInst.GetConfig(this.Platform).GamePigBankPropConfig.PropInfo
|
|
||||||
for _, PropItem := range pool {
|
for _, PropItem := range pool {
|
||||||
if PropItem.PorpName == propName {
|
if PropItem.PorpName == propName {
|
||||||
return int64(PropItem.PropValue)
|
return int64(PropItem.PropValue)
|
||||||
|
@ -1258,9 +1257,7 @@ func (this *Player) UpdatePigBankCoin(gainTexCoin int64) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
BankCoinMax := int64(0)
|
BankCoinMax := int64(0)
|
||||||
// pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
for _, data := range srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr() {
|
||||||
pool := ConfigMgrInst.GetConfig(this.Platform).GamePigBankDiamondConfig.DiamondInfo
|
|
||||||
for _, data := range pool {
|
|
||||||
if this.WelfData.PigBank.DayBuyTimes+1 >= data.BuyCountMin && this.WelfData.PigBank.DayBuyTimes+1 <= data.BuyCountMax {
|
if this.WelfData.PigBank.DayBuyTimes+1 >= data.BuyCountMin && this.WelfData.PigBank.DayBuyTimes+1 <= data.BuyCountMax {
|
||||||
BankCoinMax = int64(data.MaxGold)
|
BankCoinMax = int64(data.MaxGold)
|
||||||
break
|
break
|
||||||
|
|
|
@ -540,21 +540,3 @@ func (cm *ConfigMgr) CustomIsOn(plt string, configId int32) bool {
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *ConfigMgr) GetPigBankDiamondArr(plt string) []*webapi.PigBankDiamondInfo {
|
|
||||||
cfg := cm.GetConfig(plt).GamePigBankDiamondConfig
|
|
||||||
if cfg == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return cfg.DiamondInfo
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cm *ConfigMgr) GetPigBankPropArr(plt string) []*webapi.PigBankPropInfo {
|
|
||||||
cfg := cm.GetConfig(plt).GamePigBankPropConfig
|
|
||||||
if cfg == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return cfg.PropInfo
|
|
||||||
}
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import (
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/proto"
|
"mongo.games.com/game/proto"
|
||||||
"mongo.games.com/game/protocol/shop"
|
"mongo.games.com/game/protocol/shop"
|
||||||
|
"mongo.games.com/game/srvdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CSShopInfoPacketFactory struct {
|
type CSShopInfoPacketFactory struct {
|
||||||
|
@ -425,8 +426,7 @@ func (this *CSPayInfoHandler) Process(s *netlib.Session, packetid int, data inte
|
||||||
if shopInfo.Page == ShopPageDiamondBank {
|
if shopInfo.Page == ShopPageDiamondBank {
|
||||||
// 检查每日领取次数
|
// 检查每日领取次数
|
||||||
fGetPropValue := func(propName string) int32 {
|
fGetPropValue := func(propName string) int32 {
|
||||||
//pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankPropArr(p.Platform)
|
|
||||||
for _, PropItem := range pool {
|
for _, PropItem := range pool {
|
||||||
if PropItem.PorpName == propName {
|
if PropItem.PorpName == propName {
|
||||||
return PropItem.PropValue
|
return PropItem.PropValue
|
||||||
|
|
|
@ -1118,7 +1118,7 @@ func (this *WelfareMgr) BlindBoxInfo(p *Player, bid int32) {
|
||||||
if cyc == 1 || blindBox.Cycle == model.WelfareOpen {
|
if cyc == 1 || blindBox.Cycle == model.WelfareOpen {
|
||||||
p.WelfData.BlindBoxId = 0
|
p.WelfData.BlindBoxId = 0
|
||||||
}
|
}
|
||||||
} // == 1代表当日循环
|
} // == 1代表当日循环
|
||||||
if p.WelfData.BlindBoxId == 0 { // 未领取过发随机Date
|
if p.WelfData.BlindBoxId == 0 { // 未领取过发随机Date
|
||||||
|
|
||||||
idx := bid
|
idx := bid
|
||||||
|
@ -1691,8 +1691,7 @@ func (this *WelfareMgr) PigbankGetInfo(p *Player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fGetPropValue := func(propName string) int32 {
|
fGetPropValue := func(propName string) int32 {
|
||||||
//pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankPropArr(p.Platform)
|
|
||||||
for _, PropItem := range pool {
|
for _, PropItem := range pool {
|
||||||
if PropItem.PorpName == propName {
|
if PropItem.PorpName == propName {
|
||||||
return PropItem.PropValue
|
return PropItem.PropValue
|
||||||
|
@ -1735,8 +1734,7 @@ func (this *WelfareMgr) PigbankGetInfo(p *Player) {
|
||||||
//}
|
//}
|
||||||
|
|
||||||
DayBuyMaxCnt := fGetPropValue("DayBuyMaxCnt")
|
DayBuyMaxCnt := fGetPropValue("DayBuyMaxCnt")
|
||||||
pool := PlatformMgrSingleton.GetPigBankDiamondArr(p.Platform)
|
for _, data := range srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr() {
|
||||||
for _, data := range pool {
|
|
||||||
if data == nil {
|
if data == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -1750,10 +1748,7 @@ func (this *WelfareMgr) PigbankGetInfo(p *Player) {
|
||||||
bankInfo.DayBuyMaxCnt = DayBuyMaxCnt
|
bankInfo.DayBuyMaxCnt = DayBuyMaxCnt
|
||||||
bankInfo.Price = int64(data.CoinPrice)
|
bankInfo.Price = int64(data.CoinPrice)
|
||||||
bankInfo.BankMaxCoin = int64(data.MaxGold)
|
bankInfo.BankMaxCoin = int64(data.MaxGold)
|
||||||
|
bankInfo.GoldExc = data.GoldExc
|
||||||
for _, v := range data.GoldExc {
|
|
||||||
bankInfo.GoldExc[int64(v.ItemId)] = v.ItemNum
|
|
||||||
}
|
|
||||||
|
|
||||||
if takeRecorcd, exist := p.WelfData.PigBank.TakeRecord[data.Id]; exist {
|
if takeRecorcd, exist := p.WelfData.PigBank.TakeRecord[data.Id]; exist {
|
||||||
bankInfo.TakeCoin = takeRecorcd
|
bankInfo.TakeCoin = takeRecorcd
|
||||||
|
@ -1780,8 +1775,7 @@ func (this *WelfareMgr) PigbankTakeCoin(p *Player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fGetPropValue := func(propName string) int32 {
|
fGetPropValue := func(propName string) int32 {
|
||||||
//pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankPropArr(p.Platform)
|
|
||||||
for _, PropItem := range pool {
|
for _, PropItem := range pool {
|
||||||
if PropItem.PorpName == propName {
|
if PropItem.PorpName == propName {
|
||||||
return PropItem.PropValue
|
return PropItem.PropValue
|
||||||
|
@ -1810,8 +1804,7 @@ func (this *WelfareMgr) PigbankTakeCoin(p *Player) {
|
||||||
p.WelfData.PigBank.TakeRecord = make(map[int32]int64, 8)
|
p.WelfData.PigBank.TakeRecord = make(map[int32]int64, 8)
|
||||||
}
|
}
|
||||||
|
|
||||||
//pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankDiamondArr(p.Platform)
|
|
||||||
infoData := pool[0]
|
infoData := pool[0]
|
||||||
for _, data := range pool {
|
for _, data := range pool {
|
||||||
if data == nil {
|
if data == nil {
|
||||||
|
@ -1824,7 +1817,7 @@ func (this *WelfareMgr) PigbankTakeCoin(p *Player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BankMaxCoin := int64(0)
|
BankMaxCoin := int64(0)
|
||||||
for _, data := range pool {
|
for _, data := range srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr() {
|
||||||
if data == nil {
|
if data == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -1885,10 +1878,10 @@ func (this *WelfareMgr) PigbankTakeCoin(p *Player) {
|
||||||
if infoData.GoldExc != nil {
|
if infoData.GoldExc != nil {
|
||||||
// 发放奖励道具
|
// 发放奖励道具
|
||||||
var items []*model.Item
|
var items []*model.Item
|
||||||
for _, v := range infoData.GoldExc {
|
for k, v := range infoData.GoldExc {
|
||||||
items = append(items, &model.Item{
|
items = append(items, &model.Item{
|
||||||
ItemId: int32(v.ItemId),
|
ItemId: int32(k),
|
||||||
ItemNum: v.ItemNum,
|
ItemNum: v,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||||
|
@ -1938,8 +1931,7 @@ func (this *WelfareMgr) DiamondBankGetInfo(p *Player) {
|
||||||
OpRetCode: welfare.OpResultCode_OPRC_Error,
|
OpRetCode: welfare.OpResultCode_OPRC_Error,
|
||||||
}
|
}
|
||||||
fGetPropValue := func(propName string) int32 {
|
fGetPropValue := func(propName string) int32 {
|
||||||
//pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankPropArr(p.Platform)
|
|
||||||
for _, PropItem := range pool {
|
for _, PropItem := range pool {
|
||||||
if PropItem.PorpName == propName {
|
if PropItem.PorpName == propName {
|
||||||
return PropItem.PropValue
|
return PropItem.PropValue
|
||||||
|
@ -1948,8 +1940,7 @@ func (this *WelfareMgr) DiamondBankGetInfo(p *Player) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
//pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankDiamondArr(p.Platform)
|
|
||||||
//infoData := pool[0]
|
//infoData := pool[0]
|
||||||
if p.WelfData.DiamondBank == nil {
|
if p.WelfData.DiamondBank == nil {
|
||||||
p.WelfData.DiamondBank = &model.DiamondBankData{
|
p.WelfData.DiamondBank = &model.DiamondBankData{
|
||||||
|
@ -1977,9 +1968,7 @@ func (this *WelfareMgr) DiamondBankGetInfo(p *Player) {
|
||||||
bankInfo.Price = int64(data.DiamondPrice)
|
bankInfo.Price = int64(data.DiamondPrice)
|
||||||
bankInfo.NowPrice = int64(data.DiamondNowPrice)
|
bankInfo.NowPrice = int64(data.DiamondNowPrice)
|
||||||
bankInfo.ShopId = data.DiamondId
|
bankInfo.ShopId = data.DiamondId
|
||||||
for _, v := range data.GoldExc {
|
bankInfo.DiamondExc = data.DiamondExc
|
||||||
bankInfo.DiamondExc[int64(v.ItemId)] = v.ItemNum
|
|
||||||
}
|
|
||||||
|
|
||||||
if takeRecorcd, exist := p.WelfData.DiamondBank.TakeRecord[data.Id]; exist {
|
if takeRecorcd, exist := p.WelfData.DiamondBank.TakeRecord[data.Id]; exist {
|
||||||
bankInfo.TakeDiamond = float64(takeRecorcd)
|
bankInfo.TakeDiamond = float64(takeRecorcd)
|
||||||
|
@ -2005,8 +1994,7 @@ func (this *WelfareMgr) DiamondBankTakeCoin(p *Player) (retItemArr []*model.Item
|
||||||
OpRetCode: welfare.OpResultCode_OPRC_Error,
|
OpRetCode: welfare.OpResultCode_OPRC_Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
//pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankDiamondArr(p.Platform)
|
|
||||||
infoData := pool[0]
|
infoData := pool[0]
|
||||||
for _, data := range pool {
|
for _, data := range pool {
|
||||||
if p.WelfData.DiamondBank.DayBuyTimes+1 >= data.BuyCountMin && p.WelfData.DiamondBank.DayBuyTimes+1 <= data.BuyCountMax {
|
if p.WelfData.DiamondBank.DayBuyTimes+1 >= data.BuyCountMin && p.WelfData.DiamondBank.DayBuyTimes+1 <= data.BuyCountMax {
|
||||||
|
@ -2042,15 +2030,15 @@ func (this *WelfareMgr) DiamondBankTakeCoin(p *Player) (retItemArr []*model.Item
|
||||||
// 发放奖励道具
|
// 发放奖励道具
|
||||||
if infoData.DiamondExc != nil {
|
if infoData.DiamondExc != nil {
|
||||||
var items []*model.Item
|
var items []*model.Item
|
||||||
for _, v := range infoData.DiamondExc {
|
for k, v := range infoData.DiamondExc {
|
||||||
items = append(items, &model.Item{
|
items = append(items, &model.Item{
|
||||||
ItemId: v.ItemId,
|
ItemId: int32(k),
|
||||||
ItemNum: v.ItemNum,
|
ItemNum: v,
|
||||||
})
|
})
|
||||||
|
|
||||||
retItemArr = append(retItemArr, &model.Item{
|
retItemArr = append(retItemArr, &model.Item{
|
||||||
ItemId: v.ItemId,
|
ItemId: int32(k),
|
||||||
ItemNum: v.ItemNum,
|
ItemNum: v,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2099,8 +2087,7 @@ func (this *WelfareMgr) UpdateDiamondBankData(p *Player, coinNum int64, isWin bo
|
||||||
p.WelfData.DiamondBank = &model.DiamondBankData{}
|
p.WelfData.DiamondBank = &model.DiamondBankData{}
|
||||||
}
|
}
|
||||||
fGetPropValue := func(propName string) int32 {
|
fGetPropValue := func(propName string) int32 {
|
||||||
//pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankPropArr(p.Platform)
|
|
||||||
for _, PropItem := range pool {
|
for _, PropItem := range pool {
|
||||||
if PropItem.PorpName == propName {
|
if PropItem.PorpName == propName {
|
||||||
return PropItem.PropValue
|
return PropItem.PropValue
|
||||||
|
@ -2123,8 +2110,7 @@ func (this *WelfareMgr) UpdateDiamondBankData(p *Player, coinNum int64, isWin bo
|
||||||
//保留小数点后4位
|
//保留小数点后4位
|
||||||
addDiamond = math.Round(addDiamond*10000) / 10000
|
addDiamond = math.Round(addDiamond*10000) / 10000
|
||||||
p.WelfData.DiamondBank.BankDiamond += addDiamond
|
p.WelfData.DiamondBank.BankDiamond += addDiamond
|
||||||
//pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
||||||
pool := PlatformMgrSingleton.GetPigBankDiamondArr(p.Platform)
|
|
||||||
infoData := pool[0]
|
infoData := pool[0]
|
||||||
for _, data := range pool {
|
for _, data := range pool {
|
||||||
if p.WelfData.DiamondBank.DayBuyTimes+1 >= data.BuyCountMin && p.WelfData.DiamondBank.DayBuyTimes+1 <= data.BuyCountMax {
|
if p.WelfData.DiamondBank.DayBuyTimes+1 >= data.BuyCountMin && p.WelfData.DiamondBank.DayBuyTimes+1 <= data.BuyCountMax {
|
||||||
|
|
Loading…
Reference in New Issue