拉霸奖池金额数据类型错误

This commit is contained in:
sk 2024-05-17 15:44:48 +08:00
parent 8bdd4f09dc
commit 8fb59d54fc
11 changed files with 48 additions and 44 deletions

View File

@ -2,6 +2,8 @@ package mq
import (
"encoding/json"
"fmt"
"time"
"github.com/astaxie/beego/cache"
"mongo.games.com/goserver/core/broker"
@ -42,25 +44,27 @@ func init() {
return err
}
//name := fmt.Sprintf("%v", log.InviteSnId)
//b := InviteNumCache.Get(name)
//n, _ := b.(int32)
//if n > 0 {
// n++
//} else {
n, err := svc.GetInviteNum(log.Platform, log.InviteSnId)
if err != nil {
logger.Logger.Errorf("BindInviteSnId error:%v", err)
return err
name := fmt.Sprintf("%v", log.InviteSnId)
b := InviteNumCache.Get(name)
n, _ := b.(int32)
if n > 0 {
n++
} else {
n, err = svc.GetInviteNum(log.Platform, log.InviteSnId)
if err != nil {
logger.Logger.Errorf("BindInviteSnId error:%v", err)
return err
}
}
//}
//InviteNumCache.Put(name, n, int64(time.Hour.Seconds()))
InviteNumCache.Put(name, n, int64(time.Hour.Seconds()))
// 更新绑定数量
RabbitMQPublisher.Send(model.AckBindNum, &model.BindNum{
SnId: log.InviteSnId,
Num: n,
})
return
}
return nil
}, broker.Queue(model.EvtBindInvite), broker.DisableAutoAck(), rabbitmq.DurableQueue())

View File

@ -64,7 +64,7 @@ func (this *AvengersSceneData) init() bool {
this.jackpot = &base.SlotJackpotPool{}
if this.jackpot.Small <= 0 {
this.jackpot.Small = 0
this.jackpot.VirtualJK = int64(params[rule.AVENGERS_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore())
this.jackpot.VirtualJK = int64(params[rule.AVENGERS_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore())
}
str := base.SlotsPoolMgr.GetPool(this.GetGameFreeId(), this.Platform)
if str != "" {
@ -288,13 +288,13 @@ func (this *AvengersSceneData) AIBurstJackPot() {
if time.Now().Sub(this.GetLastBurstJackPot()) > 0 {
this.SetLastBurstJackPot()
jackpotParams := this.DbGameFree.GetJackpot()
var jackpotInit = int64(jackpotParams[rule.AVENGERS_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotInit = int64(jackpotParams[rule.AVENGERS_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore()) //奖池初始值
//AI机器人爆奖
val := this.jackpot.VirtualJK
this.jackpot.VirtualJK = jackpotInit
bet := this.DbGameFree.GetBaseScore() * int32(rule.LINENUM)
this.RecordBurstLog(this.RandNickName(), val, int64(bet))
bet := int64(this.DbGameFree.GetBaseScore()) * int64(rule.LINENUM)
this.RecordBurstLog(this.RandNickName(), val, bet)
}
}
func (this *AvengersSceneData) KickPlayerByTime() {

View File

@ -449,7 +449,7 @@ func (this *SceneStateAvengersStart) OnPlayerOp(s *base.Scene, p *base.Player, o
// 奖池参数
jackpotParams := sceneEx.DbGameFree.GetJackpot()
var jackpotInit = int64(jackpotParams[rule.AVENGERS_JACKPOT_InitJackpot] * sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotInit = int64(jackpotParams[rule.AVENGERS_JACKPOT_InitJackpot]) * int64(sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotFundAdd, prizeFundAdd int64 //奖池/水池增量
if playerEx.freeTimes <= 0 { //正常模式才能记录用户的押注变化,免费模式不能改变押注
@ -806,7 +806,7 @@ func (this *SceneStateAvengersStart) BenchTest(s *base.Scene, p *base.Player) {
file.WriteString("玩家id,当前水位,之前余额,之后余额,投入,产出,税收,小游戏,爆奖,中线倍数,中线数,剩余免费次数\r\n")
oldCoin := p.Coin
p.Coin = int64(5000 * s.DbGameFree.GetBaseScore())
p.Coin = 5000 * int64(s.DbGameFree.GetBaseScore())
if playerEx, ok := p.ExtraData.(*AvengersPlayerData); ok {
for i := 0; i < BENCH_CNT; i++ {
startCoin := p.Coin

View File

@ -66,7 +66,7 @@ func (this *CaiShenSceneData) init() bool {
this.jackpot = &base.SlotJackpotPool{}
if this.jackpot.Small <= 0 {
this.jackpot.Small = 0
this.jackpot.VirtualJK = int64(params[rule.CAISHEN_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore())
this.jackpot.VirtualJK = int64(params[rule.CAISHEN_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore())
}
str := base.XSlotsPoolMgr.GetPool(this.GetGameFreeId(), this.Platform)
if str != "" {
@ -288,12 +288,12 @@ func (this *CaiShenSceneData) AIBurstJackPot() {
if time.Now().Sub(this.GetLastBurstJackPot()) > 0 {
this.SetLastBurstJackPot()
jackpotParams := this.DbGameFree.GetJackpot()
var jackpotInit = int64(jackpotParams[rule.CAISHEN_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotInit = int64(jackpotParams[rule.CAISHEN_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore()) //奖池初始值
//AI机器人爆奖
val := this.jackpot.VirtualJK
this.jackpot.VirtualJK = jackpotInit
bet := this.DbGameFree.GetBaseScore() * int32(rule.LINENUM)
bet := int64(this.DbGameFree.GetBaseScore()) * int64(rule.LINENUM)
this.RecordBurstLog(this.RandNickName(), val, int64(bet))
}
}

View File

@ -446,7 +446,7 @@ func (this *SceneStateCaiShenStart) OnPlayerOp(s *base.Scene, p *base.Player, op
// 奖池参数
var jackpotParam = sceneEx.DbGameFree.GetJackpot()
var jackpotInit = int64(jackpotParam[rule.CAISHEN_JACKPOT_InitJackpot] * sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotInit = int64(jackpotParam[rule.CAISHEN_JACKPOT_InitJackpot]) * int64(sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotFundAdd, prizeFundAdd int64
if playerEx.freeTimes <= 0 { //正常模式才能记录用户的押注变化,免费模式不能改变押注
@ -918,7 +918,7 @@ func (this *SceneStateCaiShenStart) MultiplayerBenchTest(s *base.Scene) {
playersFile := make(map[int32]*os.File)
oldCoins := make(map[int32]int64)
hasCoin := int64(1000 * s.DbGameFree.GetBaseScore())
hasCoin := 1000 * int64(s.DbGameFree.GetBaseScore())
robots := make(map[int32]bool)
testPlayers := make(map[int32]*base.Player)
for _, p := range s.Players {
@ -955,12 +955,12 @@ func (this *SceneStateCaiShenStart) MultiplayerBenchTest(s *base.Scene) {
}
}()
totalBet := s.DbGameFree.GetBaseScore() * int32(len(rule.AllBetLines))
totalBet := int64(s.DbGameFree.GetBaseScore()) * int64(len(rule.AllBetLines))
for i := 0; i < BENCH_CNT; i++ {
for snid, p := range testPlayers {
if playerEx, ok := p.ExtraData.(*CaiShenPlayerData); ok {
StartCoin := p.Coin
if StartCoin < int64(totalBet) {
if StartCoin < totalBet {
continue
}
freeTimes := playerEx.freeTimes

View File

@ -60,7 +60,7 @@ func (this *EasterIslandSceneData) init() bool {
this.jackpot = &base.SlotJackpotPool{}
if this.jackpot.Small <= 0 {
this.jackpot.Small = 0
this.jackpot.VirtualJK = int64(params[rule.EL_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore())
this.jackpot.VirtualJK = int64(params[rule.EL_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore())
}
str := base.SlotsPoolMgr.GetPool(this.GetGameFreeId(), this.Platform)
if str != "" {
@ -290,13 +290,13 @@ func (this *EasterIslandSceneData) AIBurstJackPot() {
if time.Now().Sub(this.GetLastBurstJackPot()) > 0 {
this.SetLastBurstJackPot()
jackpotParams := this.DbGameFree.GetJackpot()
var jackpotInit = int64(jackpotParams[rule.EL_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotInit = int64(jackpotParams[rule.EL_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore()) //奖池初始值
//AI机器人爆奖
val := this.jackpot.VirtualJK
this.jackpot.VirtualJK = jackpotInit
bet := this.DbGameFree.GetBaseScore() * int32(rule.LINENUM)
this.RecordBurstLog(this.RandNickName(), val, int64(bet))
bet := int64(this.DbGameFree.GetBaseScore()) * int64(rule.LINENUM)
this.RecordBurstLog(this.RandNickName(), val, bet)
}
}
func (this *EasterIslandSceneData) KickPlayerByTime() {

View File

@ -430,9 +430,9 @@ func (this *SceneStateEasterIslandStart) OnPlayerOp(s *base.Scene, p *base.Playe
} else {
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
}
prizeFund := gamePoolCoin - sceneEx.jackpot.VirtualJK // 除去奖池的水池剩余金额
jackpotParams := sceneEx.DbGameFree.GetJackpot() // 奖池参数
var jackpotInit = int64(jackpotParams[rule.EL_JACKPOT_InitJackpot] * sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
prizeFund := gamePoolCoin - sceneEx.jackpot.VirtualJK // 除去奖池的水池剩余金额
jackpotParams := sceneEx.DbGameFree.GetJackpot() // 奖池参数
var jackpotInit = int64(jackpotParams[rule.EL_JACKPOT_InitJackpot]) * int64(sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotFundAdd, prizeFundAdd int64
if playerEx.freeTimes <= 0 { //正常模式才能记录用户的押注变化,免费模式不能改变押注

View File

@ -67,7 +67,7 @@ func (this *IceAgeSceneData) init() bool {
this.jackpot = &base.SlotJackpotPool{}
if this.jackpot.Small <= 0 {
this.jackpot.Small = 0
this.jackpot.VirtualJK = int64(params[rule.ICEAGE_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore())
this.jackpot.VirtualJK = int64(params[rule.ICEAGE_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore())
}
str := base.SlotsPoolMgr.GetPool(this.GetGameFreeId(), this.GetPlatform())
@ -179,7 +179,7 @@ func (this *IceAgeSceneData) CalcSpinsPrize(cards []int, betLines []int64, distr
if spinRes.TotalPrizeJackpot == 0 { // 第一个爆奖 获取当前奖池所有
prizeJackpot = this.jackpot.VirtualJK
} else { // 之后的爆奖 奖励为奖池初值
prizeJackpot = int64(this.GetDBGameFree().GetJackpot()[rule.ICEAGE_JACKPOT_InitJackpot] * this.GetDBGameFree().GetBaseScore())
prizeJackpot = int64(this.GetDBGameFree().GetJackpot()[rule.ICEAGE_JACKPOT_InitJackpot]) * int64(this.GetDBGameFree().GetBaseScore())
}
prizeJackpot = calcTaxScore(prizeJackpot, &spinRes.TotalTaxScore)
spinRes.TotalPrizeJackpot += prizeJackpot
@ -332,13 +332,13 @@ func (this *IceAgeSceneData) AIBurstJackPot() {
if time.Now().Sub(this.GetLastBurstJackPot()) > 0 {
this.SetLastBurstJackPot()
jackpotParams := this.DbGameFree.GetJackpot()
var jackpotInit = int64(jackpotParams[rule.ICEAGE_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotInit = int64(jackpotParams[rule.ICEAGE_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore()) //奖池初始值
//AI机器人爆奖
val := this.jackpot.VirtualJK
this.jackpot.VirtualJK = jackpotInit
bet := this.DbGameFree.GetBaseScore() * int32(rule.LINENUM)
this.RecordBurstLog(this.RandNickName(), val, int64(bet))
bet := int64(this.DbGameFree.GetBaseScore()) * int64(rule.LINENUM)
this.RecordBurstLog(this.RandNickName(), val, bet)
}
}
func (this *IceAgeSceneData) KickPlayerByTime() {

View File

@ -418,7 +418,7 @@ func (this *SceneStateIceAgeStart) OnPlayerOp(s *base.Scene, p *base.Player, opc
prizeFund := gamePoolCoin - sceneEx.jackpot.VirtualJK // 除去奖池的水池剩余金额
var jackpotParam = sceneEx.GetDBGameFree().GetJackpot() // 奖池参数
var jackpotInit = int64(jackpotParam[rule.ICEAGE_JACKPOT_InitJackpot] * sceneEx.GetDBGameFree().GetBaseScore())
var jackpotInit = int64(jackpotParam[rule.ICEAGE_JACKPOT_InitJackpot]) * int64(sceneEx.GetDBGameFree().GetBaseScore())
var jackpotFundAdd, prizeFundAdd int64 //奖池/水池增量
if playerEx.freeTimes <= 0 { //正常模式才能记录用户的押注变化,免费模式不能改变押注
playerEx.betLines = lineParams // 选线记录
@ -816,7 +816,7 @@ func (this *SceneStateIceAgeStart) BenchTest(s *base.Scene, p *base.Player) {
oldCoin := p.GetCoin()
//p.coin = int64(5000 * s.GetDBGameFree().GetBaseScore())
p.SetCoin(int64(5000 * s.GetDBGameFree().GetBaseScore()))
p.SetCoin(5000 * int64(s.GetDBGameFree().GetBaseScore()))
if playerEx, ok := p.GetExtraData().(*IceAgePlayerData); ok {
for i := 0; i < BENCH_CNT; i++ {
startCoin := p.GetCoin()

View File

@ -59,7 +59,7 @@ func (this *TamQuocSceneData) init() bool {
this.jackpot = &base.SlotJackpotPool{}
if this.jackpot.Small <= 0 {
this.jackpot.Small = 0
this.jackpot.VirtualJK = int64(params[rule.TAMQUOC_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore())
this.jackpot.VirtualJK = int64(params[rule.TAMQUOC_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore())
}
str := base.SlotsPoolMgr.GetPool(this.GetGameFreeId(), this.Platform)
if str != "" {
@ -114,7 +114,7 @@ func (this *TamQuocSceneData) CalcLinePrize(cards []int, betLines []int64, betVa
if spinRes.TotalPrizeJackpot == 0 { // 第一个爆奖 获取当前奖池所有
prizeJackpot = this.jackpot.VirtualJK
} else { // 之后的爆奖 奖励为奖池初值
prizeJackpot = int64(this.DbGameFree.GetJackpot()[rule.TAMQUOC_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore())
prizeJackpot = int64(this.DbGameFree.GetJackpot()[rule.TAMQUOC_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore())
}
prizeJackpot = calcTaxScore(prizeJackpot, &spinRes.TotalTaxScore)
spinRes.TotalPrizeJackpot += prizeJackpot
@ -273,12 +273,12 @@ func (this *TamQuocSceneData) AIBurstJackPot() {
if time.Now().Sub(this.GetLastBurstJackPot()) > 0 {
this.SetLastBurstJackPot()
jackpotParams := this.DbGameFree.GetJackpot()
var jackpotInit = int64(jackpotParams[rule.TAMQUOC_JACKPOT_InitJackpot] * this.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotInit = int64(jackpotParams[rule.TAMQUOC_JACKPOT_InitJackpot]) * int64(this.DbGameFree.GetBaseScore()) //奖池初始值
//AI机器人爆奖
val := this.jackpot.VirtualJK
this.jackpot.VirtualJK = jackpotInit
bet := this.DbGameFree.GetBaseScore() * int32(rule.LINENUM)
bet := int64(this.DbGameFree.GetBaseScore()) * int64(rule.LINENUM)
this.RecordBurstLog(this.RandNickName(), val, int64(bet))
}
}

View File

@ -411,7 +411,7 @@ func (this *SceneStateTamQuocStart) OnPlayerOp(s *base.Scene, p *base.Player, op
// 奖池参数
var jackpotParam = sceneEx.DbGameFree.GetJackpot()
var jackpotInit = int64(jackpotParam[rule.TAMQUOC_JACKPOT_InitJackpot] * sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotInit = int64(jackpotParam[rule.TAMQUOC_JACKPOT_InitJackpot]) * int64(sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
var jackpotFundAdd, prizeFundAdd int64
if playerEx.freeTimes <= 0 { //正常模式才能记录用户的押注变化,免费模式不能改变押注