Documentation ¶
Index ¶
- Constants
- Variables
- func Compare(a []int32, b []int32) bool
- func CompareResult(i, j *types.PBHand) bool
- func Deal(poker *types.PBPoker, rng int64) []int32
- func GetName() string
- func Infos(db dbm.KV, infos *pkt.QueryPBGameInfos) (types.Message, error)
- func Init(name string, sub []byte)
- func Key(id string) (key []byte)
- func Leverage(hand *types.PBHand) int32
- func NewPoker() *types.PBPoker
- func Result(cards []int32) int32
- func Shuffle(poker *types.PBPoker, rng int64)
- type Action
- func (action *Action) CheckExecAccountBalance(fromAddr string, ToFrozen, ToActive int64) bool
- func (action *Action) GameContinue(pbcontinue *pkt.PBGameContinue) (*types.Receipt, error)
- func (action *Action) GamePlay(pbplay *pkt.PBGamePlay) (*types.Receipt, error)
- func (action *Action) GameQuit(pbquit *pkt.PBGameQuit) (*types.Receipt, error)
- func (action *Action) GameStart(start *pkt.PBGameStart) (*types.Receipt, error)
- func (action *Action) GetReceiptLog(game *pkt.PokerBull) *types.ReceiptLog
- type HandSlice
- type PokerBull
- func (g *PokerBull) CheckReceiptExecOk() bool
- func (g *PokerBull) ExecDelLocal_Continue(payload *pkt.PBGameContinue, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *PokerBull) ExecDelLocal_Quit(payload *pkt.PBGameQuit, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (g *PokerBull) ExecDelLocal_Start(payload *pkt.PBGameStart, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *PokerBull) ExecLocal_Continue(payload *pkt.PBGameContinue, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *PokerBull) ExecLocal_Play(payload *pkt.PBGamePlay, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (c *PokerBull) ExecLocal_Quit(payload *pkt.PBGameQuit, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (c *PokerBull) ExecLocal_Start(payload *pkt.PBGameStart, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *PokerBull) Exec_Continue(payload *pkt.PBGameContinue, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *PokerBull) Exec_Play(payload *pkt.PBGamePlay, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *PokerBull) Exec_Quit(payload *pkt.PBGameQuit, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *PokerBull) Exec_Start(payload *pkt.PBGameStart, tx *types.Transaction, index int) (*types.Receipt, error)
- func (g *PokerBull) ExecutorOrder() int64
- func (g *PokerBull) GetDriverName() string
- func (g *PokerBull) Query_QueryGameByAddr(in *pkt.QueryPBGameInfo) (types.Message, error)
- func (g *PokerBull) Query_QueryGameByID(in *pkt.QueryPBGameInfo) (types.Message, error)
- func (g *PokerBull) Query_QueryGameByRound(in *pkt.QueryPBGameByRound) (types.Message, error)
- func (g *PokerBull) Query_QueryGameByStatus(in *pkt.QueryPBGameInfo) (types.Message, error)
- func (g *PokerBull) Query_QueryGameListByIDs(in *pkt.QueryPBGameInfos) (types.Message, error)
Constants ¶
const ( // PokerbullResultX1 赌注倍数1倍 PokerbullResultX1 = 1 // PokerbullResultX2 赌注倍数2倍 PokerbullResultX2 = 2 // PokerbullResultX3 赌注倍数3倍 PokerbullResultX3 = 3 // PokerbullResultX4 赌注倍数4倍 PokerbullResultX4 = 4 // PokerbullResultX5 赌注倍数5倍 PokerbullResultX5 = 5 // PokerbullLeverageMax 赌注倍数最大倍数 PokerbullLeverageMax = PokerbullResultX1 )
Variables ¶
var CardNumPerColor = 13
CardNumPerColor 每种花色的牌数
var CardNumPerGame = 5
CardNumPerGame 一手牌的牌数
var ColorBitMask = 0xFF
ColorBitMask 牌花色bit掩码
var ColorOffset uint32 = 8
ColorOffset 牌花色偏移
var PokerCardNum = 52
PokerCardNum 牌数,4 * 13 不带大小王
Functions ¶
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action 斗牛action结构
func NewAction ¶
func NewAction(pb *PokerBull, tx *types.Transaction, index int) *Action
NewAction 创建action
func (*Action) CheckExecAccountBalance ¶
CheckExecAccountBalance 检查账户余额
func (*Action) GameContinue ¶
GameContinue 继续游戏
func (*Action) GetReceiptLog ¶
func (action *Action) GetReceiptLog(game *pkt.PokerBull) *types.ReceiptLog
GetReceiptLog 获取receipt日志
type PokerBull ¶
type PokerBull struct {
drivers.DriverBase
}
PokerBull 斗牛执行器结构
func (*PokerBull) CheckReceiptExecOk ¶
CheckReceiptExecOk return true to check if receipt ty is ok
func (*PokerBull) ExecDelLocal_Continue ¶
func (g *PokerBull) ExecDelLocal_Continue(payload *pkt.PBGameContinue, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Continue 继续游戏交易回滚
func (*PokerBull) ExecDelLocal_Quit ¶
func (g *PokerBull) ExecDelLocal_Quit(payload *pkt.PBGameQuit, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Quit 退出游戏交易回滚
func (*PokerBull) ExecDelLocal_Start ¶
func (g *PokerBull) ExecDelLocal_Start(payload *pkt.PBGameStart, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Start 开始游戏交易回滚
func (*PokerBull) ExecLocal_Continue ¶
func (c *PokerBull) ExecLocal_Continue(payload *pkt.PBGameContinue, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Continue 继续游戏交易local执行
func (*PokerBull) ExecLocal_Play ¶
func (c *PokerBull) ExecLocal_Play(payload *pkt.PBGamePlay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Play 已匹配游戏交易local执行
func (*PokerBull) ExecLocal_Quit ¶
func (c *PokerBull) ExecLocal_Quit(payload *pkt.PBGameQuit, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Quit 退出游戏交易local执行
func (*PokerBull) ExecLocal_Start ¶
func (c *PokerBull) ExecLocal_Start(payload *pkt.PBGameStart, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Start 开始游戏交易local执行
func (*PokerBull) Exec_Continue ¶
func (c *PokerBull) Exec_Continue(payload *pkt.PBGameContinue, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Continue 继续游戏交易执行
func (*PokerBull) Exec_Play ¶
func (c *PokerBull) Exec_Play(payload *pkt.PBGamePlay, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Play 已匹配玩家直接开始游戏
func (*PokerBull) Exec_Quit ¶
func (c *PokerBull) Exec_Quit(payload *pkt.PBGameQuit, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Quit 退出游戏交易执行
func (*PokerBull) Exec_Start ¶
func (c *PokerBull) Exec_Start(payload *pkt.PBGameStart, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Start 开始游戏交易执行
func (*PokerBull) ExecutorOrder ¶
ExecutorOrder 设置localdb的EnableRead
func (*PokerBull) Query_QueryGameByAddr ¶
Query_QueryGameByAddr 根据地址查询游戏
func (*PokerBull) Query_QueryGameByID ¶
Query_QueryGameByID 根据id查询游戏
func (*PokerBull) Query_QueryGameByRound ¶
Query_QueryGameByRound 查询某一回合游戏结果
func (*PokerBull) Query_QueryGameByStatus ¶
Query_QueryGameByStatus 根据状态查询游戏
func (*PokerBull) Query_QueryGameListByIDs ¶
Query_QueryGameListByIDs 根据id列表查询游戏