48 lines
1.2 KiB
Go
48 lines
1.2 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 //只用于判断是否可以离开
|
|
}
|
|
|
|
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)
|
|
}
|