game_sync/gamesrv/fortunetiger/playerdata_fortunetiger.go

55 lines
1.7 KiB
Go

package fortunetiger
import (
"mongo.games.com/game/gamerule/fortunetiger"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/gamesrv/slotspkg/slots"
)
type FortuneTigerPlayerData struct {
*base.Player
leaveTime int32 //离开时间
SlotsSession *base.SlotsSession
BetSizeIndex int64 `json:"bsi"` //选中的单注下标
BetLevelIndex int64 `json:"bli"` //选中的等级下标
BetLineIndex int64 `json:"bii"` //选中的线数下标
BetMode int64 `json:"bm,optional"` //0.常规 1.必中
taxCoin int64
winCoin int64
currentLogId string
totalBet int64
isRespin bool //只用于判断是否可以离开
}
type SpinLock struct {
ReSpinStatus int `json:"rs,omitempty"` //0.默认 1.第一次触发 2.进行中 3.结束
ReSpinSymbol int64 `json:"rsy,omitempty"` //图标(respin)
Lock [][]int `json:"l,omitempty"` //原来锁定的位置
AddLock [][]int `json:"al,omitempty"` //新增锁定的位置
X10 int64 `json:"x10,omitempty"` //100.不同图标 88.wild 其他类型.按当前单一中奖图标类型
WinLines map[int][][]int `json:"wls,omitempty"`
}
func (p *FortuneTigerPlayerData) init() {
p.SlotsSession = base.NewSession(uint64(p.SnId), p.Coin*fortunetiger.NowByte)
}
func (p *FortuneTigerPlayerData) Clear() {
p.taxCoin = 0
p.winCoin = 0
p.currentLogId = ""
}
// 需要带到world上进行数据处理
func (p *FortuneTigerPlayerData) PushPlayer() map[string]string {
cache := slots.SlotsMgrSington.PushPlayer(p.SlotsSession)
return cache
}
// 进房的时候需要带进来
func (p *FortuneTigerPlayerData) PullPlayer(data map[string]string) {
slots.SlotsMgrSington.PullPlayer(p.SlotsSession, data)
}