69 lines
2.4 KiB
Go
69 lines
2.4 KiB
Go
package sugarrush
|
|
|
|
import (
|
|
"mongo.games.com/game/gamerule/sugarrush"
|
|
"mongo.games.com/game/gamesrv/base"
|
|
"mongo.games.com/game/gamesrv/slotspkg/slots"
|
|
)
|
|
|
|
type SugarRushPlayerData struct {
|
|
*base.Player
|
|
base.LabaLog
|
|
leaveTime int32 //离开时间
|
|
SlotsSession *base.SlotsSession
|
|
|
|
BetSizeIndex int64 `json:"bsi"` //选中的单注下标
|
|
BetLevelIndex int64 `json:"bli"` //选中的等级下标
|
|
BetLineIndex int64 `json:"bii"` //选中的线数下标
|
|
BetMode int64 `json:"bm,optional"` //0.常规 1.%125 2.购买
|
|
|
|
taxCoin int64
|
|
winCoin int64
|
|
currentLogId string
|
|
totalBet int64
|
|
|
|
isFree bool //只用于判断是否可以离开
|
|
}
|
|
type LinkPositions struct {
|
|
Positions []int64 `json:"Positions,omitempty"`
|
|
}
|
|
type CustomEliminate struct {
|
|
LinkPositions []*LinkPositions `json:"LinkPositions,omitempty"` //消除的位置
|
|
AppendSymbols [][]int64 `json:"AppendSymbols,omitempty"` //新增
|
|
FormattedSymbols [][]int64 `json:"FormattedSymbols,omitempty"` //最终的结果
|
|
LinePays []float64 `json:"LinePays,omitempty"` //赔付
|
|
WinCoins []float64 `json:"WinCoins,omitempty"` //输赢
|
|
MultiStr string `json:"multi_str,omitempty"`
|
|
MultiStrVal string `json:"multi_str_val,omitempty"`
|
|
SymbolsAbove []int64 `json:"symbols_above,omitempty"`
|
|
SymbolsBelow []int64 `json:"symbols_below,omitempty"`
|
|
}
|
|
type SpinLock struct {
|
|
CustomEliminates []CustomEliminate `json:"CustomEliminates,omitempty"`
|
|
Pay float64 `json:"Pay,omitempty"`
|
|
Multi int64 `json:"Multi,omitempty"`
|
|
SymbolsAbove []int64 `json:"symbols_above,omitempty"`
|
|
SymbolsBelow []int64 `json:"symbols_below,omitempty"`
|
|
}
|
|
|
|
func (p *SugarRushPlayerData) init() {
|
|
p.SlotsSession = base.NewSession(uint64(p.SnId), p.Coin*sugarrush.NowByte)
|
|
}
|
|
func (p *SugarRushPlayerData) Clear() {
|
|
p.taxCoin = 0
|
|
p.winCoin = 0
|
|
p.currentLogId = ""
|
|
p.LabaLog.Clear()
|
|
}
|
|
|
|
// 需要带到world上进行数据处理
|
|
func (p *SugarRushPlayerData) PushPlayer() map[string]string {
|
|
cache := slots.SlotsMgrSington.PushPlayer(p.SlotsSession)
|
|
return cache
|
|
}
|
|
|
|
// 进房的时候需要带进来
|
|
func (p *SugarRushPlayerData) PullPlayer(data map[string]string) {
|
|
slots.SlotsMgrSington.PullPlayer(p.SlotsSession, data)
|
|
}
|