custinpay

This commit is contained in:
tomas 2025-03-03 10:48:58 +08:00
parent c420f44577
commit c702e1c786
1 changed files with 33 additions and 19 deletions

View File

@ -59,28 +59,36 @@ type CustomEliminate struct {
WinCoins []int64
MaxWin bool
}
type CustomPay struct {
Pay int64
}
func (s *SugarRushSceneData) EnterResponseFixCoin(Response *cli.SlotsEnterResponse) {
Response.Coin /= sugarrush.NowByte
Response.NodeTree.BetCoin.Coin /= sugarrush.NowByte
for _, node := range Response.NodeTree.Nodes {
node.Win /= sugarrush.NowByte
node.TotalWin /= sugarrush.NowByte
node.ChildrenTotalWin /= sugarrush.NowByte
node.Bet /= sugarrush.NowByte
for k := range Response.NodeTree.Nodes {
Response.NodeTree.Nodes[k].Win /= sugarrush.NowByte
Response.NodeTree.Nodes[k].TotalWin /= sugarrush.NowByte
Response.NodeTree.Nodes[k].ChildrenTotalWin /= sugarrush.NowByte
Response.NodeTree.Nodes[k].Bet /= sugarrush.NowByte
}
for _, feature := range Response.NodeTree.Features {
feature.Win /= sugarrush.NowByte
var customEliminate CustomEliminate
json.Unmarshal([]byte(feature.Custom), &customEliminate)
for k, wincoin := range customEliminate.WinCoins {
customEliminate.WinCoins[k] /= wincoin
for k, feature := range Response.NodeTree.Features {
Response.NodeTree.Features[k].Win /= sugarrush.NowByte
if feature.Type == "sugarrush.CustomEliminate" {
var customEliminate CustomEliminate
json.Unmarshal([]byte(feature.Custom), &customEliminate)
for k, wincoin := range customEliminate.WinCoins {
customEliminate.WinCoins[k] /= wincoin
}
ce, _ := json.Marshal(customEliminate)
Response.NodeTree.Features[k].Custom = string(ce)
} else if feature.Type == "sugarrush.CustomPay" {
var customPay CustomPay
json.Unmarshal([]byte(feature.Custom), &customPay)
customPay.Pay /= sugarrush.NowByte
cp, _ := json.Marshal(customPay)
Response.NodeTree.Features[k].Custom = string(cp)
}
for k, lp := range customEliminate.LinePays {
customEliminate.LinePays[k] /= lp
}
ce, _ := json.Marshal(customEliminate)
feature.Custom = string(ce)
}
}
func (s *SugarRushSceneData) PlayResponseFixCoin(Response *cli.SlotsPlayResponse) {
@ -94,16 +102,22 @@ func (s *SugarRushSceneData) PlayResponseFixCoin(Response *cli.SlotsPlayResponse
node.ChildrenTotalWin /= sugarrush.NowByte
node.Bet /= sugarrush.NowByte
}
for _, feature := range Response.NodeTree.Features {
for k, feature := range Response.NodeTree.Features {
Response.NodeTree.Features[k].Win /= sugarrush.NowByte
if feature.Type == "sugarrush.CustomEliminate" {
feature.Win /= sugarrush.NowByte
var customEliminate CustomEliminate
json.Unmarshal([]byte(feature.Custom), &customEliminate)
for k, wincoin := range customEliminate.WinCoins {
customEliminate.WinCoins[k] /= wincoin
}
ce, _ := json.Marshal(customEliminate)
feature.Custom = string(ce)
Response.NodeTree.Features[k].Custom = string(ce)
} else if feature.Type == "sugarrush.CustomPay" {
var customPay CustomPay
json.Unmarshal([]byte(feature.Custom), &customPay)
customPay.Pay /= sugarrush.NowByte
cp, _ := json.Marshal(customPay)
Response.NodeTree.Features[k].Custom = string(cp)
}
}
}