复仇者联盟
This commit is contained in:
parent
a3b95947b0
commit
0de01b7eaa
|
@ -76,4 +76,30 @@
|
|||
9ѓр<D193><18>№ ПЕџџџџ <20><>пРJ(<28>ЈжЙ0d8 @<40>џџџџџџџџHрљџџџџџџџP
|
||||
:єр<D194><18>АЄМ<D084>§џџџ <20>алУє(<28>ШЏ %0d8 @<40>џџџџџџџџHрљџџџџџџџP
|
||||
;ѕр<D195><18>№ЕЙёџџџ <20><>ЪвЦ(<28>шэЁК0d8 @<40>џџџџџџџџHрљџџџџџџџP
|
||||
;öà–€À×µåÅÿÿÿ €À¨Êš:(€ ·‡é0d8 @œÿÿÿÿÿÿÿÿHàùÿÿÿÿÿÿÿP
|
||||
;öà–€À×µåÅÿÿÿ €À¨Êš:(€ ·‡é0d8 @œÿÿÿÿÿÿÿÿHàùÿÿÿÿÿÿÿP
|
||||
ÑÛ·€›îÀ–± €ÚÄ XÈ` ÝŒ
|
||||
ÒÛ·€ŽÎ€áë €„¯_XÈ`À¤ÿ
|
||||
ÓÛ·€Æ†<C386>€åšw €”ëÜXÈ`À¶üš
|
||||
ÔÛ·€Œ<E282AC>ž€Êµî €¨Ö¹XÈ`€íøµ
|
||||
᩸€›îÀ–± €ÚÄ XÈ` ÝŒ
|
||||
⩸€ŽÎ€áë €„¯_XÈ`À¤ÿ
|
||||
㩸€Æ†<C386>€åšw €”ëÜXÈ`À¶üš
|
||||
䩸€Œ<E282AC>ž€Êµî €¨Ö¹XÈ`€íøµ
|
||||
ñ÷¸€›îÀ–± €ÚÄ XÈ` ÝŒ
|
||||
ò÷¸€ŽÎ€áë €„¯_XÈ`À¤ÿ
|
||||
ó÷¸€Æ†<C386>€åšw €”ëÜXÈ`À¶üš
|
||||
ô÷¸€Œ<E282AC>ž€Êµî €¨Ö¹XÈ`€íøµ
|
||||
<08>ƹ€›îÀ–± €„¯_XÈ` ÝŒ
|
||||
‚ƹ€Æ†<C386>€åšw €”ëÜXÈ`À¶üš
|
||||
ƒÆ¹€Œ<E282AC>ž€Êµî €¨Ö¹XÈ`€íøµ
|
||||
‘”º€›îÀ–± €„¯_XÈ` ÝŒ
|
||||
’”º€Æ†<C386>€åšw €”ëÜXÈ`À¶üš
|
||||
“”º€Œ<E282AC>ž€Êµî €¨Ö¹XÈ`€íøµ
|
||||
¡âº€›îÀ–± €ÚÄ XÈ` ÝŒ
|
||||
¢âº€ŽÎ€áë €„¯_XÈ`À¤ÿ
|
||||
£âº€Æ†<C386>€åšw €”ëÜXÈ`À¶üš
|
||||
¤âº€Œ<E282AC>ž€Êµî €¨Ö¹XÈ`€íøµ
|
||||
±°»€›îÀ–± €ÚÄ XÈ` ÝŒ
|
||||
²°»€ŽÎ€áë €„¯_XÈ`À¤ÿ
|
||||
³°»€Æ†<C386>€åšw €”ëÜXÈ`À¶üš
|
||||
´°»€Œ<E282AC>ž€Êµî €¨Ö¹XÈ`€íøµ
|
|
@ -857,6 +857,214 @@
|
|||
"LowerOdds": -100,
|
||||
"LowerOddsMax": -800,
|
||||
"ProfitRate": 20
|
||||
},
|
||||
{
|
||||
"Id": 3010001,
|
||||
"InitValue": 6000000,
|
||||
"LowerLimit": 5000000,
|
||||
"UpperLimit": 20000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 6500000
|
||||
},
|
||||
{
|
||||
"Id": 3010002,
|
||||
"InitValue": 60000000,
|
||||
"LowerLimit": 50000000,
|
||||
"UpperLimit": 200000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 65000000
|
||||
},
|
||||
{
|
||||
"Id": 3010003,
|
||||
"InitValue": 300000000,
|
||||
"LowerLimit": 250000000,
|
||||
"UpperLimit": 1000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 325000000
|
||||
},
|
||||
{
|
||||
"Id": 3010004,
|
||||
"InitValue": 600000000,
|
||||
"LowerLimit": 500000000,
|
||||
"UpperLimit": 2000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 650000000
|
||||
},
|
||||
{
|
||||
"Id": 3020001,
|
||||
"InitValue": 6000000,
|
||||
"LowerLimit": 5000000,
|
||||
"UpperLimit": 20000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 6500000
|
||||
},
|
||||
{
|
||||
"Id": 3020002,
|
||||
"InitValue": 60000000,
|
||||
"LowerLimit": 50000000,
|
||||
"UpperLimit": 200000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 65000000
|
||||
},
|
||||
{
|
||||
"Id": 3020003,
|
||||
"InitValue": 300000000,
|
||||
"LowerLimit": 250000000,
|
||||
"UpperLimit": 1000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 325000000
|
||||
},
|
||||
{
|
||||
"Id": 3020004,
|
||||
"InitValue": 600000000,
|
||||
"LowerLimit": 500000000,
|
||||
"UpperLimit": 2000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 650000000
|
||||
},
|
||||
{
|
||||
"Id": 3030001,
|
||||
"InitValue": 6000000,
|
||||
"LowerLimit": 5000000,
|
||||
"UpperLimit": 20000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 6500000
|
||||
},
|
||||
{
|
||||
"Id": 3030002,
|
||||
"InitValue": 60000000,
|
||||
"LowerLimit": 50000000,
|
||||
"UpperLimit": 200000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 65000000
|
||||
},
|
||||
{
|
||||
"Id": 3030003,
|
||||
"InitValue": 300000000,
|
||||
"LowerLimit": 250000000,
|
||||
"UpperLimit": 1000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 325000000
|
||||
},
|
||||
{
|
||||
"Id": 3030004,
|
||||
"InitValue": 600000000,
|
||||
"LowerLimit": 500000000,
|
||||
"UpperLimit": 2000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 650000000
|
||||
},
|
||||
{
|
||||
"Id": 3040001,
|
||||
"InitValue": 6000000,
|
||||
"LowerLimit": 5000000,
|
||||
"UpperLimit": 200000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 6500000
|
||||
},
|
||||
{
|
||||
"Id": 3040002,
|
||||
"InitValue": 300000000,
|
||||
"LowerLimit": 250000000,
|
||||
"UpperLimit": 1000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 325000000
|
||||
},
|
||||
{
|
||||
"Id": 3040003,
|
||||
"InitValue": 600000000,
|
||||
"LowerLimit": 500000000,
|
||||
"UpperLimit": 2000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 650000000
|
||||
},
|
||||
{
|
||||
"Id": 3050001,
|
||||
"InitValue": 6000000,
|
||||
"LowerLimit": 5000000,
|
||||
"UpperLimit": 200000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 6500000
|
||||
},
|
||||
{
|
||||
"Id": 3050002,
|
||||
"InitValue": 300000000,
|
||||
"LowerLimit": 250000000,
|
||||
"UpperLimit": 1000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 325000000
|
||||
},
|
||||
{
|
||||
"Id": 3050003,
|
||||
"InitValue": 600000000,
|
||||
"LowerLimit": 500000000,
|
||||
"UpperLimit": 2000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 650000000
|
||||
},
|
||||
{
|
||||
"Id": 3060001,
|
||||
"InitValue": 6000000,
|
||||
"LowerLimit": 5000000,
|
||||
"UpperLimit": 20000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 6500000
|
||||
},
|
||||
{
|
||||
"Id": 3060002,
|
||||
"InitValue": 60000000,
|
||||
"LowerLimit": 50000000,
|
||||
"UpperLimit": 200000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 65000000
|
||||
},
|
||||
{
|
||||
"Id": 3060003,
|
||||
"InitValue": 300000000,
|
||||
"LowerLimit": 250000000,
|
||||
"UpperLimit": 1000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 325000000
|
||||
},
|
||||
{
|
||||
"Id": 3060004,
|
||||
"InitValue": 600000000,
|
||||
"LowerLimit": 500000000,
|
||||
"UpperLimit": 2000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 650000000
|
||||
},
|
||||
{
|
||||
"Id": 3070001,
|
||||
"InitValue": 6000000,
|
||||
"LowerLimit": 5000000,
|
||||
"UpperLimit": 20000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 6500000
|
||||
},
|
||||
{
|
||||
"Id": 3070002,
|
||||
"InitValue": 60000000,
|
||||
"LowerLimit": 50000000,
|
||||
"UpperLimit": 200000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 65000000
|
||||
},
|
||||
{
|
||||
"Id": 3070003,
|
||||
"InitValue": 300000000,
|
||||
"LowerLimit": 250000000,
|
||||
"UpperLimit": 1000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 325000000
|
||||
},
|
||||
{
|
||||
"Id": 3070004,
|
||||
"InitValue": 600000000,
|
||||
"LowerLimit": 500000000,
|
||||
"UpperLimit": 2000000000,
|
||||
"CtrlRate": 200,
|
||||
"InitNovicValue": 650000000
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
6у├ж├в├с├т├"║█ю└=
|
||||
6с├т├у├ж├в├"║█ю└=
|
||||
.نچۆ؆"¡<>À„=
|
||||
Wь├ы├т├у├в├ш├с├ж├з├" ║█─╜Б
|
||||
]в├ь├ы├з├э├с├т├у├ж├ш├"╒█Т
|
||||
Wс├ы├ш├ь├з├т├у├ж├в├" ║█─╜Б
|
||||
]з├с├т├у├ь├ы├ж├в├ш├э├"╒█Т
|
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
@ -427,7 +427,7 @@ func (this *SceneStateAvengersStart) OnPlayerOp(s *base.Scene, p *base.Player, o
|
|||
//水池设置
|
||||
coinPoolSetting := base.CoinPoolMgr.GetCoinPoolSetting(sceneEx.Platform, sceneEx.GetGameFreeId(), sceneEx.GroupId)
|
||||
//baseRate := coinPoolSetting.GetBaseRate() //基础赔率
|
||||
ctroRate := 500 //调节赔率 暗税系数
|
||||
ctroRate := coinPoolSetting.GetCtrlRate() //调节赔率 暗税系数
|
||||
//if baseRate >= 10000 || baseRate <= 0 || ctroRate < 0 || ctroRate >= 1000 || baseRate+ctroRate > 9900 {
|
||||
// logger.Logger.Warnf("AvengersErrorBaseRate [%v][%v][%v][%v][%v]", sceneEx.GetGameFreeId(), playerEx.SnId, playerEx.spinID, baseRate, ctroRate)
|
||||
// baseRate = 9700
|
||||
|
@ -437,14 +437,14 @@ func (this *SceneStateAvengersStart) OnPlayerOp(s *base.Scene, p *base.Player, o
|
|||
jackpotRate := ctroRate //奖池系数
|
||||
logger.Logger.Tracef("AvengersRates [%v][%v][%v][%v][%v]", sceneEx.GetGameFreeId(), playerEx.SnId, playerEx.spinID, taxRate, ctroRate)
|
||||
|
||||
//playerEx.IsFNovice(sceneEx.KeyGameId)
|
||||
isFoolPlayer := false
|
||||
playerEx.IsFNovice(sceneEx.KeyGameId)
|
||||
isFoolPlayer := playerEx.IsFoolPlayer[sceneEx.KeyGameId]
|
||||
var gamePoolCoin int64
|
||||
//if isFoolPlayer {
|
||||
// gamePoolCoin = base.CoinPoolMgr.GetNoviceCoinPool(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//}
|
||||
if isFoolPlayer {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetNoviceCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
}
|
||||
prizeFund := gamePoolCoin - sceneEx.jackpot.VirtualJK // 除去奖池的水池剩余金额
|
||||
|
||||
// 奖池参数
|
||||
|
@ -462,7 +462,7 @@ func (this *SceneStateAvengersStart) OnPlayerOp(s *base.Scene, p *base.Player, o
|
|||
//p.Statics(sceneEx.KeyGameId, sceneEx.KeyGamefreeId, -totalBetValue, true)
|
||||
if !p.IsRob && !sceneEx.Testing {
|
||||
// 推送金币
|
||||
sceneEx.PushCoinPool(prizeFundAdd, false)
|
||||
sceneEx.PushCoinPool(prizeFundAdd, isFoolPlayer)
|
||||
//base.CoinPoolMgr.PushCoin(sceneEx.GetGameFreeId(), sceneEx.GroupId, sceneEx.Platform, int64(float64(totalBetValue)*(float64(10000-ctroRate)/10000.0)))
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ const (
|
|||
var CoinPoolMgr = &CoinPoolManager{
|
||||
CoinPool: new(sync.Map),
|
||||
ProfitPool: new(sync.Map),
|
||||
NoviceCoinPool: new(sync.Map),
|
||||
CoinPoolSetting: make(map[string]*webapi.CoinPoolSetting),
|
||||
curRunTime: make(map[string]int64),
|
||||
publicPond: new(sync.Map),
|
||||
|
@ -55,6 +56,9 @@ type CoinPoolManager struct {
|
|||
//收益池
|
||||
ProfitPoolDBKey string
|
||||
ProfitPool *sync.Map
|
||||
//新手池
|
||||
NoviceCoinPoolDBKey string
|
||||
NoviceCoinPool *sync.Map
|
||||
|
||||
dirty bool
|
||||
|
||||
|
@ -178,6 +182,20 @@ func (this *CoinPoolManager) getCoinPoolCoin(key string) int64 {
|
|||
return poolCoin
|
||||
}
|
||||
|
||||
// 获取调控池水位
|
||||
func (this *CoinPoolManager) getNoviceCoinPoolCoin(key string) int64 {
|
||||
poolValue, ok := this.NoviceCoinPool.Load(key)
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
poolCoin, ok := poolValue.(int64)
|
||||
if !ok {
|
||||
logger.Logger.Errorf("Error type convert in coinpoolmanager GetNoviceCoin:%v-%v", key, poolValue)
|
||||
return 0
|
||||
}
|
||||
return poolCoin
|
||||
}
|
||||
|
||||
// 减少调控池水位
|
||||
// 返回当前水位
|
||||
func (this *CoinPoolManager) popCoin(key string, coin int64) (bool, int64) {
|
||||
|
@ -210,6 +228,38 @@ func (this *CoinPoolManager) popCoin(key string, coin int64) (bool, int64) {
|
|||
return true, curValue
|
||||
}
|
||||
|
||||
// 减少调控池水位
|
||||
// 返回当前水位
|
||||
func (this *CoinPoolManager) popNoviceCoin(key string, coin int64) (bool, int64) {
|
||||
if this.getCoinPoolSetting(key).GetSwitch() == 1 {
|
||||
return false, 0
|
||||
}
|
||||
|
||||
poolValue, ok := this.NoviceCoinPool.Load(key)
|
||||
if !ok {
|
||||
return false, 0
|
||||
}
|
||||
poolCoin, ok := poolValue.(int64)
|
||||
if !ok {
|
||||
logger.Logger.Errorf("Error type convert in coinpoolmanager popNoviceCoin:%v-%v", key, poolValue)
|
||||
return false, 0
|
||||
}
|
||||
|
||||
//if poolCoin < coin {
|
||||
// return false
|
||||
//}
|
||||
|
||||
curValue := poolCoin - coin
|
||||
if curValue < -99999999 {
|
||||
curValue = -99999999
|
||||
}
|
||||
|
||||
this.NoviceCoinPool.Store(key, curValue)
|
||||
this.dirty = true
|
||||
logger.Logger.Infof("$$$$$$$$新手金币池 %v 取出 %v 金币,现有金币 %v.$$$$$$$$", key, coin, curValue)
|
||||
return true, curValue
|
||||
}
|
||||
|
||||
// 增加调控池水位
|
||||
// 返回当前水位
|
||||
func (this *CoinPoolManager) pushCoin(key string, coin int64) int64 {
|
||||
|
@ -236,6 +286,32 @@ func (this *CoinPoolManager) pushCoin(key string, coin int64) int64 {
|
|||
return poolCoin
|
||||
}
|
||||
|
||||
// 增加调控池水位
|
||||
// 返回当前水位
|
||||
func (this *CoinPoolManager) pushNoviceCoin(key string, coin int64) int64 {
|
||||
if this.getCoinPoolSetting(key).GetSwitch() == 1 {
|
||||
return 0
|
||||
}
|
||||
|
||||
poolValue, ok := this.NoviceCoinPool.Load(key)
|
||||
if !ok {
|
||||
this.NoviceCoinPool.Store(key, coin)
|
||||
this.dirty = true
|
||||
logger.Logger.Infof("$$$$$$$$新手金币池 %v 放入 %v 金币,现有金币 %v.$$$$$$$$", key, coin, coin)
|
||||
return coin
|
||||
}
|
||||
poolCoin, ok := poolValue.(int64)
|
||||
if !ok {
|
||||
logger.Logger.Errorf("NoviceCoin pool push error type value:%v-%v", key, poolValue)
|
||||
return 0
|
||||
}
|
||||
poolCoin += coin
|
||||
this.NoviceCoinPool.Store(key, poolCoin)
|
||||
this.dirty = true
|
||||
logger.Logger.Infof("$$$$$$$$新手金币池 %v 放入 %v 金币,现有金币 %v.$$$$$$$$", key, coin, poolCoin)
|
||||
return poolCoin
|
||||
}
|
||||
|
||||
// PopCoin 减少调控池水位
|
||||
func (this *CoinPoolManager) PopCoin(gameFreeId, groupId int32, platform string, coin int64) bool {
|
||||
if coin == 0 {
|
||||
|
@ -339,7 +415,15 @@ func (this *CoinPoolManager) UpdateCoinPoolSetting(setting *webapi.CoinPoolSetti
|
|||
if initValue != 0 { //初始化水池
|
||||
_, ok := this.CoinPool.Load(key)
|
||||
if !ok {
|
||||
this.pushCoin(key, int64(initValue))
|
||||
this.pushCoin(key, initValue)
|
||||
}
|
||||
}
|
||||
// 新手调控池初始化
|
||||
initValue = setting.GetInitNoviceValue()
|
||||
if initValue != 0 { //初始化水池
|
||||
_, ok := this.NoviceCoinPool.Load(key)
|
||||
if !ok {
|
||||
this.pushNoviceCoin(key, initValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -479,6 +563,18 @@ func (this *CoinPoolManager) Init() {
|
|||
} else {
|
||||
logger.Logger.Error("Unmarshal coin pool error:", err)
|
||||
}
|
||||
// 新手调控池
|
||||
this.NoviceCoinPoolDBKey = fmt.Sprintf("NoviceCoinPoolManager_Srv%v", common.GetSelfSrvId())
|
||||
data = model.GetStrKVGameData(this.NoviceCoinPoolDBKey)
|
||||
noviceCoinPool := make(map[string]int64)
|
||||
err = json.Unmarshal([]byte(data), &noviceCoinPool)
|
||||
if err == nil {
|
||||
for key, value := range noviceCoinPool {
|
||||
this.NoviceCoinPool.Store(key, value)
|
||||
}
|
||||
} else {
|
||||
logger.Logger.Error("Unmarshal novice coin pool error:", err)
|
||||
}
|
||||
// 收益池
|
||||
this.ProfitPoolDBKey = fmt.Sprintf("ProfitPoolManager_Srv%v", common.GetSelfSrvId())
|
||||
data = model.GetStrKVGameData(this.ProfitPoolDBKey)
|
||||
|
@ -525,6 +621,24 @@ func (this *CoinPoolManager) Save(asyn bool) {
|
|||
} else {
|
||||
logger.Logger.Error("Marshal coin pool error:", err)
|
||||
}
|
||||
// 新手调控池
|
||||
coinPool = make(map[string]int64)
|
||||
this.NoviceCoinPool.Range(func(key, value interface{}) bool {
|
||||
coinPool[key.(string)] = value.(int64)
|
||||
return true
|
||||
})
|
||||
buff, err = json.Marshal(coinPool)
|
||||
if err == nil {
|
||||
if asyn {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UptStrKVGameData(this.NoviceCoinPoolDBKey, string(buff))
|
||||
}), nil, "UptStrKVGameData").Start()
|
||||
} else {
|
||||
model.UptStrKVGameData(this.NoviceCoinPoolDBKey, string(buff))
|
||||
}
|
||||
} else {
|
||||
logger.Logger.Error("Marshal novice coin pool error:", err)
|
||||
}
|
||||
// 收益池
|
||||
profitPool := make(map[string]int64)
|
||||
this.ProfitPool.Range(func(key, value interface{}) bool {
|
||||
|
@ -620,29 +734,80 @@ func (this *CoinPoolManager) GetCoinPoolStatesByPlatform(platform string, games
|
|||
return
|
||||
}
|
||||
|
||||
func (this *CoinPoolManager) pushCoinNovice(key string, coin int64) {
|
||||
}
|
||||
|
||||
func (this *CoinPoolManager) popCoinNovice(key string, coin int64) {
|
||||
|
||||
}
|
||||
|
||||
// PushCoinNovice 增加新手池水位
|
||||
func (this *CoinPoolManager) PushCoinNovice(gameFreeId, groupId int32, platform string, coin int64) {
|
||||
if coin == 0 {
|
||||
return
|
||||
}
|
||||
key := this.GenKey(gameFreeId, platform, groupId)
|
||||
this.pushCoinNovice(key, coin)
|
||||
poolVal := coin
|
||||
if coin > 0 { //处理收益池
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting != nil && setting.GetSwitch() == 0 {
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.pushNoviceCoin(key, poolVal)
|
||||
return
|
||||
}
|
||||
|
||||
// PopCoinNovice 减少新手池水位
|
||||
func (this *CoinPoolManager) PopCoinNovice(gameFreeId, groupId int32, platform string, coin int64) {
|
||||
func (this *CoinPoolManager) PopCoinNovice(gameFreeId, groupId int32, platform string, coin int64) bool {
|
||||
if coin == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
key := this.GenKey(gameFreeId, platform, groupId)
|
||||
poolVal := coin
|
||||
if coin < 0 { //负值为收益
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting != nil && setting.GetSwitch() == 0 {
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, -profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
}
|
||||
}
|
||||
ok, _ := this.popNoviceCoin(key, poolVal)
|
||||
if ok {
|
||||
dbGameFree := srvdata.PBDB_GameFreeMgr.GetData(gameFreeId)
|
||||
if dbGameFree != nil && dbGameFree.GetSceneType() != -1 { //非试玩场
|
||||
//保存数据
|
||||
//this.ReportCoinPoolRecEvent(gameFreeId, groupId, platform, -coin, curPoolVal, false)
|
||||
setting := this.GetCoinPoolSetting(platform, gameFreeId, groupId)
|
||||
if setting != nil {
|
||||
poolValue, ok := this.NoviceCoinPool.Load(key)
|
||||
if ok {
|
||||
poolCoin, ok := poolValue.(int64)
|
||||
if ok {
|
||||
if int64(setting.GetLowerLimit()) > poolCoin {
|
||||
WarningCoinPool(Warning_CoinPoolLow, gameFreeId)
|
||||
}
|
||||
|
||||
if poolCoin < 0 {
|
||||
WarningCoinPool(Warning_CoinPoolZero, gameFreeId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetNoviceCoin 获取新手池水位
|
||||
func (this *CoinPoolManager) GetNoviceCoin(gameFreeId int32, platform string, groupId int32) int64 {
|
||||
return 0
|
||||
key := this.GenKey(gameFreeId, platform, groupId)
|
||||
return this.getNoviceCoinPoolCoin(key)
|
||||
}
|
||||
|
||||
// IsMaxOutHaveEnough 判定是否满足出分,out 为负值是出分,正值为收分
|
||||
|
|
|
@ -20,20 +20,22 @@ var (
|
|||
var CoinPoolSettingDatas = make(map[string]*CoinPoolSetting)
|
||||
|
||||
type CoinPoolSetting struct {
|
||||
Id bson.ObjectId `bson:"_id"`
|
||||
Platform string // 平台id
|
||||
GameFreeId int32 // 游戏id
|
||||
GroupId int32 // 组id
|
||||
ServerId int32 // 服务器id
|
||||
InitValue int64 // 初始库存值
|
||||
LowerLimit int64 // 库存下限
|
||||
UpperLimit int64 // 库存上限
|
||||
QuDu int64 // 曲度值
|
||||
UpperOdds int32 // 上线初始概率
|
||||
UpperOddsMax int32 // 上线最大概率
|
||||
LowerOdds int32 // 下线初始概率
|
||||
LowerOddsMax int32 // 下线最大概率
|
||||
ProfitRate int32 // 收益抽取比例
|
||||
Id bson.ObjectId `bson:"_id"`
|
||||
Platform string // 平台id
|
||||
GameFreeId int32 // 游戏id
|
||||
GroupId int32 // 组id
|
||||
ServerId int32 // 服务器id
|
||||
InitValue int64 // 初始库存值
|
||||
LowerLimit int64 // 库存下限
|
||||
UpperLimit int64 // 库存上限
|
||||
QuDu int64 // 曲度值
|
||||
UpperOdds int32 // 上线初始概率
|
||||
UpperOddsMax int32 // 上线最大概率
|
||||
LowerOdds int32 // 下线初始概率
|
||||
LowerOddsMax int32 // 下线最大概率
|
||||
ProfitRate int32 // 收益抽取比例
|
||||
CtrlRate int32 // 调节赔率
|
||||
InitNoviceValue int64 // 新手初始库存值
|
||||
// 扩展参数
|
||||
ResetTime int64 // 重置时间
|
||||
UptTime time.Time // 更新时间
|
||||
|
@ -57,6 +59,8 @@ func NewCoinPoolSetting(platform string, groupId, gamefreeid, srverId int32, db
|
|||
cl.ProfitRate = db.ProfitRate
|
||||
cl.ResetTime = time.Now().Unix()
|
||||
cl.UptTime = time.Now()
|
||||
cl.CtrlRate = db.CtrlRate
|
||||
cl.InitNoviceValue = db.InitNovicValue
|
||||
return cl
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -681,6 +681,10 @@ message DB_GameCoinPool {
|
|||
|
||||
int32 ProfitRate = 10;
|
||||
|
||||
int32 CtrlRate = 11;
|
||||
|
||||
int64 InitNovicValue = 12;
|
||||
|
||||
}
|
||||
|
||||
message DB_GameCoinPoolArray {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -268,12 +268,12 @@ message CoinPoolSetting{
|
|||
int32 LowerOdds = 11; // 下线初始概率
|
||||
int32 LowerOddsMax = 12; // 下线最大概率
|
||||
int32 ProfitRate = 13;//营收比例,千分比
|
||||
// 新增配置
|
||||
int64 ResetTime = 14; // 重置时间
|
||||
int32 Switch =15; // 开关 0开启 1关闭
|
||||
// 水池状态
|
||||
int64 CoinValue = 16; // 当前水位
|
||||
int64 ProfitPool = 17; // 收益池水位
|
||||
int32 CtrlRate = 18; //调节赔率,万分比
|
||||
int64 InitNoviceValue = 19; // 新手池初始库存值
|
||||
}
|
||||
//邮件
|
||||
message MessageInfo {
|
||||
|
|
|
@ -5168,6 +5168,34 @@ func AgcConvertDB_GameCoinPool(fi,fo string) {
|
|||
|
||||
|
||||
|
||||
if len(row.Cells)<12+1{
|
||||
break
|
||||
}
|
||||
|
||||
temp, _ = strconv.ParseInt(row.Cells[12].String(), 10, 32)
|
||||
data.CtrlRate = int32(temp)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if len(row.Cells)<13+1{
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
temp, _ = strconv.ParseInt(row.Cells[13].String(), 10, 64)
|
||||
data.InitNovicValue = int64(temp)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
break
|
||||
}
|
||||
|
|
|
@ -264,21 +264,23 @@ func (this *GameSession) DetectCoinPoolSetting(platform string, gamefreeid, grou
|
|||
this.cps[key] = data
|
||||
//send msg
|
||||
msg := &webapi.CoinPoolSetting{
|
||||
Platform: platform,
|
||||
GameFreeId: gamefreeid,
|
||||
ServerId: srvid,
|
||||
GroupId: groupId,
|
||||
InitValue: data.InitValue,
|
||||
LowerLimit: data.LowerLimit,
|
||||
UpperLimit: data.UpperLimit,
|
||||
QuDu: data.QuDu,
|
||||
UpperOdds: data.UpperOdds,
|
||||
UpperOddsMax: data.UpperOddsMax,
|
||||
LowerOdds: data.LowerOdds,
|
||||
LowerOddsMax: data.LowerOddsMax,
|
||||
ProfitRate: data.ProfitRate,
|
||||
ResetTime: data.ResetTime,
|
||||
Switch: data.Switch,
|
||||
Platform: platform,
|
||||
GameFreeId: gamefreeid,
|
||||
ServerId: srvid,
|
||||
GroupId: groupId,
|
||||
InitValue: data.InitValue,
|
||||
LowerLimit: data.LowerLimit,
|
||||
UpperLimit: data.UpperLimit,
|
||||
QuDu: data.QuDu,
|
||||
UpperOdds: data.UpperOdds,
|
||||
UpperOddsMax: data.UpperOddsMax,
|
||||
LowerOdds: data.LowerOdds,
|
||||
LowerOddsMax: data.LowerOddsMax,
|
||||
ProfitRate: data.ProfitRate,
|
||||
CtrlRate: data.CtrlRate,
|
||||
InitNoviceValue: data.InitNoviceValue,
|
||||
ResetTime: data.ResetTime,
|
||||
Switch: data.Switch,
|
||||
}
|
||||
proto.SetDefaults(msg)
|
||||
this.Send(int(server_proto.SSPacketID_PACKET_WG_COINPOOLSETTING), msg)
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue