Commit 82b582dc authored by 张振华's avatar 张振华

guess

parent 80bdb1bb
...@@ -5,12 +5,7 @@ ...@@ -5,12 +5,7 @@
package commands package commands
import ( import (
"fmt"
"go.uber.org/zap"
"strconv"
jsonrpc "github.com/33cn/chain33/rpc/jsonclient" jsonrpc "github.com/33cn/chain33/rpc/jsonclient"
"github.com/33cn/chain33/types"
pkt "github.com/33cn/plugin/plugin/dapp/guess/types" pkt "github.com/33cn/plugin/plugin/dapp/guess/types"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -231,7 +226,9 @@ func addGuessQueryFlags(cmd *cobra.Command) { ...@@ -231,7 +226,9 @@ func addGuessQueryFlags(cmd *cobra.Command) {
cmd.Flags().StringP("gameIDs", "d", "", "gameIDs") cmd.Flags().StringP("gameIDs", "d", "", "gameIDs")
} }
func guessQuery(cmd *cobra.Command, args []string) { func guessQuery(cmd *cobra.Command, args []string) {
/*
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
gameID, _ := cmd.Flags().GetString("gameID") gameID, _ := cmd.Flags().GetString("gameID")
address, _ := cmd.Flags().GetString("address") address, _ := cmd.Flags().GetString("address")
...@@ -279,4 +276,5 @@ func guessQuery(cmd *cobra.Command, args []string) { ...@@ -279,4 +276,5 @@ func guessQuery(cmd *cobra.Command, args []string) {
fmt.Println("Error: requeres at least one of gameID, address or status") fmt.Println("Error: requeres at least one of gameID, address or status")
cmd.Help() cmd.Help()
} }
*/
} }
...@@ -6,32 +6,66 @@ package executor ...@@ -6,32 +6,66 @@ package executor
import ( import (
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
pkt "github.com/33cn/plugin/plugin/dapp/pokerbull/types" pkt "github.com/33cn/plugin/plugin/dapp/guess/types"
) )
func (g *PokerBull) rollbackIndex(log *pkt.ReceiptPBGame) (kvs []*types.KeyValue) { func (g *Guess) rollbackIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue) {
kvs = append(kvs, delPBGameStatusAndPlayer(log.Status, log.PlayerNum, log.Value, log.Index)) //新创建游戏,将增加的记录都删除掉
kvs = append(kvs, addPBGameStatusAndPlayer(log.PreStatus, log.PlayerNum, log.PrevIndex, log.Value, log.GameId)) if log.Status == pkt.GuessGameStatusStart{
kvs = append(kvs, delPBGameStatusIndexKey(log.Status, log.Index)) //kvs = append(kvs, addGuessGameAddrIndexKey(log.Status, log.Addr, log.GameId, log.Index))
kvs = append(kvs, addPBGameStatusIndexKey(log.PreStatus, log.GameId, log.PrevIndex)) kvs = append(kvs, delGuessGameStatusIndexKey(log.Status, log.Index))
kvs = append(kvs, delGuessGameAdminIndexKey(log.AdminAddr,log.Index))
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.Index))
kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.Index))
} else if log.Status == pkt.GuessGameStatusBet {
//如果是下注状态,则有用户进行了下注操作,对这些记录进行删除
kvs = append(kvs, delGuessGameAddrIndexKey(log.Addr, log.Index))
kvs = append(kvs, delGuessGameAddrStatusIndexKey(log.Status, log.Addr, log.Index))
for _, v := range log.Players { //如果发生了状态变化,恢复老状态的记录,删除新添加的状态记录
kvs = append(kvs, delPBGameAddrIndexKey(v, log.Index)) if log.StatusChange {
kvs = append(kvs, addPBGameAddrIndexKey(log.PreStatus, v, log.GameId, log.PrevIndex)) kvs = append(kvs, addGuessGameStatusIndexKey(log.PreStatus, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.GameId, log.PreIndex))
kvs = append(kvs, delGuessGameStatusIndexKey(log.Status, log.Index))
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.Index))
kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.Index))
}
}else if log.StatusChange {
//其他状态时的状态发生变化的情况,要将老状态对应的记录恢复,同时删除新加的状态记录;对于每个地址的下注记录也需要遍历处理。
kvs = append(kvs, addGuessGameStatusIndexKey(log.PreStatus, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.GameId, log.PreIndex))
kvs = append(kvs, delGuessGameStatusIndexKey(log.Status, log.Index))
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.Index))
kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.Index))
//从game中遍历每个地址的记录进行删除新增记录,回复老记录
game, err := readGame(g.GetStateDB(), log.GameId)
if err == nil {
for i := 0; i < len(game.Plays); i++ {
player := game.Plays[i]
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.PreStatus, player.Addr, log.GameId, player.Bet.PreIndex))
kvs = append(kvs, delGuessGameAddrStatusIndexKey(log.Status, player.Addr, log.Index)
}
}
} }
return kvs return kvs
} }
func (g *PokerBull) execDelLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) { func (g *Guess) execDelLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{} dbSet := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk { if receiptData.GetTy() != types.ExecOk {
return dbSet, nil return dbSet, nil
} }
for _, log := range receiptData.Logs { for _, log := range receiptData.Logs {
switch log.GetTy() { switch log.GetTy() {
case pkt.TyLogPBGameStart, pkt.TyLogPBGameContinue, pkt.TyLogPBGameQuit: case pkt.TyLogGuessGameStart, pkt.TyLogGuessGameBet, pkt.TyLogGuessGameStopBet, pkt.TyLogGuessGameAbort, pkt.TyLogGuessGamePublish, pkt.TyLogGuessGameTimeout:
receiptGame := &pkt.ReceiptPBGame{} receiptGame := &pkt.ReceiptGuessGame{}
if err := types.Decode(log.Log, receiptGame); err != nil { if err := types.Decode(log.Log, receiptGame); err != nil {
return nil, err return nil, err
} }
...@@ -42,14 +76,18 @@ func (g *PokerBull) execDelLocal(receiptData *types.ReceiptData) (*types.LocalDB ...@@ -42,14 +76,18 @@ func (g *PokerBull) execDelLocal(receiptData *types.ReceiptData) (*types.LocalDB
return dbSet, nil return dbSet, nil
} }
func (g *PokerBull) ExecDelLocal_Start(payload *pkt.PBGameStart, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) { func (g *Guess) ExecDelLocal_Start(payload *pkt.GuessGameStart, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return g.execDelLocal(receiptData) return g.execLocal(receiptData)
} }
func (g *PokerBull) ExecDelLocal_Continue(payload *pkt.PBGameContinue, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) { func (g *Guess) ExecDelLocal_Bet(payload *pkt.GuessGameBet, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return g.execDelLocal(receiptData) return g.execLocal(receiptData)
} }
func (g *PokerBull) ExecDelLocal_Quit(payload *pkt.PBGameQuit, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) { func (g *Guess) ExecDelLocal_Publish(payload *pkt.GuessGamePublish, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return g.execDelLocal(receiptData) return g.execLocal(receiptData)
} }
func (g *Guess) ExecDelLocal_Abort(payload *pkt.GuessGameAbort, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return g.execLocal(receiptData)
}
\ No newline at end of file
...@@ -9,27 +9,28 @@ import ( ...@@ -9,27 +9,28 @@ import (
pkt "github.com/33cn/plugin/plugin/dapp/guess/types" pkt "github.com/33cn/plugin/plugin/dapp/guess/types"
) )
func (c *Guess) updateIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue) { func (g *Guess) updateIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue) {
//新创建游戏 //新创建游戏
if log.Status == pkt.GuessGameStatusStart{ if log.Status == pkt.GuessGameStatusStart{
//kvs = append(kvs, addGuessGameAddrIndexKey(log.Status, log.Addr, log.GameId, log.Index)) //kvs = append(kvs, addGuessGameAddrIndexKey(log.Status, log.Addr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index)) kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAdminIndexKey(log.Status, log.Addr, log.GameId, log.Index)) kvs = append(kvs, addGuessGameAdminIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index)) kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameId, log.Index)) kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameId, log.Index))
} else if log.Status == pkt.GuessGameStatusBet { } else if log.Status == pkt.GuessGameStatusBet {
//如果是下注状态,则有用户进行了下注操作 //如果是下注状态,则有用户进行了下注操作
kvs = append(kvs, addGuessGameAddrIndexKey(log.Status, log.Addr, log.GameId, log.Index)) kvs = append(kvs, addGuessGameAddrIndexKey(log.Status, log.Addr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, log.Addr, log.GameId, log.Index)) kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, log.Addr, log.GameId, log.Index))
//如果发生了状态变化,则是从start->bet,对于老状态的记录进行删除操作,并增加新状态记录
if log.StatusChange {
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameId, log.Index))
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index)) kvs = append(kvs, delGuessGameStatusIndexKey(log.PreStatus, log.PreIndex))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index)) kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.PreIndex))
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, log.Addr, log.GameId, log.Index)) kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.PreIndex))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameId, log.Index)) }
//对于老状态进行删除
kvs = append(kvs, delGuessGameStatusIndexKey(log.PreStatus, log.PreIndex))
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.PreIndex))
kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.PreIndex))
}else if log.StatusChange { }else if log.StatusChange {
//其他状态时的状态发生变化,要将老状态对应的记录删除,同时加入新状态记录;对于每个地址的下注记录也需要遍历处理。 //其他状态时的状态发生变化,要将老状态对应的记录删除,同时加入新状态记录;对于每个地址的下注记录也需要遍历处理。
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index)) kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index))
...@@ -40,17 +41,21 @@ func (c *Guess) updateIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue) { ...@@ -40,17 +41,21 @@ func (c *Guess) updateIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue) {
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.PreIndex)) kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.PreIndex))
kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.PreIndex)) kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.PreIndex))
//从game中遍历每个地址的记录进行新状态记录的增和老状态记录的删除
//从game中遍历每个地址的记录进行新增和删除 game, err := readGame(g.GetStateDB(), log.GameId)
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, log.Addr, log.GameId, log.Index)) if err == nil {
kvs = append(kvs, delGuessGameAddrStatusIndexKey(log.Status, log.Addr, log.Index)) for i := 0; i < len(game.Plays); i++ {
player := game.Plays[i]
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, player.Addr, log.GameId, log.Index))
kvs = append(kvs, delGuessGameAddrStatusIndexKey(log.PreStatus, player.Addr, player.Bet.PreIndex)
}
}
} }
return kvs return kvs
} }
func (c *Guess) execLocal(receipt *types.ReceiptData) (*types.LocalDBSet, error) { func (g *Guess) execLocal(receipt *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{} dbSet := &types.LocalDBSet{}
if receipt.GetTy() != types.ExecOk { if receipt.GetTy() != types.ExecOk {
return dbSet, nil return dbSet, nil
...@@ -63,21 +68,25 @@ func (c *Guess) execLocal(receipt *types.ReceiptData) (*types.LocalDBSet, error) ...@@ -63,21 +68,25 @@ func (c *Guess) execLocal(receipt *types.ReceiptData) (*types.LocalDBSet, error)
if err != nil { if err != nil {
panic(err) //数据错误了,已经被修改了 panic(err) //数据错误了,已经被修改了
} }
kv := c.updateIndex(&Gamelog) kv := g.updateIndex(&Gamelog)
dbSet.KV = append(dbSet.KV, kv...) dbSet.KV = append(dbSet.KV, kv...)
} }
} }
return dbSet, nil return dbSet, nil
} }
func (c *Guess) ExecLocal_Start(payload *pkt.PBGameStart, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) { func (g *Guess) ExecLocal_Start(payload *pkt.GuessGameStart, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return c.execLocal(receiptData) return g.execLocal(receiptData)
} }
func (c *Guess) ExecLocal_Continue(payload *pkt.PBGameContinue, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) { func (g *Guess) ExecLocal_Bet(payload *pkt.GuessGameBet, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return c.execLocal(receiptData) return g.execLocal(receiptData)
} }
func (c *Guess) ExecLocal_Quit(payload *pkt.PBGameQuit, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) { func (g *Guess) ExecLocal_Publish(payload *pkt.GuessGamePublish, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return c.execLocal(receiptData) return g.execLocal(receiptData)
} }
func (g *Guess) ExecLocal_Abort(payload *pkt.GuessGameAbort, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return g.execLocal(receiptData)
}
\ No newline at end of file
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
package executor package executor
import ( import (
"fmt"
log "github.com/33cn/chain33/common/log/log15" log "github.com/33cn/chain33/common/log/log15"
drivers "github.com/33cn/chain33/system/dapp" drivers "github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
...@@ -15,10 +13,6 @@ import ( ...@@ -15,10 +13,6 @@ import (
var logger = log.New("module", "execs.guess") var logger = log.New("module", "execs.guess")
func Init(name string, sub []byte) {
drivers.Register(newGuessGame().GetName(), newGuessGame, types.GetDappFork(driverName, "Enable"))
}
var driverName = pkt.GuessX var driverName = pkt.GuessX
func init() { func init() {
...@@ -26,6 +20,25 @@ func init() { ...@@ -26,6 +20,25 @@ func init() {
ety.InitFuncList(types.ListMethod(&Guess{})) ety.InitFuncList(types.ListMethod(&Guess{}))
} }
type subConfig struct {
ParaRemoteGrpcClient string `json:"paraRemoteGrpcClient"`
}
var cfg subConfig
// Init Guess
func Init(name string, sub []byte) {
driverName := GetName()
if name != driverName {
panic("system dapp can't be rename")
}
if sub != nil {
types.MustDecode(sub, &cfg)
}
drivers.Register(driverName, newGuessGame, types.GetDappFork(driverName, "Enable"))
}
type Guess struct { type Guess struct {
drivers.DriverBase drivers.DriverBase
} }
...@@ -45,186 +58,8 @@ func (g *Guess) GetDriverName() string { ...@@ -45,186 +58,8 @@ func (g *Guess) GetDriverName() string {
return pkt.GuessX return pkt.GuessX
} }
//addr prefix
func calcGuessGameAddrPrefix(addr string) []byte {
key := fmt.Sprintf("LODB-guess-addr:%s:", addr)
return []byte(key)
}
//addr index
func calcGuessGameAddrKey(addr string, index int64) []byte {
key := fmt.Sprintf("LODB-guess-addr:%s:%018d", addr, index)
return []byte(key)
}
//status prefix
func calcGuessGameStatusPrefix(status int32) []byte {
key := fmt.Sprintf("LODB-guess-status-index:%d:", status)
return []byte(key)
}
//status index
func calcGuessGameStatusKey(status int32, index int64) []byte {
key := fmt.Sprintf("LODB-guess-status-index:%d:%018d", status, index)
return []byte(key)
}
//addr status prefix
func calcGuessGameAddrStatusPrefix(addr string, status int32) []byte {
key := fmt.Sprintf("LODB-guess-addr-status-index:%s:%d:", addr, status)
return []byte(key)
}
//addr status index
func calcGuessGameAddrStatusKey(addr string, status int32, index int64) []byte {
key := fmt.Sprintf("LODB-guess-addr-status-index:%s:%d:%018d", addr, status, index)
return []byte(key)
}
//admin prefix
func calcGuessGameAdminPrefix(addr string) []byte {
key := fmt.Sprintf("LODB-guess-admin:%s:", addr)
return []byte(key)
}
//admin index
func calcGuessGameAdminKey(addr string, index int64) []byte {
key := fmt.Sprintf("LODB-guess-admin:%s:%018d", addr, index)
return []byte(key)
}
//admin status prefix
func calcGuessGameAdminStatusPrefix(admin string, status int32) []byte {
key := fmt.Sprintf("LODB-guess-admin-status-index:%s:%d:", admin, status)
return []byte(key)
}
//admin status index
func calcGuessGameAdminStatusKey(admin string, status int32, index int64) []byte {
key := fmt.Sprintf("LODB-guess-admin-status-index:%s:%d:%018d", admin, status, index)
return []byte(key)
}
func calcGuessGameCategoryStatusPrefix(category string, status int32) []byte {
key := fmt.Sprintf("LODB-guess-category-status-index:%s:%d:", category, status)
return []byte(key)
}
func calcGuessGameCategoryStatusKey(category string, status int32, index int64) []byte {
key := fmt.Sprintf("LODB-guess-category-status-index:%s:%d:%018d", category, status, index)
return []byte(key)
}
func addGuessGameAddrIndexKey(status int32, addr, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrKey(addr, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameAddrIndexKey(addr string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrKey(addr, index)
kv.Value = nil
return kv
}
func addGuessGameStatusIndexKey(status int32, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameStatusKey(status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameStatusIndexKey(status int32, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameStatusKey(status, index)
kv.Value = nil
return kv
}
func addGuessGameAddrStatusIndexKey(status int32, addr, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrStatusKey(addr, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameAddrStatusIndexKey(status int32, addr string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrStatusKey(addr, status, index)
kv.Value = nil
return kv
}
func addGuessGameAdminIndexKey(status int32, addr, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminKey(addr, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameAdminIndexKey(addr string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminKey(addr, index)
kv.Value = nil
return kv
}
func addGuessGameAdminStatusIndexKey(status int32, addr, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminStatusKey(addr, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameAdminStatusIndexKey(status int32, addr string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminStatusKey(addr, status, index)
kv.Value = nil
return kv
}
func addGuessGameCategoryStatusIndexKey(status int32, category, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameCategoryStatusKey(category, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameCategoryStatusIndexKey(status int32, category string, index int64) *types.KeyValue { // GetPayloadValue GuessAction
kv := &types.KeyValue{} func (g *Guess) GetPayloadValue() types.Message {
kv.Key = calcGuessGameCategoryStatusKey(category, status, index) return &pkt.GuessGameAction{}
kv.Value = nil
return kv
} }
\ No newline at end of file
...@@ -35,8 +35,6 @@ const ( ...@@ -35,8 +35,6 @@ const (
MinBetTimeoutNum = 8640 //从游戏结束下注开始,一局游戏最少的超时块数 MinBetTimeoutNum = 8640 //从游戏结束下注开始,一局游戏最少的超时块数
MinBetTimeoutInterval = "24h" //从游戏结束下注开始,一局游戏最短的超时时间 MinBetTimeoutInterval = "24h" //从游戏结束下注开始,一局游戏最短的超时时间
MIN_PLAY_VALUE = 10 * types.Coin
//DefaultStyle = pkt.PlayStyleDefault
MinOneBet = 1 MinOneBet = 1
) )
...@@ -101,19 +99,6 @@ func readGame(db dbm.KV, id string) (*pkt.GuessGame, error) { ...@@ -101,19 +99,6 @@ func readGame(db dbm.KV, id string) (*pkt.GuessGame, error) {
return &game, nil return &game, nil
} }
//安全批量查询方式,防止因为脏数据导致查询接口奔溃
func GetGameList(db dbm.KV, values []string) []*pkt.GuessGame {
var games []*pkt.GuessGame
for _, value := range values {
game, err := readGame(db, value)
if err != nil {
continue
}
games = append(games, game)
}
return games
}
func Infos(db dbm.KV, infos *pkt.QueryGuessGameInfos) (types.Message, error) { func Infos(db dbm.KV, infos *pkt.QueryGuessGameInfos) (types.Message, error) {
var games []*pkt.GuessGame var games []*pkt.GuessGame
for i := 0; i < len(infos.GameIds); i++ { for i := 0; i < len(infos.GameIds); i++ {
...@@ -177,24 +162,6 @@ func getGameListByStatus(db dbm.Lister, status int32, index int64) (types.Messag ...@@ -177,24 +162,6 @@ func getGameListByStatus(db dbm.Lister, status int32, index int64) (types.Messag
return &pkt.GuessGameRecords{Records: gameIds}, nil return &pkt.GuessGameRecords{Records: gameIds}, nil
} }
func queryGameListByStatusAndPlayer(db dbm.Lister, stat int32, player int32, value int64) ([]string, error) {
values, err := db.List(calcPBGameStatusAndPlayerPrefix(stat, player, value), nil, DefaultCount, ListDESC)
if err != nil {
return nil, err
}
var gameIds []string
for _, value := range values {
var record pkt.PBGameIndexRecord
err := types.Decode(value, &record)
if err != nil {
continue
}
gameIds = append(gameIds, record.GetGameId())
}
return gameIds, nil
}
func (action *Action) saveGame(game *pkt.GuessGame) (kvset []*types.KeyValue) { func (action *Action) saveGame(game *pkt.GuessGame) (kvset []*types.KeyValue) {
value := types.Encode(game) value := types.Encode(game)
...@@ -241,7 +208,7 @@ func (action *Action) readGame(id string) (*pkt.GuessGame, error) { ...@@ -241,7 +208,7 @@ func (action *Action) readGame(id string) (*pkt.GuessGame, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
var game pkt.PokerBull var game pkt.GuessGame
//decode //decode
err = types.Decode(data, &game) err = types.Decode(data, &game)
if err != nil { if err != nil {
...@@ -250,215 +217,6 @@ func (action *Action) readGame(id string) (*pkt.GuessGame, error) { ...@@ -250,215 +217,6 @@ func (action *Action) readGame(id string) (*pkt.GuessGame, error) {
return &game, nil return &game, nil
} }
func (action *Action) calculate(game *pkt.PokerBull) *pkt.PBResult {
var handS HandSlice
for _, player := range game.Players {
hand := &pkt.PBHand{}
hand.Cards = Deal(game.Poker, player.TxHash) //发牌
hand.Result = Result(hand.Cards) //计算结果
hand.Address = player.Address
//存入玩家数组
player.Hands = append(player.Hands, hand)
//存入临时切片待比大小排序
handS = append(handS, hand)
//为下一个continue状态初始化player
player.Ready = false
}
// 升序排列
if !sort.IsSorted(handS) {
sort.Sort(handS)
}
winner := handS[len(handS)-1]
// 将有序的临时切片加入到结果数组
result := &pkt.PBResult{}
result.Winner = winner.Address
//TODO Dealer:暂时不支持倍数
//result.Leverage = Leverage(winner)
result.Hands = make([]*pkt.PBHand, len(handS))
copy(result.Hands, handS)
game.Results = append(game.Results, result)
return result
}
func (action *Action) calculateDealer(game *pkt.PokerBull) *pkt.PBResult {
var handS HandSlice
var dealer *pkt.PBHand
for _, player := range game.Players {
hand := &pkt.PBHand{}
hand.Cards = Deal(game.Poker, player.TxHash) //发牌
hand.Result = Result(hand.Cards) //计算结果
hand.Address = player.Address
//存入玩家数组
player.Hands = append(player.Hands, hand)
//存入临时切片待比大小排序
handS = append(handS, hand)
//为下一个continue状态初始化player
player.Ready = false
//记录庄家
if player.Address == game.DealerAddr {
dealer = hand
}
}
for _, hand := range handS {
if hand.Address == game.DealerAddr {
continue
}
if CompareResult(hand, dealer) {
hand.IsWin = false
} else {
hand.IsWin = true
hand.Leverage = Leverage(hand)
}
}
// 将有序的临时切片加入到结果数组
result := &pkt.PBResult{}
result.Dealer = game.DealerAddr
result.DealerLeverage = Leverage(dealer)
result.Hands = make([]*pkt.PBHand, len(handS))
copy(result.Hands, handS)
game.Results = append(game.Results, result)
return result
}
func (action *Action) nextDealer(game *pkt.PokerBull) string {
var flag = -1
for i, player := range game.Players {
if player.Address == game.DealerAddr {
flag = i
}
}
if flag == -1 {
logger.Error("Get next dealer failed.")
return game.DealerAddr
}
if flag == len(game.Players)-1 {
return game.Players[0].Address
}
return game.Players[flag+1].Address
}
func (action *Action) settleDealerAccount(lastAddress string, game *pkt.PokerBull) ([]*types.ReceiptLog, []*types.KeyValue, error) {
var logs []*types.ReceiptLog
var kv []*types.KeyValue
result := action.calculateDealer(game)
for _, hand := range result.Hands {
// 最后一名玩家没有冻结
if hand.Address != lastAddress {
receipt, err := action.coinsAccount.ExecActive(hand.Address, action.execaddr, game.GetValue()*POKERBULL_LEVERAGE_MAX)
if err != nil {
logger.Error("GameSettleDealer.ExecActive", "addr", hand.Address, "execaddr", action.execaddr, "amount", game.GetValue(),
"err", err)
return nil, nil, err
}
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
}
//给赢家转账
var receipt *types.Receipt
var err error
if hand.Address != result.Dealer {
if hand.IsWin {
receipt, err = action.coinsAccount.ExecTransfer(result.Dealer, hand.Address, action.execaddr, game.GetValue()*int64(hand.Leverage))
if err != nil {
action.coinsAccount.ExecFrozen(hand.Address, action.execaddr, game.GetValue()) // rollback
logger.Error("GameSettleDealer.ExecTransfer", "addr", hand.Address, "execaddr", action.execaddr,
"amount", game.GetValue()*int64(hand.Leverage), "err", err)
return nil, nil, err
}
} else {
receipt, err = action.coinsAccount.ExecTransfer(hand.Address, result.Dealer, action.execaddr, game.GetValue()*int64(result.DealerLeverage))
if err != nil {
action.coinsAccount.ExecFrozen(hand.Address, action.execaddr, game.GetValue()) // rollback
logger.Error("GameSettleDealer.ExecTransfer", "addr", hand.Address, "execaddr", action.execaddr,
"amount", game.GetValue()*int64(result.DealerLeverage), "err", err)
return nil, nil, err
}
}
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
}
}
game.DealerAddr = action.nextDealer(game)
return logs, kv, nil
}
func (action *Action) settleDefaultAccount(lastAddress string, game *pkt.PokerBull) ([]*types.ReceiptLog, []*types.KeyValue, error) {
var logs []*types.ReceiptLog
var kv []*types.KeyValue
result := action.calculate(game)
for _, player := range game.Players {
// 最后一名玩家没有冻结
if player.Address != lastAddress {
receipt, err := action.coinsAccount.ExecActive(player.GetAddress(), action.execaddr, game.GetValue()*POKERBULL_LEVERAGE_MAX)
if err != nil {
logger.Error("GameSettleDefault.ExecActive", "addr", player.GetAddress(), "execaddr", action.execaddr,
"amount", game.GetValue()*POKERBULL_LEVERAGE_MAX, "err", err)
return nil, nil, err
}
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
}
//给赢家转账
if player.Address != result.Winner {
receipt, err := action.coinsAccount.ExecTransfer(player.Address, result.Winner, action.execaddr, game.GetValue() /**int64(result.Leverage)*/) //TODO Dealer:暂时不支持倍数
if err != nil {
action.coinsAccount.ExecFrozen(result.Winner, action.execaddr, game.GetValue()) // rollback
logger.Error("GameSettleDefault.ExecTransfer", "addr", result.Winner, "execaddr", action.execaddr,
"amount", game.GetValue() /**int64(result.Leverage)*/, "err", err) //TODO Dealer:暂时不支持倍数
return nil, nil, err
}
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
}
}
return logs, kv, nil
}
func (action *Action) settleAccount(lastAddress string, game *pkt.PokerBull) ([]*types.ReceiptLog, []*types.KeyValue, error) {
if DefaultStyle == pkt.PlayStyleDealer {
return action.settleDealerAccount(lastAddress, game)
} else {
return action.settleDefaultAccount(lastAddress, game)
}
}
func (action *Action) genTxRnd(txhash []byte) (int64, error) {
randbyte := make([]byte, 7)
for i := 0; i < 7; i++ {
randbyte[i] = txhash[i]
}
randstr := common.ToHex(randbyte)
randint, err := strconv.ParseInt(randstr, 0, 64)
if err != nil {
return 0, err
}
return randint, nil
}
// 新建一局游戏 // 新建一局游戏
func (action *Action) newGame(gameId string, start *pkt.GuessGameStart) (*pkt.GuessGame, error) { func (action *Action) newGame(gameId string, start *pkt.GuessGameStart) (*pkt.GuessGame, error) {
game := &pkt.GuessGame{ game := &pkt.GuessGame{
...@@ -564,25 +322,6 @@ func (action *Action) GameStart(start *pkt.GuessGameStart) (*types.Receipt, erro ...@@ -564,25 +322,6 @@ func (action *Action) GameStart(start *pkt.GuessGameStart) (*types.Receipt, erro
return &types.Receipt{Ty: types.ExecOk, KV: kv, Logs: logs}, nil return &types.Receipt{Ty: types.ExecOk, KV: kv, Logs: logs}, nil
} }
func getReadyPlayerNum(players []*pkt.PBPlayer) int {
var readyC = 0
for _, player := range players {
if player.Ready {
readyC++
}
}
return readyC
}
func getPlayerFromAddress(players []*pkt.PBPlayer, addr string) *pkt.PBPlayer {
for _, player := range players {
if player.Address == addr {
return player
}
}
return nil
}
func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) { func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) {
var logs []*types.ReceiptLog var logs []*types.ReceiptLog
var kv []*types.KeyValue var kv []*types.KeyValue
...@@ -606,6 +345,8 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) { ...@@ -606,6 +345,8 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) {
if canBet == false { if canBet == false {
var receiptLog *types.ReceiptLog var receiptLog *types.ReceiptLog
if prevStatus != game.Status { if prevStatus != game.Status {
//状态发生了变化,且是变到了不可下注的状态,那么对于所有下注的addr来说,其addr:status主键的数据都需要更新
action.ChangeAllAddrIndex(game)
receiptLog = action.GetReceiptLog(game, true) receiptLog = action.GetReceiptLog(game, true)
} else { } else {
receiptLog = action.GetReceiptLog(game, false) receiptLog = action.GetReceiptLog(game, false)
...@@ -643,7 +384,7 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) { ...@@ -643,7 +384,7 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) {
} }
// 检查余额账户余额 // 检查余额账户余额
checkValue := int64(game.GetOneBet() * pbBet.BetsNum + game.Fee) checkValue := int64(game.GetOneBet() * pbBet.BetsNum)
if !action.CheckExecAccountBalance(action.fromaddr, checkValue, 0) { if !action.CheckExecAccountBalance(action.fromaddr, checkValue, 0) {
logger.Error("GameBet", "addr", action.fromaddr, "execaddr", action.execaddr, "id", logger.Error("GameBet", "addr", action.fromaddr, "execaddr", action.execaddr, "id",
pbBet.GetGameId(), "err", types.ErrNoBalance) pbBet.GetGameId(), "err", types.ErrNoBalance)
...@@ -664,6 +405,8 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) { ...@@ -664,6 +405,8 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) {
var receiptLog *types.ReceiptLog var receiptLog *types.ReceiptLog
if prevStatus != game.Status { if prevStatus != game.Status {
//状态发生变化,更新所有addr对应记录的index
action.ChangeAllAddrIndex(game)
receiptLog = action.GetReceiptLog(game, true) receiptLog = action.GetReceiptLog(game, true)
} else { } else {
receiptLog = action.GetReceiptLog(game, false) receiptLog = action.GetReceiptLog(game, false)
...@@ -739,7 +482,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt ...@@ -739,7 +482,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt
//先遍历所有下注数据,对于输家,转移资金到Admin账户合约地址; //先遍历所有下注数据,对于输家,转移资金到Admin账户合约地址;
for i := 0; i < len(game.Plays); i++ { for i := 0; i < len(game.Plays); i++ {
player := game.Plays[i] player := game.Plays[i]
value := int64(player.Bet.BetsNumber * game.OneBet + game.Fee) value := int64(player.Bet.BetsNumber * game.OneBet)
receipt, err := action.coinsAccount.ExecTransfer(player.Addr, game.AdminAddr, action.execaddr, value) receipt, err := action.coinsAccount.ExecTransfer(player.Addr, game.AdminAddr, action.execaddr, value)
if err != nil { if err != nil {
action.coinsAccount.ExecFrozen(game.AdminAddr, action.execaddr, value) // rollback action.coinsAccount.ExecFrozen(game.AdminAddr, action.execaddr, value) // rollback
...@@ -780,7 +523,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt ...@@ -780,7 +523,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt
//如果设置了手续费专用地址,则将本局游戏收取的手续费转移到专用地址 //如果设置了手续费专用地址,则将本局游戏收取的手续费转移到专用地址
if game.Fee > 0 && len(game.FeeAddr) != 0 && game.FeeAddr != game.AdminAddr { if game.Fee > 0 && len(game.FeeAddr) != 0 && game.FeeAddr != game.AdminAddr {
value := int64(game.Fee * uint32(len(game.Plays)) value := int64(uint32(game.Fee) * uint32(len(game.Plays))
receipt, err := action.coinsAccount.ExecTransfer(game.AdminAddr, game.FeeAddr, action.execaddr, value) receipt, err := action.coinsAccount.ExecTransfer(game.AdminAddr, game.FeeAddr, action.execaddr, value)
if err != nil { if err != nil {
action.coinsAccount.ExecFrozen(game.FeeAddr, action.execaddr, value) // rollback action.coinsAccount.ExecFrozen(game.FeeAddr, action.execaddr, value) // rollback
...@@ -793,6 +536,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt ...@@ -793,6 +536,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt
var receiptLog *types.ReceiptLog var receiptLog *types.ReceiptLog
if prevStatus != game.Status { if prevStatus != game.Status {
action.ChangeAllAddrIndex(game)
receiptLog = action.GetReceiptLog(game, true) receiptLog = action.GetReceiptLog(game, true)
} else { } else {
receiptLog = action.GetReceiptLog(game, false) receiptLog = action.GetReceiptLog(game, false)
...@@ -837,7 +581,7 @@ func (action *Action) GameAbort(pbend *pkt.GuessGameAbort) (*types.Receipt, erro ...@@ -837,7 +581,7 @@ func (action *Action) GameAbort(pbend *pkt.GuessGameAbort) (*types.Receipt, erro
//激活冻结账户 //激活冻结账户
for i := 0; i < len(game.Plays); i++ { for i := 0; i < len(game.Plays); i++ {
player := game.Plays[i] player := game.Plays[i]
value := int64(player.Bet.BetsNumber * game.OneBet + game.Fee) value := int64(player.Bet.BetsNumber * game.OneBet + uint32(game.Fee))
receipt, err := action.coinsAccount.ExecActive(player.Addr, action.execaddr, value) receipt, err := action.coinsAccount.ExecActive(player.Addr, action.execaddr, value)
if err != nil { if err != nil {
logger.Error("GameAbort", "addr", player.Addr, "execaddr", action.execaddr, "amount", value, "err", err) logger.Error("GameAbort", "addr", player.Addr, "execaddr", action.execaddr, "amount", value, "err", err)
...@@ -854,6 +598,9 @@ func (action *Action) GameAbort(pbend *pkt.GuessGameAbort) (*types.Receipt, erro ...@@ -854,6 +598,9 @@ func (action *Action) GameAbort(pbend *pkt.GuessGameAbort) (*types.Receipt, erro
action.ChangeStatus(game, pkt.GuessGameStatusAbort) action.ChangeStatus(game, pkt.GuessGameStatusAbort)
} }
//状态发生变化,统一更新所有addr记录的index
action.ChangeAllAddrIndex(game)
receiptLog := action.GetReceiptLog(game, true) receiptLog := action.GetReceiptLog(game, true)
logs = append(logs, receiptLog) logs = append(logs, receiptLog)
kv = append(kv, action.saveGame(game)...) kv = append(kv, action.saveGame(game)...)
...@@ -888,7 +635,7 @@ func IsLegalOption(options []string, option string) bool { ...@@ -888,7 +635,7 @@ func IsLegalOption(options []string, option string) bool {
return false return false
} }
func (action *Action) ChangeStatus(game *pkt.GuessGame, destStatus uint32) { func (action *Action) ChangeStatus(game *pkt.GuessGame, destStatus int32) {
if game.Status != destStatus { if game.Status != destStatus {
game.PreStatus = game.Status game.PreStatus = game.Status
game.PreIndex = game.Index game.PreIndex = game.Index
...@@ -898,6 +645,15 @@ func (action *Action) ChangeStatus(game *pkt.GuessGame, destStatus uint32) { ...@@ -898,6 +645,15 @@ func (action *Action) ChangeStatus(game *pkt.GuessGame, destStatus uint32) {
return return
} }
func (action *Action) ChangeAllAddrIndex(game *pkt.GuessGame) {
for i := 0; i < len(game.Plays) ; i++ {
player := game.Plays[i]
player.Bet.PreIndex = player.Bet.Index
player.Bet.Index = game.Index
}
}
func (action *Action) RefreshStatusByTime(game *pkt.GuessGame) (canBet bool) { func (action *Action) RefreshStatusByTime(game *pkt.GuessGame) (canBet bool) {
// 检查区块高度是否超过最大下注高度限制,看是否可以下注 // 检查区块高度是否超过最大下注高度限制,看是否可以下注
if game.GetMaxHeight() <= action.height { if game.GetMaxHeight() <= action.height {
......
package executor
import (
"fmt"
"github.com/33cn/chain33/types"
pkt "github.com/33cn/plugin/plugin/dapp/guess/types"
)
//addr prefix
func calcGuessGameAddrPrefix(addr string) []byte {
key := fmt.Sprintf("LODB-guess-addr:%s:", addr)
return []byte(key)
}
//addr index
func calcGuessGameAddrKey(addr string, index int64) []byte {
key := fmt.Sprintf("LODB-guess-addr:%s:%018d", addr, index)
return []byte(key)
}
//status prefix
func calcGuessGameStatusPrefix(status int32) []byte {
key := fmt.Sprintf("LODB-guess-status-index:%d:", status)
return []byte(key)
}
//status index
func calcGuessGameStatusKey(status int32, index int64) []byte {
key := fmt.Sprintf("LODB-guess-status-index:%d:%018d", status, index)
return []byte(key)
}
//addr status prefix
func calcGuessGameAddrStatusPrefix(addr string, status int32) []byte {
key := fmt.Sprintf("LODB-guess-addr-status-index:%s:%d:", addr, status)
return []byte(key)
}
//addr status index
func calcGuessGameAddrStatusKey(addr string, status int32, index int64) []byte {
key := fmt.Sprintf("LODB-guess-addr-status-index:%s:%d:%018d", addr, status, index)
return []byte(key)
}
//admin prefix
func calcGuessGameAdminPrefix(addr string) []byte {
key := fmt.Sprintf("LODB-guess-admin:%s:", addr)
return []byte(key)
}
//admin index
func calcGuessGameAdminKey(addr string, index int64) []byte {
key := fmt.Sprintf("LODB-guess-admin:%s:%018d", addr, index)
return []byte(key)
}
//admin status prefix
func calcGuessGameAdminStatusPrefix(admin string, status int32) []byte {
key := fmt.Sprintf("LODB-guess-admin-status-index:%s:%d:", admin, status)
return []byte(key)
}
//admin status index
func calcGuessGameAdminStatusKey(admin string, status int32, index int64) []byte {
key := fmt.Sprintf("LODB-guess-admin-status-index:%s:%d:%018d", admin, status, index)
return []byte(key)
}
func calcGuessGameCategoryStatusPrefix(category string, status int32) []byte {
key := fmt.Sprintf("LODB-guess-category-status-index:%s:%d:", category, status)
return []byte(key)
}
func calcGuessGameCategoryStatusKey(category string, status int32, index int64) []byte {
key := fmt.Sprintf("LODB-guess-category-status-index:%s:%d:%018d", category, status, index)
return []byte(key)
}
func addGuessGameAddrIndexKey(status int32, addr, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrKey(addr, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameAddrIndexKey(addr string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrKey(addr, index)
kv.Value = nil
return kv
}
func addGuessGameStatusIndexKey(status int32, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameStatusKey(status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameStatusIndexKey(status int32, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameStatusKey(status, index)
kv.Value = nil
return kv
}
func addGuessGameAddrStatusIndexKey(status int32, addr, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrStatusKey(addr, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameAddrStatusIndexKey(status int32, addr string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrStatusKey(addr, status, index)
kv.Value = nil
return kv
}
func addGuessGameAdminIndexKey(status int32, addr, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminKey(addr, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameAdminIndexKey(addr string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminKey(addr, index)
kv.Value = nil
return kv
}
func addGuessGameAdminStatusIndexKey(status int32, addr, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminStatusKey(addr, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameAdminStatusIndexKey(status int32, addr string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminStatusKey(addr, status, index)
kv.Value = nil
return kv
}
func addGuessGameCategoryStatusIndexKey(status int32, category, gameID string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameCategoryStatusKey(category, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
Status: status,
Index: index,
}
kv.Value = types.Encode(record)
return kv
}
func delGuessGameCategoryStatusIndexKey(status int32, category string, index int64) *types.KeyValue {
kv := &types.KeyValue{}
kv.Key = calcGuessGameCategoryStatusKey(category, status, index)
kv.Value = nil
return kv
}
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
pkt "github.com/33cn/plugin/plugin/dapp/guess/types" pkt "github.com/33cn/plugin/plugin/dapp/guess/types"
) )
func (g *Guess) Query_QueryGameListByIds(in *pkt.QueryGuessGameInfos) (types.Message, error) { func (g *Guess) Query_QueryGamesByIds(in *pkt.QueryGuessGameInfos) (types.Message, error) {
return Infos(g.GetStateDB(), in) return Infos(g.GetStateDB(), in)
} }
...@@ -18,7 +18,7 @@ func (g *Guess) Query_QueryGameById(in *pkt.QueryGuessGameInfo) (types.Message, ...@@ -18,7 +18,7 @@ func (g *Guess) Query_QueryGameById(in *pkt.QueryGuessGameInfo) (types.Message,
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &pkt.ReplyGuessGameInfo{game}, nil return &pkt.ReplyGuessGameInfo{Game: game}, nil
} }
func (g *Guess) Query_QueryGameByAddr(in *pkt.QueryGuessGameInfo) (types.Message, error) { func (g *Guess) Query_QueryGameByAddr(in *pkt.QueryGuessGameInfo) (types.Message, error) {
......
...@@ -7,8 +7,8 @@ package types; ...@@ -7,8 +7,8 @@ package types;
//竞猜游戏内容 //竞猜游戏内容
message GuessGame { message GuessGame {
string gameId = 1; //游戏ID string gameId = 1; //游戏ID
uint32 status = 2; //游戏的状态:创建->投注->截止投注->开奖 int32 status = 2; //游戏的状态:创建->投注->截止投注->开奖
uint32 preStatus = 3; int32 preStatus = 3;
int64 startTime = 4; //创建游戏的时间 int64 startTime = 4; //创建游戏的时间
string startTxHash = 5; //创建游戏的交易hash string startTxHash = 5; //创建游戏的交易hash
string topic = 6; //主题 string topic = 6; //主题
...@@ -21,7 +21,7 @@ message GuessGame { ...@@ -21,7 +21,7 @@ message GuessGame {
uint32 oneBet = 13; //一注等于多少bty或者token uint32 oneBet = 13; //一注等于多少bty或者token
uint32 maxBets = 14; //单次可以下多少注,默认100 uint32 maxBets = 14; //单次可以下多少注,默认100
uint32 maxBetsNumber = 15; //最多可以下多少注 uint32 maxBetsNumber = 15; //最多可以下多少注
uint64 fee = 16; //收取费用,不带则表示不收费 int64 fee = 16; //收取费用,不带则表示不收费
string feeAddr = 17; //收费地址 string feeAddr = 17; //收费地址
string expire = 18; //游戏过期时间 string expire = 18; //游戏过期时间
int64 expireHeight = 19; //游戏过期区块高度 int64 expireHeight = 19; //游戏过期区块高度
...@@ -60,90 +60,6 @@ message GuessBetStatItem { ...@@ -60,90 +60,6 @@ message GuessBetStatItem {
uint32 betsTimes = 3; uint32 betsTimes = 3;
} }
//斗牛游戏内容
message PokerBull {
string gameId = 1; //默认是由创建这局游戏的txHash作为gameId
int32 status = 2; // Start 1 -> Continue 2 -> Quit 3
int64 startTime = 3; //开始时间
string startTxHash = 4; //游戏启动交易hash
int64 value = 5; //赌注
PBPoker poker = 6; //扑克牌
repeated PBPlayer players = 7; //玩家历史牌和结果集
int32 playerNum = 8; //玩家数
repeated PBResult results = 9; //游戏结果集
int64 index = 10; //索引
int64 prevIndex = 11; //上级索引
int64 quitTime = 12; //游戏结束时间
string quitTxHash = 13; //游戏结束交易hash
string dealerAddr = 14; //下局庄家地址
bool isWaiting = 15; //游戏是否处于等待状态
int32 preStatus = 16; //上一index的状态
}
//一把牌
message PBHand {
repeated int32 cards = 1; //一把牌,五张
int32 result = 2; //斗牛结果 (没牛:0, 牛1-9:1-9, 牛牛:10)
string address = 3; //玩家地址
bool isWin = 4; //是否赢庄家
int32 leverage = 5; //赌注倍数
}
//玩家
message PBPlayer {
repeated PBHand hands = 1; //历史发牌和斗牛结果
string address = 2; //玩家地址
int64 txHash = 3; //发牌随机数因子txhash的整数格式
bool ready = 4; // continue状态下,是否ready
}
//本局游戏结果
message PBResult {
repeated PBHand hands = 1; //本局所有玩家的牌和结果,按牛大小升序排序
string winner = 2; //赢家地址
int32 leverage = 3; //赢得赌注倍数
string dealer = 4; //庄家
int32 dealerLeverage = 5; //庄家赌注倍数
}
//扑克牌
message PBPoker {
repeated int32 cards = 1; // 52张牌
int32 pointer = 2; //已发牌偏移
}
//游戏状态
message PBGameAction {
oneof value {
PBGameStart start = 1;
PBGameContinue continue = 2;
PBGameQuit quit = 3;
PBGameQuery query = 4;
}
int32 ty = 10;
}
//游戏启动
message PBGameStart {
int64 value = 1;
int32 playerNum = 2;
}
//游戏继续
message PBGameContinue {
string gameId = 1;
}
//游戏结束
message PBGameQuit {
string gameId = 1;
}
//查询游戏结果
message PBGameQuery {
string gameId = 1;
}
//游戏状态 //游戏状态
message GuessGameAction { message GuessGameAction {
oneof value { oneof value {
...@@ -168,7 +84,7 @@ message GuessGameStart{ ...@@ -168,7 +84,7 @@ message GuessGameStart{
uint32 oneBet = 8; uint32 oneBet = 8;
uint32 maxBets = 9; uint32 maxBets = 9;
uint32 maxBetsNumber = 10; uint32 maxBetsNumber = 10;
uint64 fee = 11; int64 fee = 11;
string feeAddr = 12; string feeAddr = 12;
string expire = 13; string expire = 13;
int64 expireHeight = 14; int64 expireHeight = 14;
...@@ -179,66 +95,29 @@ message GuessGameBet{ ...@@ -179,66 +95,29 @@ message GuessGameBet{
string gameId = 1; string gameId = 1;
string option = 2; string option = 2;
uint32 betsNum = 3; uint32 betsNum = 3;
int64 fee = 4;
} }
//游戏异常终止,退还下注 //游戏异常终止,退还下注
message GuessGameAbort{ message GuessGameAbort{
string gameId = 1; string gameId = 1;
int64 fee = 2;
} }
//游戏结果揭晓 //游戏结果揭晓
message GuessGamePublish{ message GuessGamePublish{
string gameId = 1; string gameId = 1;
string result = 2; string result = 2;
int64 fee = 3;
} }
//查询游戏结果 //查询游戏结果
message GuessGameQuery{ message GuessGameQuery{
string gameId = 1; string gameId = 1;
uint32 ty = 2; uint32 ty = 2;
int64 fee = 3;
} }
//根据状态和游戏人数查找
message QueryPBGameListByStatusAndPlayerNum {
int32 status = 1;
int32 playerNum = 2;
int64 index = 3;
}
// 索引value值
message PBGameRecord {
string gameId = 1;
int32 status = 2;
int64 index = 3;
}
message PBGameIndexRecord {
string gameId = 1;
int64 index = 2;
}
message PBGameRecords {
repeated PBGameRecord records = 1;
}
message QueryPBGameInfo {
string gameId = 1;
string addr = 2;
int32 status = 3;
int64 index = 4;
}
message ReplyPBGame {
PokerBull game = 1;
}
message QueryPBGameInfos {
repeated string gameIds = 1;
}
message ReplyPBGameList {
repeated PokerBull games = 1;
}
message QueryGuessGameInfo { message QueryGuessGameInfo {
string gameId = 1; string gameId = 1;
...@@ -259,23 +138,10 @@ message ReplyGuessGameInfos { ...@@ -259,23 +138,10 @@ message ReplyGuessGameInfos {
repeated GuessGame games = 1; repeated GuessGame games = 1;
} }
message ReceiptPBGame {
string gameId = 1;
int32 status = 2;
string addr = 3;
int64 index = 4;
int64 prevIndex = 5;
int32 playerNum = 6;
int64 value = 7;
bool isWaiting = 8;
repeated string players = 9;
int32 preStatus = 10;
}
message ReceiptGuessGame { message ReceiptGuessGame {
string gameId = 1; string gameId = 1;
uint32 preStatus = 2; int32 preStatus = 2;
uint32 status = 3; int32 status = 3;
string addr = 4; string addr = 4;
string adminAddr = 5; string adminAddr = 5;
int64 preIndex = 6; int64 preIndex = 6;
...@@ -316,23 +182,6 @@ message GuessPublishTxReq { ...@@ -316,23 +182,6 @@ message GuessPublishTxReq {
string result = 2; string result = 2;
} }
message PBContinueTxReq {
string gameId = 1;
int64 fee = 2;
}
message PBQuitTxReq {
string gameId = 1;
int64 fee = 2;
}
message PBQueryReq {
string gameId = 1;
int64 fee = 2;
}
// 索引value值 // 索引value值
message GuessGameRecord { message GuessGameRecord {
string gameId = 1; string gameId = 1;
......
...@@ -93,7 +93,8 @@ func (c *Jrpc) GuessPublishTx(parm *pb.GuessPublishTxReq, result *interface{}) e ...@@ -93,7 +93,8 @@ func (c *Jrpc) GuessPublishTx(parm *pb.GuessPublishTxReq, result *interface{}) e
return nil return nil
} }
func (c *Jrpc) GuessQueryTx(parm *pb.PBQueryReq, result *interface{}) error { /*
func (c *Jrpc) GuessQueryTx(parm *pb.GuessQueryReq, result *interface{}) error {
if parm == nil { if parm == nil {
return types.ErrInvalidParam return types.ErrInvalidParam
} }
...@@ -107,4 +108,4 @@ func (c *Jrpc) GuessQueryTx(parm *pb.PBQueryReq, result *interface{}) error { ...@@ -107,4 +108,4 @@ func (c *Jrpc) GuessQueryTx(parm *pb.PBQueryReq, result *interface{}) error {
*result = hex.EncodeToString(reply.Data) *result = hex.EncodeToString(reply.Data)
return nil return nil
} }*/
...@@ -26,17 +26,6 @@ const ( ...@@ -26,17 +26,6 @@ const (
) )
const ( const (
PlayStyleDefault = iota + 1
PlayStyleDealer
)
const (
//log for PBgame
TyLogPBGameStart = 721
TyLogPBGameContinue = 722
TyLogPBGameQuit = 723
TyLogPBGameQuery = 724
TyLogGuessGameStart = 901 TyLogGuessGameStart = 901
TyLogGuessGameBet = 902 TyLogGuessGameBet = 902
TyLogGuessGameStopBet = 903 TyLogGuessGameStopBet = 903
......
...@@ -26,8 +26,8 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package ...@@ -26,8 +26,8 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
//竞猜游戏内容 //竞猜游戏内容
type GuessGame struct { type GuessGame struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"` GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Status uint32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
PreStatus uint32 `protobuf:"varint,3,opt,name=preStatus,proto3" json:"preStatus,omitempty"` PreStatus int32 `protobuf:"varint,3,opt,name=preStatus,proto3" json:"preStatus,omitempty"`
StartTime int64 `protobuf:"varint,4,opt,name=startTime,proto3" json:"startTime,omitempty"` StartTime int64 `protobuf:"varint,4,opt,name=startTime,proto3" json:"startTime,omitempty"`
StartTxHash string `protobuf:"bytes,5,opt,name=startTxHash,proto3" json:"startTxHash,omitempty"` StartTxHash string `protobuf:"bytes,5,opt,name=startTxHash,proto3" json:"startTxHash,omitempty"`
Topic string `protobuf:"bytes,6,opt,name=topic,proto3" json:"topic,omitempty"` Topic string `protobuf:"bytes,6,opt,name=topic,proto3" json:"topic,omitempty"`
...@@ -40,7 +40,7 @@ type GuessGame struct { ...@@ -40,7 +40,7 @@ type GuessGame struct {
OneBet uint32 `protobuf:"varint,13,opt,name=oneBet,proto3" json:"oneBet,omitempty"` OneBet uint32 `protobuf:"varint,13,opt,name=oneBet,proto3" json:"oneBet,omitempty"`
MaxBets uint32 `protobuf:"varint,14,opt,name=maxBets,proto3" json:"maxBets,omitempty"` MaxBets uint32 `protobuf:"varint,14,opt,name=maxBets,proto3" json:"maxBets,omitempty"`
MaxBetsNumber uint32 `protobuf:"varint,15,opt,name=maxBetsNumber,proto3" json:"maxBetsNumber,omitempty"` MaxBetsNumber uint32 `protobuf:"varint,15,opt,name=maxBetsNumber,proto3" json:"maxBetsNumber,omitempty"`
Fee uint64 `protobuf:"varint,16,opt,name=fee,proto3" json:"fee,omitempty"` Fee int64 `protobuf:"varint,16,opt,name=fee,proto3" json:"fee,omitempty"`
FeeAddr string `protobuf:"bytes,17,opt,name=feeAddr,proto3" json:"feeAddr,omitempty"` FeeAddr string `protobuf:"bytes,17,opt,name=feeAddr,proto3" json:"feeAddr,omitempty"`
Expire string `protobuf:"bytes,18,opt,name=expire,proto3" json:"expire,omitempty"` Expire string `protobuf:"bytes,18,opt,name=expire,proto3" json:"expire,omitempty"`
ExpireHeight int64 `protobuf:"varint,19,opt,name=expireHeight,proto3" json:"expireHeight,omitempty"` ExpireHeight int64 `protobuf:"varint,19,opt,name=expireHeight,proto3" json:"expireHeight,omitempty"`
...@@ -88,14 +88,14 @@ func (m *GuessGame) GetGameId() string { ...@@ -88,14 +88,14 @@ func (m *GuessGame) GetGameId() string {
return "" return ""
} }
func (m *GuessGame) GetStatus() uint32 { func (m *GuessGame) GetStatus() int32 {
if m != nil { if m != nil {
return m.Status return m.Status
} }
return 0 return 0
} }
func (m *GuessGame) GetPreStatus() uint32 { func (m *GuessGame) GetPreStatus() int32 {
if m != nil { if m != nil {
return m.PreStatus return m.PreStatus
} }
...@@ -186,7 +186,7 @@ func (m *GuessGame) GetMaxBetsNumber() uint32 { ...@@ -186,7 +186,7 @@ func (m *GuessGame) GetMaxBetsNumber() uint32 {
return 0 return 0
} }
func (m *GuessGame) GetFee() uint64 { func (m *GuessGame) GetFee() int64 {
if m != nil { if m != nil {
return m.Fee return m.Fee
} }
...@@ -499,811 +499,6 @@ func (m *GuessBetStatItem) GetBetsTimes() uint32 { ...@@ -499,811 +499,6 @@ func (m *GuessBetStatItem) GetBetsTimes() uint32 {
return 0 return 0
} }
//斗牛游戏内容
type PokerBull struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
StartTime int64 `protobuf:"varint,3,opt,name=startTime,proto3" json:"startTime,omitempty"`
StartTxHash string `protobuf:"bytes,4,opt,name=startTxHash,proto3" json:"startTxHash,omitempty"`
Value int64 `protobuf:"varint,5,opt,name=value,proto3" json:"value,omitempty"`
Poker *PBPoker `protobuf:"bytes,6,opt,name=poker,proto3" json:"poker,omitempty"`
Players []*PBPlayer `protobuf:"bytes,7,rep,name=players,proto3" json:"players,omitempty"`
PlayerNum int32 `protobuf:"varint,8,opt,name=playerNum,proto3" json:"playerNum,omitempty"`
Results []*PBResult `protobuf:"bytes,9,rep,name=results,proto3" json:"results,omitempty"`
Index int64 `protobuf:"varint,10,opt,name=index,proto3" json:"index,omitempty"`
PrevIndex int64 `protobuf:"varint,11,opt,name=prevIndex,proto3" json:"prevIndex,omitempty"`
QuitTime int64 `protobuf:"varint,12,opt,name=quitTime,proto3" json:"quitTime,omitempty"`
QuitTxHash string `protobuf:"bytes,13,opt,name=quitTxHash,proto3" json:"quitTxHash,omitempty"`
DealerAddr string `protobuf:"bytes,14,opt,name=dealerAddr,proto3" json:"dealerAddr,omitempty"`
IsWaiting bool `protobuf:"varint,15,opt,name=isWaiting,proto3" json:"isWaiting,omitempty"`
PreStatus int32 `protobuf:"varint,16,opt,name=preStatus,proto3" json:"preStatus,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PokerBull) Reset() { *m = PokerBull{} }
func (m *PokerBull) String() string { return proto.CompactTextString(m) }
func (*PokerBull) ProtoMessage() {}
func (*PokerBull) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{5}
}
func (m *PokerBull) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PokerBull.Unmarshal(m, b)
}
func (m *PokerBull) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PokerBull.Marshal(b, m, deterministic)
}
func (m *PokerBull) XXX_Merge(src proto.Message) {
xxx_messageInfo_PokerBull.Merge(m, src)
}
func (m *PokerBull) XXX_Size() int {
return xxx_messageInfo_PokerBull.Size(m)
}
func (m *PokerBull) XXX_DiscardUnknown() {
xxx_messageInfo_PokerBull.DiscardUnknown(m)
}
var xxx_messageInfo_PokerBull proto.InternalMessageInfo
func (m *PokerBull) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
func (m *PokerBull) GetStatus() int32 {
if m != nil {
return m.Status
}
return 0
}
func (m *PokerBull) GetStartTime() int64 {
if m != nil {
return m.StartTime
}
return 0
}
func (m *PokerBull) GetStartTxHash() string {
if m != nil {
return m.StartTxHash
}
return ""
}
func (m *PokerBull) GetValue() int64 {
if m != nil {
return m.Value
}
return 0
}
func (m *PokerBull) GetPoker() *PBPoker {
if m != nil {
return m.Poker
}
return nil
}
func (m *PokerBull) GetPlayers() []*PBPlayer {
if m != nil {
return m.Players
}
return nil
}
func (m *PokerBull) GetPlayerNum() int32 {
if m != nil {
return m.PlayerNum
}
return 0
}
func (m *PokerBull) GetResults() []*PBResult {
if m != nil {
return m.Results
}
return nil
}
func (m *PokerBull) GetIndex() int64 {
if m != nil {
return m.Index
}
return 0
}
func (m *PokerBull) GetPrevIndex() int64 {
if m != nil {
return m.PrevIndex
}
return 0
}
func (m *PokerBull) GetQuitTime() int64 {
if m != nil {
return m.QuitTime
}
return 0
}
func (m *PokerBull) GetQuitTxHash() string {
if m != nil {
return m.QuitTxHash
}
return ""
}
func (m *PokerBull) GetDealerAddr() string {
if m != nil {
return m.DealerAddr
}
return ""
}
func (m *PokerBull) GetIsWaiting() bool {
if m != nil {
return m.IsWaiting
}
return false
}
func (m *PokerBull) GetPreStatus() int32 {
if m != nil {
return m.PreStatus
}
return 0
}
//一把牌
type PBHand struct {
Cards []int32 `protobuf:"varint,1,rep,packed,name=cards,proto3" json:"cards,omitempty"`
Result int32 `protobuf:"varint,2,opt,name=result,proto3" json:"result,omitempty"`
Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
IsWin bool `protobuf:"varint,4,opt,name=isWin,proto3" json:"isWin,omitempty"`
Leverage int32 `protobuf:"varint,5,opt,name=leverage,proto3" json:"leverage,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBHand) Reset() { *m = PBHand{} }
func (m *PBHand) String() string { return proto.CompactTextString(m) }
func (*PBHand) ProtoMessage() {}
func (*PBHand) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{6}
}
func (m *PBHand) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBHand.Unmarshal(m, b)
}
func (m *PBHand) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBHand.Marshal(b, m, deterministic)
}
func (m *PBHand) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBHand.Merge(m, src)
}
func (m *PBHand) XXX_Size() int {
return xxx_messageInfo_PBHand.Size(m)
}
func (m *PBHand) XXX_DiscardUnknown() {
xxx_messageInfo_PBHand.DiscardUnknown(m)
}
var xxx_messageInfo_PBHand proto.InternalMessageInfo
func (m *PBHand) GetCards() []int32 {
if m != nil {
return m.Cards
}
return nil
}
func (m *PBHand) GetResult() int32 {
if m != nil {
return m.Result
}
return 0
}
func (m *PBHand) GetAddress() string {
if m != nil {
return m.Address
}
return ""
}
func (m *PBHand) GetIsWin() bool {
if m != nil {
return m.IsWin
}
return false
}
func (m *PBHand) GetLeverage() int32 {
if m != nil {
return m.Leverage
}
return 0
}
//玩家
type PBPlayer struct {
Hands []*PBHand `protobuf:"bytes,1,rep,name=hands,proto3" json:"hands,omitempty"`
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
TxHash int64 `protobuf:"varint,3,opt,name=txHash,proto3" json:"txHash,omitempty"`
Ready bool `protobuf:"varint,4,opt,name=ready,proto3" json:"ready,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBPlayer) Reset() { *m = PBPlayer{} }
func (m *PBPlayer) String() string { return proto.CompactTextString(m) }
func (*PBPlayer) ProtoMessage() {}
func (*PBPlayer) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{7}
}
func (m *PBPlayer) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBPlayer.Unmarshal(m, b)
}
func (m *PBPlayer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBPlayer.Marshal(b, m, deterministic)
}
func (m *PBPlayer) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBPlayer.Merge(m, src)
}
func (m *PBPlayer) XXX_Size() int {
return xxx_messageInfo_PBPlayer.Size(m)
}
func (m *PBPlayer) XXX_DiscardUnknown() {
xxx_messageInfo_PBPlayer.DiscardUnknown(m)
}
var xxx_messageInfo_PBPlayer proto.InternalMessageInfo
func (m *PBPlayer) GetHands() []*PBHand {
if m != nil {
return m.Hands
}
return nil
}
func (m *PBPlayer) GetAddress() string {
if m != nil {
return m.Address
}
return ""
}
func (m *PBPlayer) GetTxHash() int64 {
if m != nil {
return m.TxHash
}
return 0
}
func (m *PBPlayer) GetReady() bool {
if m != nil {
return m.Ready
}
return false
}
//本局游戏结果
type PBResult struct {
Hands []*PBHand `protobuf:"bytes,1,rep,name=hands,proto3" json:"hands,omitempty"`
Winner string `protobuf:"bytes,2,opt,name=winner,proto3" json:"winner,omitempty"`
Leverage int32 `protobuf:"varint,3,opt,name=leverage,proto3" json:"leverage,omitempty"`
Dealer string `protobuf:"bytes,4,opt,name=dealer,proto3" json:"dealer,omitempty"`
DealerLeverage int32 `protobuf:"varint,5,opt,name=dealerLeverage,proto3" json:"dealerLeverage,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBResult) Reset() { *m = PBResult{} }
func (m *PBResult) String() string { return proto.CompactTextString(m) }
func (*PBResult) ProtoMessage() {}
func (*PBResult) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{8}
}
func (m *PBResult) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBResult.Unmarshal(m, b)
}
func (m *PBResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBResult.Marshal(b, m, deterministic)
}
func (m *PBResult) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBResult.Merge(m, src)
}
func (m *PBResult) XXX_Size() int {
return xxx_messageInfo_PBResult.Size(m)
}
func (m *PBResult) XXX_DiscardUnknown() {
xxx_messageInfo_PBResult.DiscardUnknown(m)
}
var xxx_messageInfo_PBResult proto.InternalMessageInfo
func (m *PBResult) GetHands() []*PBHand {
if m != nil {
return m.Hands
}
return nil
}
func (m *PBResult) GetWinner() string {
if m != nil {
return m.Winner
}
return ""
}
func (m *PBResult) GetLeverage() int32 {
if m != nil {
return m.Leverage
}
return 0
}
func (m *PBResult) GetDealer() string {
if m != nil {
return m.Dealer
}
return ""
}
func (m *PBResult) GetDealerLeverage() int32 {
if m != nil {
return m.DealerLeverage
}
return 0
}
//扑克牌
type PBPoker struct {
Cards []int32 `protobuf:"varint,1,rep,packed,name=cards,proto3" json:"cards,omitempty"`
Pointer int32 `protobuf:"varint,2,opt,name=pointer,proto3" json:"pointer,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBPoker) Reset() { *m = PBPoker{} }
func (m *PBPoker) String() string { return proto.CompactTextString(m) }
func (*PBPoker) ProtoMessage() {}
func (*PBPoker) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{9}
}
func (m *PBPoker) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBPoker.Unmarshal(m, b)
}
func (m *PBPoker) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBPoker.Marshal(b, m, deterministic)
}
func (m *PBPoker) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBPoker.Merge(m, src)
}
func (m *PBPoker) XXX_Size() int {
return xxx_messageInfo_PBPoker.Size(m)
}
func (m *PBPoker) XXX_DiscardUnknown() {
xxx_messageInfo_PBPoker.DiscardUnknown(m)
}
var xxx_messageInfo_PBPoker proto.InternalMessageInfo
func (m *PBPoker) GetCards() []int32 {
if m != nil {
return m.Cards
}
return nil
}
func (m *PBPoker) GetPointer() int32 {
if m != nil {
return m.Pointer
}
return 0
}
//游戏状态
type PBGameAction struct {
// Types that are valid to be assigned to Value:
// *PBGameAction_Start
// *PBGameAction_Continue
// *PBGameAction_Quit
// *PBGameAction_Query
Value isPBGameAction_Value `protobuf_oneof:"value"`
Ty int32 `protobuf:"varint,10,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBGameAction) Reset() { *m = PBGameAction{} }
func (m *PBGameAction) String() string { return proto.CompactTextString(m) }
func (*PBGameAction) ProtoMessage() {}
func (*PBGameAction) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{10}
}
func (m *PBGameAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBGameAction.Unmarshal(m, b)
}
func (m *PBGameAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBGameAction.Marshal(b, m, deterministic)
}
func (m *PBGameAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBGameAction.Merge(m, src)
}
func (m *PBGameAction) XXX_Size() int {
return xxx_messageInfo_PBGameAction.Size(m)
}
func (m *PBGameAction) XXX_DiscardUnknown() {
xxx_messageInfo_PBGameAction.DiscardUnknown(m)
}
var xxx_messageInfo_PBGameAction proto.InternalMessageInfo
type isPBGameAction_Value interface {
isPBGameAction_Value()
}
type PBGameAction_Start struct {
Start *PBGameStart `protobuf:"bytes,1,opt,name=start,proto3,oneof"`
}
type PBGameAction_Continue struct {
Continue *PBGameContinue `protobuf:"bytes,2,opt,name=continue,proto3,oneof"`
}
type PBGameAction_Quit struct {
Quit *PBGameQuit `protobuf:"bytes,3,opt,name=quit,proto3,oneof"`
}
type PBGameAction_Query struct {
Query *PBGameQuery `protobuf:"bytes,4,opt,name=query,proto3,oneof"`
}
func (*PBGameAction_Start) isPBGameAction_Value() {}
func (*PBGameAction_Continue) isPBGameAction_Value() {}
func (*PBGameAction_Quit) isPBGameAction_Value() {}
func (*PBGameAction_Query) isPBGameAction_Value() {}
func (m *PBGameAction) GetValue() isPBGameAction_Value {
if m != nil {
return m.Value
}
return nil
}
func (m *PBGameAction) GetStart() *PBGameStart {
if x, ok := m.GetValue().(*PBGameAction_Start); ok {
return x.Start
}
return nil
}
func (m *PBGameAction) GetContinue() *PBGameContinue {
if x, ok := m.GetValue().(*PBGameAction_Continue); ok {
return x.Continue
}
return nil
}
func (m *PBGameAction) GetQuit() *PBGameQuit {
if x, ok := m.GetValue().(*PBGameAction_Quit); ok {
return x.Quit
}
return nil
}
func (m *PBGameAction) GetQuery() *PBGameQuery {
if x, ok := m.GetValue().(*PBGameAction_Query); ok {
return x.Query
}
return nil
}
func (m *PBGameAction) GetTy() int32 {
if m != nil {
return m.Ty
}
return 0
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*PBGameAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _PBGameAction_OneofMarshaler, _PBGameAction_OneofUnmarshaler, _PBGameAction_OneofSizer, []interface{}{
(*PBGameAction_Start)(nil),
(*PBGameAction_Continue)(nil),
(*PBGameAction_Quit)(nil),
(*PBGameAction_Query)(nil),
}
}
func _PBGameAction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*PBGameAction)
// value
switch x := m.Value.(type) {
case *PBGameAction_Start:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Start); err != nil {
return err
}
case *PBGameAction_Continue:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Continue); err != nil {
return err
}
case *PBGameAction_Quit:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Quit); err != nil {
return err
}
case *PBGameAction_Query:
b.EncodeVarint(4<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Query); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("PBGameAction.Value has unexpected type %T", x)
}
return nil
}
func _PBGameAction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*PBGameAction)
switch tag {
case 1: // value.start
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PBGameStart)
err := b.DecodeMessage(msg)
m.Value = &PBGameAction_Start{msg}
return true, err
case 2: // value.continue
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PBGameContinue)
err := b.DecodeMessage(msg)
m.Value = &PBGameAction_Continue{msg}
return true, err
case 3: // value.quit
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PBGameQuit)
err := b.DecodeMessage(msg)
m.Value = &PBGameAction_Quit{msg}
return true, err
case 4: // value.query
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PBGameQuery)
err := b.DecodeMessage(msg)
m.Value = &PBGameAction_Query{msg}
return true, err
default:
return false, nil
}
}
func _PBGameAction_OneofSizer(msg proto.Message) (n int) {
m := msg.(*PBGameAction)
// value
switch x := m.Value.(type) {
case *PBGameAction_Start:
s := proto.Size(x.Start)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *PBGameAction_Continue:
s := proto.Size(x.Continue)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *PBGameAction_Quit:
s := proto.Size(x.Quit)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *PBGameAction_Query:
s := proto.Size(x.Query)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
//游戏启动
type PBGameStart struct {
Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
PlayerNum int32 `protobuf:"varint,2,opt,name=playerNum,proto3" json:"playerNum,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBGameStart) Reset() { *m = PBGameStart{} }
func (m *PBGameStart) String() string { return proto.CompactTextString(m) }
func (*PBGameStart) ProtoMessage() {}
func (*PBGameStart) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{11}
}
func (m *PBGameStart) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBGameStart.Unmarshal(m, b)
}
func (m *PBGameStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBGameStart.Marshal(b, m, deterministic)
}
func (m *PBGameStart) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBGameStart.Merge(m, src)
}
func (m *PBGameStart) XXX_Size() int {
return xxx_messageInfo_PBGameStart.Size(m)
}
func (m *PBGameStart) XXX_DiscardUnknown() {
xxx_messageInfo_PBGameStart.DiscardUnknown(m)
}
var xxx_messageInfo_PBGameStart proto.InternalMessageInfo
func (m *PBGameStart) GetValue() int64 {
if m != nil {
return m.Value
}
return 0
}
func (m *PBGameStart) GetPlayerNum() int32 {
if m != nil {
return m.PlayerNum
}
return 0
}
//游戏继续
type PBGameContinue struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBGameContinue) Reset() { *m = PBGameContinue{} }
func (m *PBGameContinue) String() string { return proto.CompactTextString(m) }
func (*PBGameContinue) ProtoMessage() {}
func (*PBGameContinue) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{12}
}
func (m *PBGameContinue) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBGameContinue.Unmarshal(m, b)
}
func (m *PBGameContinue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBGameContinue.Marshal(b, m, deterministic)
}
func (m *PBGameContinue) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBGameContinue.Merge(m, src)
}
func (m *PBGameContinue) XXX_Size() int {
return xxx_messageInfo_PBGameContinue.Size(m)
}
func (m *PBGameContinue) XXX_DiscardUnknown() {
xxx_messageInfo_PBGameContinue.DiscardUnknown(m)
}
var xxx_messageInfo_PBGameContinue proto.InternalMessageInfo
func (m *PBGameContinue) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
//游戏结束
type PBGameQuit struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBGameQuit) Reset() { *m = PBGameQuit{} }
func (m *PBGameQuit) String() string { return proto.CompactTextString(m) }
func (*PBGameQuit) ProtoMessage() {}
func (*PBGameQuit) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{13}
}
func (m *PBGameQuit) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBGameQuit.Unmarshal(m, b)
}
func (m *PBGameQuit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBGameQuit.Marshal(b, m, deterministic)
}
func (m *PBGameQuit) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBGameQuit.Merge(m, src)
}
func (m *PBGameQuit) XXX_Size() int {
return xxx_messageInfo_PBGameQuit.Size(m)
}
func (m *PBGameQuit) XXX_DiscardUnknown() {
xxx_messageInfo_PBGameQuit.DiscardUnknown(m)
}
var xxx_messageInfo_PBGameQuit proto.InternalMessageInfo
func (m *PBGameQuit) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
//查询游戏结果
type PBGameQuery struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBGameQuery) Reset() { *m = PBGameQuery{} }
func (m *PBGameQuery) String() string { return proto.CompactTextString(m) }
func (*PBGameQuery) ProtoMessage() {}
func (*PBGameQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{14}
}
func (m *PBGameQuery) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBGameQuery.Unmarshal(m, b)
}
func (m *PBGameQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBGameQuery.Marshal(b, m, deterministic)
}
func (m *PBGameQuery) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBGameQuery.Merge(m, src)
}
func (m *PBGameQuery) XXX_Size() int {
return xxx_messageInfo_PBGameQuery.Size(m)
}
func (m *PBGameQuery) XXX_DiscardUnknown() {
xxx_messageInfo_PBGameQuery.DiscardUnknown(m)
}
var xxx_messageInfo_PBGameQuery proto.InternalMessageInfo
func (m *PBGameQuery) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
//游戏状态 //游戏状态
type GuessGameAction struct { type GuessGameAction struct {
// Types that are valid to be assigned to Value: // Types that are valid to be assigned to Value:
...@@ -1323,7 +518,7 @@ func (m *GuessGameAction) Reset() { *m = GuessGameAction{} } ...@@ -1323,7 +518,7 @@ func (m *GuessGameAction) Reset() { *m = GuessGameAction{} }
func (m *GuessGameAction) String() string { return proto.CompactTextString(m) } func (m *GuessGameAction) String() string { return proto.CompactTextString(m) }
func (*GuessGameAction) ProtoMessage() {} func (*GuessGameAction) ProtoMessage() {}
func (*GuessGameAction) Descriptor() ([]byte, []int) { func (*GuessGameAction) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{15} return fileDescriptor_7574406c5d3430e8, []int{5}
} }
func (m *GuessGameAction) XXX_Unmarshal(b []byte) error { func (m *GuessGameAction) XXX_Unmarshal(b []byte) error {
...@@ -1570,7 +765,7 @@ type GuessGameStart struct { ...@@ -1570,7 +765,7 @@ type GuessGameStart struct {
OneBet uint32 `protobuf:"varint,8,opt,name=oneBet,proto3" json:"oneBet,omitempty"` OneBet uint32 `protobuf:"varint,8,opt,name=oneBet,proto3" json:"oneBet,omitempty"`
MaxBets uint32 `protobuf:"varint,9,opt,name=maxBets,proto3" json:"maxBets,omitempty"` MaxBets uint32 `protobuf:"varint,9,opt,name=maxBets,proto3" json:"maxBets,omitempty"`
MaxBetsNumber uint32 `protobuf:"varint,10,opt,name=maxBetsNumber,proto3" json:"maxBetsNumber,omitempty"` MaxBetsNumber uint32 `protobuf:"varint,10,opt,name=maxBetsNumber,proto3" json:"maxBetsNumber,omitempty"`
Fee uint64 `protobuf:"varint,11,opt,name=fee,proto3" json:"fee,omitempty"` Fee int64 `protobuf:"varint,11,opt,name=fee,proto3" json:"fee,omitempty"`
FeeAddr string `protobuf:"bytes,12,opt,name=feeAddr,proto3" json:"feeAddr,omitempty"` FeeAddr string `protobuf:"bytes,12,opt,name=feeAddr,proto3" json:"feeAddr,omitempty"`
Expire string `protobuf:"bytes,13,opt,name=expire,proto3" json:"expire,omitempty"` Expire string `protobuf:"bytes,13,opt,name=expire,proto3" json:"expire,omitempty"`
ExpireHeight int64 `protobuf:"varint,14,opt,name=expireHeight,proto3" json:"expireHeight,omitempty"` ExpireHeight int64 `protobuf:"varint,14,opt,name=expireHeight,proto3" json:"expireHeight,omitempty"`
...@@ -1583,7 +778,7 @@ func (m *GuessGameStart) Reset() { *m = GuessGameStart{} } ...@@ -1583,7 +778,7 @@ func (m *GuessGameStart) Reset() { *m = GuessGameStart{} }
func (m *GuessGameStart) String() string { return proto.CompactTextString(m) } func (m *GuessGameStart) String() string { return proto.CompactTextString(m) }
func (*GuessGameStart) ProtoMessage() {} func (*GuessGameStart) ProtoMessage() {}
func (*GuessGameStart) Descriptor() ([]byte, []int) { func (*GuessGameStart) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{16} return fileDescriptor_7574406c5d3430e8, []int{6}
} }
func (m *GuessGameStart) XXX_Unmarshal(b []byte) error { func (m *GuessGameStart) XXX_Unmarshal(b []byte) error {
...@@ -1674,7 +869,7 @@ func (m *GuessGameStart) GetMaxBetsNumber() uint32 { ...@@ -1674,7 +869,7 @@ func (m *GuessGameStart) GetMaxBetsNumber() uint32 {
return 0 return 0
} }
func (m *GuessGameStart) GetFee() uint64 { func (m *GuessGameStart) GetFee() int64 {
if m != nil { if m != nil {
return m.Fee return m.Fee
} }
...@@ -1707,6 +902,7 @@ type GuessGameBet struct { ...@@ -1707,6 +902,7 @@ type GuessGameBet struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"` GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Option string `protobuf:"bytes,2,opt,name=option,proto3" json:"option,omitempty"` Option string `protobuf:"bytes,2,opt,name=option,proto3" json:"option,omitempty"`
BetsNum uint32 `protobuf:"varint,3,opt,name=betsNum,proto3" json:"betsNum,omitempty"` BetsNum uint32 `protobuf:"varint,3,opt,name=betsNum,proto3" json:"betsNum,omitempty"`
Fee int64 `protobuf:"varint,4,opt,name=fee,proto3" json:"fee,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -1716,7 +912,7 @@ func (m *GuessGameBet) Reset() { *m = GuessGameBet{} } ...@@ -1716,7 +912,7 @@ func (m *GuessGameBet) Reset() { *m = GuessGameBet{} }
func (m *GuessGameBet) String() string { return proto.CompactTextString(m) } func (m *GuessGameBet) String() string { return proto.CompactTextString(m) }
func (*GuessGameBet) ProtoMessage() {} func (*GuessGameBet) ProtoMessage() {}
func (*GuessGameBet) Descriptor() ([]byte, []int) { func (*GuessGameBet) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{17} return fileDescriptor_7574406c5d3430e8, []int{7}
} }
func (m *GuessGameBet) XXX_Unmarshal(b []byte) error { func (m *GuessGameBet) XXX_Unmarshal(b []byte) error {
...@@ -1731,545 +927,198 @@ func (m *GuessGameBet) XXX_Merge(src proto.Message) { ...@@ -1731,545 +927,198 @@ func (m *GuessGameBet) XXX_Merge(src proto.Message) {
func (m *GuessGameBet) XXX_Size() int { func (m *GuessGameBet) XXX_Size() int {
return xxx_messageInfo_GuessGameBet.Size(m) return xxx_messageInfo_GuessGameBet.Size(m)
} }
func (m *GuessGameBet) XXX_DiscardUnknown() { func (m *GuessGameBet) XXX_DiscardUnknown() {
xxx_messageInfo_GuessGameBet.DiscardUnknown(m) xxx_messageInfo_GuessGameBet.DiscardUnknown(m)
}
var xxx_messageInfo_GuessGameBet proto.InternalMessageInfo
func (m *GuessGameBet) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
func (m *GuessGameBet) GetOption() string {
if m != nil {
return m.Option
}
return ""
}
func (m *GuessGameBet) GetBetsNum() uint32 {
if m != nil {
return m.BetsNum
}
return 0
}
//游戏异常终止,退还下注
type GuessGameAbort struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GuessGameAbort) Reset() { *m = GuessGameAbort{} }
func (m *GuessGameAbort) String() string { return proto.CompactTextString(m) }
func (*GuessGameAbort) ProtoMessage() {}
func (*GuessGameAbort) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{18}
}
func (m *GuessGameAbort) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GuessGameAbort.Unmarshal(m, b)
}
func (m *GuessGameAbort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GuessGameAbort.Marshal(b, m, deterministic)
}
func (m *GuessGameAbort) XXX_Merge(src proto.Message) {
xxx_messageInfo_GuessGameAbort.Merge(m, src)
}
func (m *GuessGameAbort) XXX_Size() int {
return xxx_messageInfo_GuessGameAbort.Size(m)
}
func (m *GuessGameAbort) XXX_DiscardUnknown() {
xxx_messageInfo_GuessGameAbort.DiscardUnknown(m)
}
var xxx_messageInfo_GuessGameAbort proto.InternalMessageInfo
func (m *GuessGameAbort) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
//游戏结果揭晓
type GuessGamePublish struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Result string `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GuessGamePublish) Reset() { *m = GuessGamePublish{} }
func (m *GuessGamePublish) String() string { return proto.CompactTextString(m) }
func (*GuessGamePublish) ProtoMessage() {}
func (*GuessGamePublish) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{19}
}
func (m *GuessGamePublish) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GuessGamePublish.Unmarshal(m, b)
}
func (m *GuessGamePublish) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GuessGamePublish.Marshal(b, m, deterministic)
}
func (m *GuessGamePublish) XXX_Merge(src proto.Message) {
xxx_messageInfo_GuessGamePublish.Merge(m, src)
}
func (m *GuessGamePublish) XXX_Size() int {
return xxx_messageInfo_GuessGamePublish.Size(m)
}
func (m *GuessGamePublish) XXX_DiscardUnknown() {
xxx_messageInfo_GuessGamePublish.DiscardUnknown(m)
}
var xxx_messageInfo_GuessGamePublish proto.InternalMessageInfo
func (m *GuessGamePublish) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
func (m *GuessGamePublish) GetResult() string {
if m != nil {
return m.Result
}
return ""
}
//查询游戏结果
type GuessGameQuery struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Ty uint32 `protobuf:"varint,2,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GuessGameQuery) Reset() { *m = GuessGameQuery{} }
func (m *GuessGameQuery) String() string { return proto.CompactTextString(m) }
func (*GuessGameQuery) ProtoMessage() {}
func (*GuessGameQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{20}
}
func (m *GuessGameQuery) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GuessGameQuery.Unmarshal(m, b)
}
func (m *GuessGameQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GuessGameQuery.Marshal(b, m, deterministic)
}
func (m *GuessGameQuery) XXX_Merge(src proto.Message) {
xxx_messageInfo_GuessGameQuery.Merge(m, src)
}
func (m *GuessGameQuery) XXX_Size() int {
return xxx_messageInfo_GuessGameQuery.Size(m)
}
func (m *GuessGameQuery) XXX_DiscardUnknown() {
xxx_messageInfo_GuessGameQuery.DiscardUnknown(m)
}
var xxx_messageInfo_GuessGameQuery proto.InternalMessageInfo
func (m *GuessGameQuery) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
func (m *GuessGameQuery) GetTy() uint32 {
if m != nil {
return m.Ty
}
return 0
}
//根据状态和游戏人数查找
type QueryPBGameListByStatusAndPlayerNum struct {
Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
PlayerNum int32 `protobuf:"varint,2,opt,name=playerNum,proto3" json:"playerNum,omitempty"`
Index int64 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *QueryPBGameListByStatusAndPlayerNum) Reset() { *m = QueryPBGameListByStatusAndPlayerNum{} }
func (m *QueryPBGameListByStatusAndPlayerNum) String() string { return proto.CompactTextString(m) }
func (*QueryPBGameListByStatusAndPlayerNum) ProtoMessage() {}
func (*QueryPBGameListByStatusAndPlayerNum) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{21}
}
func (m *QueryPBGameListByStatusAndPlayerNum) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryPBGameListByStatusAndPlayerNum.Unmarshal(m, b)
}
func (m *QueryPBGameListByStatusAndPlayerNum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryPBGameListByStatusAndPlayerNum.Marshal(b, m, deterministic)
}
func (m *QueryPBGameListByStatusAndPlayerNum) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryPBGameListByStatusAndPlayerNum.Merge(m, src)
}
func (m *QueryPBGameListByStatusAndPlayerNum) XXX_Size() int {
return xxx_messageInfo_QueryPBGameListByStatusAndPlayerNum.Size(m)
}
func (m *QueryPBGameListByStatusAndPlayerNum) XXX_DiscardUnknown() {
xxx_messageInfo_QueryPBGameListByStatusAndPlayerNum.DiscardUnknown(m)
}
var xxx_messageInfo_QueryPBGameListByStatusAndPlayerNum proto.InternalMessageInfo
func (m *QueryPBGameListByStatusAndPlayerNum) GetStatus() int32 {
if m != nil {
return m.Status
}
return 0
}
func (m *QueryPBGameListByStatusAndPlayerNum) GetPlayerNum() int32 {
if m != nil {
return m.PlayerNum
}
return 0
}
func (m *QueryPBGameListByStatusAndPlayerNum) GetIndex() int64 {
if m != nil {
return m.Index
}
return 0
}
// 索引value值
type PBGameRecord struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
Index int64 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBGameRecord) Reset() { *m = PBGameRecord{} }
func (m *PBGameRecord) String() string { return proto.CompactTextString(m) }
func (*PBGameRecord) ProtoMessage() {}
func (*PBGameRecord) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{22}
}
func (m *PBGameRecord) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBGameRecord.Unmarshal(m, b)
}
func (m *PBGameRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBGameRecord.Marshal(b, m, deterministic)
}
func (m *PBGameRecord) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBGameRecord.Merge(m, src)
}
func (m *PBGameRecord) XXX_Size() int {
return xxx_messageInfo_PBGameRecord.Size(m)
}
func (m *PBGameRecord) XXX_DiscardUnknown() {
xxx_messageInfo_PBGameRecord.DiscardUnknown(m)
} }
var xxx_messageInfo_PBGameRecord proto.InternalMessageInfo var xxx_messageInfo_GuessGameBet proto.InternalMessageInfo
func (m *PBGameRecord) GetGameId() string { func (m *GuessGameBet) GetGameId() string {
if m != nil { if m != nil {
return m.GameId return m.GameId
} }
return "" return ""
} }
func (m *PBGameRecord) GetStatus() int32 { func (m *GuessGameBet) GetOption() string {
if m != nil { if m != nil {
return m.Status return m.Option
}
return ""
}
func (m *GuessGameBet) GetBetsNum() uint32 {
if m != nil {
return m.BetsNum
} }
return 0 return 0
} }
func (m *PBGameRecord) GetIndex() int64 { func (m *GuessGameBet) GetFee() int64 {
if m != nil { if m != nil {
return m.Index return m.Fee
} }
return 0 return 0
} }
type PBGameIndexRecord struct { //游戏异常终止,退还下注
type GuessGameAbort struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"` GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` Fee int64 `protobuf:"varint,2,opt,name=fee,proto3" json:"fee,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *PBGameIndexRecord) Reset() { *m = PBGameIndexRecord{} } func (m *GuessGameAbort) Reset() { *m = GuessGameAbort{} }
func (m *PBGameIndexRecord) String() string { return proto.CompactTextString(m) } func (m *GuessGameAbort) String() string { return proto.CompactTextString(m) }
func (*PBGameIndexRecord) ProtoMessage() {} func (*GuessGameAbort) ProtoMessage() {}
func (*PBGameIndexRecord) Descriptor() ([]byte, []int) { func (*GuessGameAbort) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{23} return fileDescriptor_7574406c5d3430e8, []int{8}
} }
func (m *PBGameIndexRecord) XXX_Unmarshal(b []byte) error { func (m *GuessGameAbort) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBGameIndexRecord.Unmarshal(m, b) return xxx_messageInfo_GuessGameAbort.Unmarshal(m, b)
} }
func (m *PBGameIndexRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *GuessGameAbort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBGameIndexRecord.Marshal(b, m, deterministic) return xxx_messageInfo_GuessGameAbort.Marshal(b, m, deterministic)
} }
func (m *PBGameIndexRecord) XXX_Merge(src proto.Message) { func (m *GuessGameAbort) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBGameIndexRecord.Merge(m, src) xxx_messageInfo_GuessGameAbort.Merge(m, src)
} }
func (m *PBGameIndexRecord) XXX_Size() int { func (m *GuessGameAbort) XXX_Size() int {
return xxx_messageInfo_PBGameIndexRecord.Size(m) return xxx_messageInfo_GuessGameAbort.Size(m)
} }
func (m *PBGameIndexRecord) XXX_DiscardUnknown() { func (m *GuessGameAbort) XXX_DiscardUnknown() {
xxx_messageInfo_PBGameIndexRecord.DiscardUnknown(m) xxx_messageInfo_GuessGameAbort.DiscardUnknown(m)
} }
var xxx_messageInfo_PBGameIndexRecord proto.InternalMessageInfo var xxx_messageInfo_GuessGameAbort proto.InternalMessageInfo
func (m *PBGameIndexRecord) GetGameId() string { func (m *GuessGameAbort) GetGameId() string {
if m != nil { if m != nil {
return m.GameId return m.GameId
} }
return "" return ""
} }
func (m *PBGameIndexRecord) GetIndex() int64 { func (m *GuessGameAbort) GetFee() int64 {
if m != nil { if m != nil {
return m.Index return m.Fee
} }
return 0 return 0
} }
type PBGameRecords struct { //游戏结果揭晓
Records []*PBGameRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` type GuessGamePublish struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBGameRecords) Reset() { *m = PBGameRecords{} }
func (m *PBGameRecords) String() string { return proto.CompactTextString(m) }
func (*PBGameRecords) ProtoMessage() {}
func (*PBGameRecords) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{24}
}
func (m *PBGameRecords) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBGameRecords.Unmarshal(m, b)
}
func (m *PBGameRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBGameRecords.Marshal(b, m, deterministic)
}
func (m *PBGameRecords) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBGameRecords.Merge(m, src)
}
func (m *PBGameRecords) XXX_Size() int {
return xxx_messageInfo_PBGameRecords.Size(m)
}
func (m *PBGameRecords) XXX_DiscardUnknown() {
xxx_messageInfo_PBGameRecords.DiscardUnknown(m)
}
var xxx_messageInfo_PBGameRecords proto.InternalMessageInfo
func (m *PBGameRecords) GetRecords() []*PBGameRecord {
if m != nil {
return m.Records
}
return nil
}
type QueryPBGameInfo struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"` GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Result string `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` Fee int64 `protobuf:"varint,3,opt,name=fee,proto3" json:"fee,omitempty"`
Index int64 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *QueryPBGameInfo) Reset() { *m = QueryPBGameInfo{} } func (m *GuessGamePublish) Reset() { *m = GuessGamePublish{} }
func (m *QueryPBGameInfo) String() string { return proto.CompactTextString(m) } func (m *GuessGamePublish) String() string { return proto.CompactTextString(m) }
func (*QueryPBGameInfo) ProtoMessage() {} func (*GuessGamePublish) ProtoMessage() {}
func (*QueryPBGameInfo) Descriptor() ([]byte, []int) { func (*GuessGamePublish) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{25} return fileDescriptor_7574406c5d3430e8, []int{9}
} }
func (m *QueryPBGameInfo) XXX_Unmarshal(b []byte) error { func (m *GuessGamePublish) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryPBGameInfo.Unmarshal(m, b) return xxx_messageInfo_GuessGamePublish.Unmarshal(m, b)
} }
func (m *QueryPBGameInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *GuessGamePublish) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryPBGameInfo.Marshal(b, m, deterministic) return xxx_messageInfo_GuessGamePublish.Marshal(b, m, deterministic)
} }
func (m *QueryPBGameInfo) XXX_Merge(src proto.Message) { func (m *GuessGamePublish) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryPBGameInfo.Merge(m, src) xxx_messageInfo_GuessGamePublish.Merge(m, src)
} }
func (m *QueryPBGameInfo) XXX_Size() int { func (m *GuessGamePublish) XXX_Size() int {
return xxx_messageInfo_QueryPBGameInfo.Size(m) return xxx_messageInfo_GuessGamePublish.Size(m)
} }
func (m *QueryPBGameInfo) XXX_DiscardUnknown() { func (m *GuessGamePublish) XXX_DiscardUnknown() {
xxx_messageInfo_QueryPBGameInfo.DiscardUnknown(m) xxx_messageInfo_GuessGamePublish.DiscardUnknown(m)
} }
var xxx_messageInfo_QueryPBGameInfo proto.InternalMessageInfo var xxx_messageInfo_GuessGamePublish proto.InternalMessageInfo
func (m *QueryPBGameInfo) GetGameId() string { func (m *GuessGamePublish) GetGameId() string {
if m != nil { if m != nil {
return m.GameId return m.GameId
} }
return "" return ""
} }
func (m *QueryPBGameInfo) GetAddr() string { func (m *GuessGamePublish) GetResult() string {
if m != nil { if m != nil {
return m.Addr return m.Result
} }
return "" return ""
} }
func (m *QueryPBGameInfo) GetStatus() int32 { func (m *GuessGamePublish) GetFee() int64 {
if m != nil {
return m.Status
}
return 0
}
func (m *QueryPBGameInfo) GetIndex() int64 {
if m != nil { if m != nil {
return m.Index return m.Fee
} }
return 0 return 0
} }
type ReplyPBGame struct { //查询游戏结果
Game *PokerBull `protobuf:"bytes,1,opt,name=game,proto3" json:"game,omitempty"` type GuessGameQuery struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"` GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
XXX_unrecognized []byte `json:"-"` Ty uint32 `protobuf:"varint,2,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_sizecache int32 `json:"-"` Fee int64 `protobuf:"varint,3,opt,name=fee,proto3" json:"fee,omitempty"`
}
func (m *ReplyPBGame) Reset() { *m = ReplyPBGame{} }
func (m *ReplyPBGame) String() string { return proto.CompactTextString(m) }
func (*ReplyPBGame) ProtoMessage() {}
func (*ReplyPBGame) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{26}
}
func (m *ReplyPBGame) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyPBGame.Unmarshal(m, b)
}
func (m *ReplyPBGame) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReplyPBGame.Marshal(b, m, deterministic)
}
func (m *ReplyPBGame) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyPBGame.Merge(m, src)
}
func (m *ReplyPBGame) XXX_Size() int {
return xxx_messageInfo_ReplyPBGame.Size(m)
}
func (m *ReplyPBGame) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyPBGame.DiscardUnknown(m)
}
var xxx_messageInfo_ReplyPBGame proto.InternalMessageInfo
func (m *ReplyPBGame) GetGame() *PokerBull {
if m != nil {
return m.Game
}
return nil
}
type QueryPBGameInfos struct {
GameIds []string `protobuf:"bytes,1,rep,name=gameIds,proto3" json:"gameIds,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *QueryPBGameInfos) Reset() { *m = QueryPBGameInfos{} } func (m *GuessGameQuery) Reset() { *m = GuessGameQuery{} }
func (m *QueryPBGameInfos) String() string { return proto.CompactTextString(m) } func (m *GuessGameQuery) String() string { return proto.CompactTextString(m) }
func (*QueryPBGameInfos) ProtoMessage() {} func (*GuessGameQuery) ProtoMessage() {}
func (*QueryPBGameInfos) Descriptor() ([]byte, []int) { func (*GuessGameQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{27} return fileDescriptor_7574406c5d3430e8, []int{10}
} }
func (m *QueryPBGameInfos) XXX_Unmarshal(b []byte) error { func (m *GuessGameQuery) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryPBGameInfos.Unmarshal(m, b) return xxx_messageInfo_GuessGameQuery.Unmarshal(m, b)
} }
func (m *QueryPBGameInfos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *GuessGameQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryPBGameInfos.Marshal(b, m, deterministic) return xxx_messageInfo_GuessGameQuery.Marshal(b, m, deterministic)
} }
func (m *QueryPBGameInfos) XXX_Merge(src proto.Message) { func (m *GuessGameQuery) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryPBGameInfos.Merge(m, src) xxx_messageInfo_GuessGameQuery.Merge(m, src)
} }
func (m *QueryPBGameInfos) XXX_Size() int { func (m *GuessGameQuery) XXX_Size() int {
return xxx_messageInfo_QueryPBGameInfos.Size(m) return xxx_messageInfo_GuessGameQuery.Size(m)
} }
func (m *QueryPBGameInfos) XXX_DiscardUnknown() { func (m *GuessGameQuery) XXX_DiscardUnknown() {
xxx_messageInfo_QueryPBGameInfos.DiscardUnknown(m) xxx_messageInfo_GuessGameQuery.DiscardUnknown(m)
} }
var xxx_messageInfo_QueryPBGameInfos proto.InternalMessageInfo var xxx_messageInfo_GuessGameQuery proto.InternalMessageInfo
func (m *QueryPBGameInfos) GetGameIds() []string { func (m *GuessGameQuery) GetGameId() string {
if m != nil { if m != nil {
return m.GameIds return m.GameId
} }
return nil return ""
}
type ReplyPBGameList struct {
Games []*PokerBull `protobuf:"bytes,1,rep,name=games,proto3" json:"games,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReplyPBGameList) Reset() { *m = ReplyPBGameList{} }
func (m *ReplyPBGameList) String() string { return proto.CompactTextString(m) }
func (*ReplyPBGameList) ProtoMessage() {}
func (*ReplyPBGameList) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{28}
} }
func (m *ReplyPBGameList) XXX_Unmarshal(b []byte) error { func (m *GuessGameQuery) GetTy() uint32 {
return xxx_messageInfo_ReplyPBGameList.Unmarshal(m, b) if m != nil {
} return m.Ty
func (m *ReplyPBGameList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { }
return xxx_messageInfo_ReplyPBGameList.Marshal(b, m, deterministic) return 0
}
func (m *ReplyPBGameList) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyPBGameList.Merge(m, src)
}
func (m *ReplyPBGameList) XXX_Size() int {
return xxx_messageInfo_ReplyPBGameList.Size(m)
}
func (m *ReplyPBGameList) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyPBGameList.DiscardUnknown(m)
} }
var xxx_messageInfo_ReplyPBGameList proto.InternalMessageInfo func (m *GuessGameQuery) GetFee() int64 {
func (m *ReplyPBGameList) GetGames() []*PokerBull {
if m != nil { if m != nil {
return m.Games return m.Fee
} }
return nil return 0
} }
type QueryGuessGameInfo struct { type QueryGuessGameInfo struct {
...@@ -2286,7 +1135,7 @@ func (m *QueryGuessGameInfo) Reset() { *m = QueryGuessGameInfo{} } ...@@ -2286,7 +1135,7 @@ func (m *QueryGuessGameInfo) Reset() { *m = QueryGuessGameInfo{} }
func (m *QueryGuessGameInfo) String() string { return proto.CompactTextString(m) } func (m *QueryGuessGameInfo) String() string { return proto.CompactTextString(m) }
func (*QueryGuessGameInfo) ProtoMessage() {} func (*QueryGuessGameInfo) ProtoMessage() {}
func (*QueryGuessGameInfo) Descriptor() ([]byte, []int) { func (*QueryGuessGameInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{29} return fileDescriptor_7574406c5d3430e8, []int{11}
} }
func (m *QueryGuessGameInfo) XXX_Unmarshal(b []byte) error { func (m *QueryGuessGameInfo) XXX_Unmarshal(b []byte) error {
...@@ -2346,7 +1195,7 @@ func (m *ReplyGuessGameInfo) Reset() { *m = ReplyGuessGameInfo{} } ...@@ -2346,7 +1195,7 @@ func (m *ReplyGuessGameInfo) Reset() { *m = ReplyGuessGameInfo{} }
func (m *ReplyGuessGameInfo) String() string { return proto.CompactTextString(m) } func (m *ReplyGuessGameInfo) String() string { return proto.CompactTextString(m) }
func (*ReplyGuessGameInfo) ProtoMessage() {} func (*ReplyGuessGameInfo) ProtoMessage() {}
func (*ReplyGuessGameInfo) Descriptor() ([]byte, []int) { func (*ReplyGuessGameInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{30} return fileDescriptor_7574406c5d3430e8, []int{12}
} }
func (m *ReplyGuessGameInfo) XXX_Unmarshal(b []byte) error { func (m *ReplyGuessGameInfo) XXX_Unmarshal(b []byte) error {
...@@ -2385,7 +1234,7 @@ func (m *QueryGuessGameInfos) Reset() { *m = QueryGuessGameInfos{} } ...@@ -2385,7 +1234,7 @@ func (m *QueryGuessGameInfos) Reset() { *m = QueryGuessGameInfos{} }
func (m *QueryGuessGameInfos) String() string { return proto.CompactTextString(m) } func (m *QueryGuessGameInfos) String() string { return proto.CompactTextString(m) }
func (*QueryGuessGameInfos) ProtoMessage() {} func (*QueryGuessGameInfos) ProtoMessage() {}
func (*QueryGuessGameInfos) Descriptor() ([]byte, []int) { func (*QueryGuessGameInfos) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{31} return fileDescriptor_7574406c5d3430e8, []int{13}
} }
func (m *QueryGuessGameInfos) XXX_Unmarshal(b []byte) error { func (m *QueryGuessGameInfos) XXX_Unmarshal(b []byte) error {
...@@ -2424,7 +1273,7 @@ func (m *ReplyGuessGameInfos) Reset() { *m = ReplyGuessGameInfos{} } ...@@ -2424,7 +1273,7 @@ func (m *ReplyGuessGameInfos) Reset() { *m = ReplyGuessGameInfos{} }
func (m *ReplyGuessGameInfos) String() string { return proto.CompactTextString(m) } func (m *ReplyGuessGameInfos) String() string { return proto.CompactTextString(m) }
func (*ReplyGuessGameInfos) ProtoMessage() {} func (*ReplyGuessGameInfos) ProtoMessage() {}
func (*ReplyGuessGameInfos) Descriptor() ([]byte, []int) { func (*ReplyGuessGameInfos) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{32} return fileDescriptor_7574406c5d3430e8, []int{14}
} }
func (m *ReplyGuessGameInfos) XXX_Unmarshal(b []byte) error { func (m *ReplyGuessGameInfos) XXX_Unmarshal(b []byte) error {
...@@ -2472,7 +1321,7 @@ func (m *ReceiptPBGame) Reset() { *m = ReceiptPBGame{} } ...@@ -2472,7 +1321,7 @@ func (m *ReceiptPBGame) Reset() { *m = ReceiptPBGame{} }
func (m *ReceiptPBGame) String() string { return proto.CompactTextString(m) } func (m *ReceiptPBGame) String() string { return proto.CompactTextString(m) }
func (*ReceiptPBGame) ProtoMessage() {} func (*ReceiptPBGame) ProtoMessage() {}
func (*ReceiptPBGame) Descriptor() ([]byte, []int) { func (*ReceiptPBGame) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{33} return fileDescriptor_7574406c5d3430e8, []int{15}
} }
func (m *ReceiptPBGame) XXX_Unmarshal(b []byte) error { func (m *ReceiptPBGame) XXX_Unmarshal(b []byte) error {
...@@ -2565,8 +1414,8 @@ func (m *ReceiptPBGame) GetPreStatus() int32 { ...@@ -2565,8 +1414,8 @@ func (m *ReceiptPBGame) GetPreStatus() int32 {
type ReceiptGuessGame struct { type ReceiptGuessGame struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"` GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
PreStatus uint32 `protobuf:"varint,2,opt,name=preStatus,proto3" json:"preStatus,omitempty"` PreStatus int32 `protobuf:"varint,2,opt,name=preStatus,proto3" json:"preStatus,omitempty"`
Status uint32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"`
Addr string `protobuf:"bytes,4,opt,name=addr,proto3" json:"addr,omitempty"` Addr string `protobuf:"bytes,4,opt,name=addr,proto3" json:"addr,omitempty"`
AdminAddr string `protobuf:"bytes,5,opt,name=adminAddr,proto3" json:"adminAddr,omitempty"` AdminAddr string `protobuf:"bytes,5,opt,name=adminAddr,proto3" json:"adminAddr,omitempty"`
PreIndex int64 `protobuf:"varint,6,opt,name=preIndex,proto3" json:"preIndex,omitempty"` PreIndex int64 `protobuf:"varint,6,opt,name=preIndex,proto3" json:"preIndex,omitempty"`
...@@ -2582,7 +1431,7 @@ func (m *ReceiptGuessGame) Reset() { *m = ReceiptGuessGame{} } ...@@ -2582,7 +1431,7 @@ func (m *ReceiptGuessGame) Reset() { *m = ReceiptGuessGame{} }
func (m *ReceiptGuessGame) String() string { return proto.CompactTextString(m) } func (m *ReceiptGuessGame) String() string { return proto.CompactTextString(m) }
func (*ReceiptGuessGame) ProtoMessage() {} func (*ReceiptGuessGame) ProtoMessage() {}
func (*ReceiptGuessGame) Descriptor() ([]byte, []int) { func (*ReceiptGuessGame) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{34} return fileDescriptor_7574406c5d3430e8, []int{16}
} }
func (m *ReceiptGuessGame) XXX_Unmarshal(b []byte) error { func (m *ReceiptGuessGame) XXX_Unmarshal(b []byte) error {
...@@ -2610,14 +1459,14 @@ func (m *ReceiptGuessGame) GetGameId() string { ...@@ -2610,14 +1459,14 @@ func (m *ReceiptGuessGame) GetGameId() string {
return "" return ""
} }
func (m *ReceiptGuessGame) GetPreStatus() uint32 { func (m *ReceiptGuessGame) GetPreStatus() int32 {
if m != nil { if m != nil {
return m.PreStatus return m.PreStatus
} }
return 0 return 0
} }
func (m *ReceiptGuessGame) GetStatus() uint32 { func (m *ReceiptGuessGame) GetStatus() int32 {
if m != nil { if m != nil {
return m.Status return m.Status
} }
...@@ -2690,7 +1539,7 @@ func (m *GuessStartTxReq) Reset() { *m = GuessStartTxReq{} } ...@@ -2690,7 +1539,7 @@ func (m *GuessStartTxReq) Reset() { *m = GuessStartTxReq{} }
func (m *GuessStartTxReq) String() string { return proto.CompactTextString(m) } func (m *GuessStartTxReq) String() string { return proto.CompactTextString(m) }
func (*GuessStartTxReq) ProtoMessage() {} func (*GuessStartTxReq) ProtoMessage() {}
func (*GuessStartTxReq) Descriptor() ([]byte, []int) { func (*GuessStartTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{35} return fileDescriptor_7574406c5d3430e8, []int{17}
} }
func (m *GuessStartTxReq) XXX_Unmarshal(b []byte) error { func (m *GuessStartTxReq) XXX_Unmarshal(b []byte) error {
...@@ -2822,7 +1671,7 @@ func (m *GuessBetTxReq) Reset() { *m = GuessBetTxReq{} } ...@@ -2822,7 +1671,7 @@ func (m *GuessBetTxReq) Reset() { *m = GuessBetTxReq{} }
func (m *GuessBetTxReq) String() string { return proto.CompactTextString(m) } func (m *GuessBetTxReq) String() string { return proto.CompactTextString(m) }
func (*GuessBetTxReq) ProtoMessage() {} func (*GuessBetTxReq) ProtoMessage() {}
func (*GuessBetTxReq) Descriptor() ([]byte, []int) { func (*GuessBetTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{36} return fileDescriptor_7574406c5d3430e8, []int{18}
} }
func (m *GuessBetTxReq) XXX_Unmarshal(b []byte) error { func (m *GuessBetTxReq) XXX_Unmarshal(b []byte) error {
...@@ -2875,7 +1724,7 @@ func (m *GuessAbortTxReq) Reset() { *m = GuessAbortTxReq{} } ...@@ -2875,7 +1724,7 @@ func (m *GuessAbortTxReq) Reset() { *m = GuessAbortTxReq{} }
func (m *GuessAbortTxReq) String() string { return proto.CompactTextString(m) } func (m *GuessAbortTxReq) String() string { return proto.CompactTextString(m) }
func (*GuessAbortTxReq) ProtoMessage() {} func (*GuessAbortTxReq) ProtoMessage() {}
func (*GuessAbortTxReq) Descriptor() ([]byte, []int) { func (*GuessAbortTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{37} return fileDescriptor_7574406c5d3430e8, []int{19}
} }
func (m *GuessAbortTxReq) XXX_Unmarshal(b []byte) error { func (m *GuessAbortTxReq) XXX_Unmarshal(b []byte) error {
...@@ -2915,7 +1764,7 @@ func (m *GuessPublishTxReq) Reset() { *m = GuessPublishTxReq{} } ...@@ -2915,7 +1764,7 @@ func (m *GuessPublishTxReq) Reset() { *m = GuessPublishTxReq{} }
func (m *GuessPublishTxReq) String() string { return proto.CompactTextString(m) } func (m *GuessPublishTxReq) String() string { return proto.CompactTextString(m) }
func (*GuessPublishTxReq) ProtoMessage() {} func (*GuessPublishTxReq) ProtoMessage() {}
func (*GuessPublishTxReq) Descriptor() ([]byte, []int) { func (*GuessPublishTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{38} return fileDescriptor_7574406c5d3430e8, []int{20}
} }
func (m *GuessPublishTxReq) XXX_Unmarshal(b []byte) error { func (m *GuessPublishTxReq) XXX_Unmarshal(b []byte) error {
...@@ -2950,147 +1799,6 @@ func (m *GuessPublishTxReq) GetResult() string { ...@@ -2950,147 +1799,6 @@ func (m *GuessPublishTxReq) GetResult() string {
return "" return ""
} }
type PBContinueTxReq struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Fee int64 `protobuf:"varint,2,opt,name=fee,proto3" json:"fee,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBContinueTxReq) Reset() { *m = PBContinueTxReq{} }
func (m *PBContinueTxReq) String() string { return proto.CompactTextString(m) }
func (*PBContinueTxReq) ProtoMessage() {}
func (*PBContinueTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{39}
}
func (m *PBContinueTxReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBContinueTxReq.Unmarshal(m, b)
}
func (m *PBContinueTxReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBContinueTxReq.Marshal(b, m, deterministic)
}
func (m *PBContinueTxReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBContinueTxReq.Merge(m, src)
}
func (m *PBContinueTxReq) XXX_Size() int {
return xxx_messageInfo_PBContinueTxReq.Size(m)
}
func (m *PBContinueTxReq) XXX_DiscardUnknown() {
xxx_messageInfo_PBContinueTxReq.DiscardUnknown(m)
}
var xxx_messageInfo_PBContinueTxReq proto.InternalMessageInfo
func (m *PBContinueTxReq) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
func (m *PBContinueTxReq) GetFee() int64 {
if m != nil {
return m.Fee
}
return 0
}
type PBQuitTxReq struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Fee int64 `protobuf:"varint,2,opt,name=fee,proto3" json:"fee,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBQuitTxReq) Reset() { *m = PBQuitTxReq{} }
func (m *PBQuitTxReq) String() string { return proto.CompactTextString(m) }
func (*PBQuitTxReq) ProtoMessage() {}
func (*PBQuitTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{40}
}
func (m *PBQuitTxReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBQuitTxReq.Unmarshal(m, b)
}
func (m *PBQuitTxReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBQuitTxReq.Marshal(b, m, deterministic)
}
func (m *PBQuitTxReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBQuitTxReq.Merge(m, src)
}
func (m *PBQuitTxReq) XXX_Size() int {
return xxx_messageInfo_PBQuitTxReq.Size(m)
}
func (m *PBQuitTxReq) XXX_DiscardUnknown() {
xxx_messageInfo_PBQuitTxReq.DiscardUnknown(m)
}
var xxx_messageInfo_PBQuitTxReq proto.InternalMessageInfo
func (m *PBQuitTxReq) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
func (m *PBQuitTxReq) GetFee() int64 {
if m != nil {
return m.Fee
}
return 0
}
type PBQueryReq struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
Fee int64 `protobuf:"varint,2,opt,name=fee,proto3" json:"fee,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PBQueryReq) Reset() { *m = PBQueryReq{} }
func (m *PBQueryReq) String() string { return proto.CompactTextString(m) }
func (*PBQueryReq) ProtoMessage() {}
func (*PBQueryReq) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{41}
}
func (m *PBQueryReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PBQueryReq.Unmarshal(m, b)
}
func (m *PBQueryReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PBQueryReq.Marshal(b, m, deterministic)
}
func (m *PBQueryReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_PBQueryReq.Merge(m, src)
}
func (m *PBQueryReq) XXX_Size() int {
return xxx_messageInfo_PBQueryReq.Size(m)
}
func (m *PBQueryReq) XXX_DiscardUnknown() {
xxx_messageInfo_PBQueryReq.DiscardUnknown(m)
}
var xxx_messageInfo_PBQueryReq proto.InternalMessageInfo
func (m *PBQueryReq) GetGameId() string {
if m != nil {
return m.GameId
}
return ""
}
func (m *PBQueryReq) GetFee() int64 {
if m != nil {
return m.Fee
}
return 0
}
// 索引value值 // 索引value值
type GuessGameRecord struct { type GuessGameRecord struct {
GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"` GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"`
...@@ -3105,7 +1813,7 @@ func (m *GuessGameRecord) Reset() { *m = GuessGameRecord{} } ...@@ -3105,7 +1813,7 @@ func (m *GuessGameRecord) Reset() { *m = GuessGameRecord{} }
func (m *GuessGameRecord) String() string { return proto.CompactTextString(m) } func (m *GuessGameRecord) String() string { return proto.CompactTextString(m) }
func (*GuessGameRecord) ProtoMessage() {} func (*GuessGameRecord) ProtoMessage() {}
func (*GuessGameRecord) Descriptor() ([]byte, []int) { func (*GuessGameRecord) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{42} return fileDescriptor_7574406c5d3430e8, []int{21}
} }
func (m *GuessGameRecord) XXX_Unmarshal(b []byte) error { func (m *GuessGameRecord) XXX_Unmarshal(b []byte) error {
...@@ -3159,7 +1867,7 @@ func (m *GuessGameIndexRecord) Reset() { *m = GuessGameIndexRecord{} } ...@@ -3159,7 +1867,7 @@ func (m *GuessGameIndexRecord) Reset() { *m = GuessGameIndexRecord{} }
func (m *GuessGameIndexRecord) String() string { return proto.CompactTextString(m) } func (m *GuessGameIndexRecord) String() string { return proto.CompactTextString(m) }
func (*GuessGameIndexRecord) ProtoMessage() {} func (*GuessGameIndexRecord) ProtoMessage() {}
func (*GuessGameIndexRecord) Descriptor() ([]byte, []int) { func (*GuessGameIndexRecord) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{43} return fileDescriptor_7574406c5d3430e8, []int{22}
} }
func (m *GuessGameIndexRecord) XXX_Unmarshal(b []byte) error { func (m *GuessGameIndexRecord) XXX_Unmarshal(b []byte) error {
...@@ -3205,7 +1913,7 @@ func (m *GuessGameRecords) Reset() { *m = GuessGameRecords{} } ...@@ -3205,7 +1913,7 @@ func (m *GuessGameRecords) Reset() { *m = GuessGameRecords{} }
func (m *GuessGameRecords) String() string { return proto.CompactTextString(m) } func (m *GuessGameRecords) String() string { return proto.CompactTextString(m) }
func (*GuessGameRecords) ProtoMessage() {} func (*GuessGameRecords) ProtoMessage() {}
func (*GuessGameRecords) Descriptor() ([]byte, []int) { func (*GuessGameRecords) Descriptor() ([]byte, []int) {
return fileDescriptor_7574406c5d3430e8, []int{44} return fileDescriptor_7574406c5d3430e8, []int{23}
} }
func (m *GuessGameRecords) XXX_Unmarshal(b []byte) error { func (m *GuessGameRecords) XXX_Unmarshal(b []byte) error {
...@@ -3239,30 +1947,12 @@ func init() { ...@@ -3239,30 +1947,12 @@ func init() {
proto.RegisterType((*GuessBet)(nil), "types.GuessBet") proto.RegisterType((*GuessBet)(nil), "types.GuessBet")
proto.RegisterType((*GuessBetStat)(nil), "types.GuessBetStat") proto.RegisterType((*GuessBetStat)(nil), "types.GuessBetStat")
proto.RegisterType((*GuessBetStatItem)(nil), "types.GuessBetStatItem") proto.RegisterType((*GuessBetStatItem)(nil), "types.GuessBetStatItem")
proto.RegisterType((*PokerBull)(nil), "types.PokerBull")
proto.RegisterType((*PBHand)(nil), "types.PBHand")
proto.RegisterType((*PBPlayer)(nil), "types.PBPlayer")
proto.RegisterType((*PBResult)(nil), "types.PBResult")
proto.RegisterType((*PBPoker)(nil), "types.PBPoker")
proto.RegisterType((*PBGameAction)(nil), "types.PBGameAction")
proto.RegisterType((*PBGameStart)(nil), "types.PBGameStart")
proto.RegisterType((*PBGameContinue)(nil), "types.PBGameContinue")
proto.RegisterType((*PBGameQuit)(nil), "types.PBGameQuit")
proto.RegisterType((*PBGameQuery)(nil), "types.PBGameQuery")
proto.RegisterType((*GuessGameAction)(nil), "types.GuessGameAction") proto.RegisterType((*GuessGameAction)(nil), "types.GuessGameAction")
proto.RegisterType((*GuessGameStart)(nil), "types.GuessGameStart") proto.RegisterType((*GuessGameStart)(nil), "types.GuessGameStart")
proto.RegisterType((*GuessGameBet)(nil), "types.GuessGameBet") proto.RegisterType((*GuessGameBet)(nil), "types.GuessGameBet")
proto.RegisterType((*GuessGameAbort)(nil), "types.GuessGameAbort") proto.RegisterType((*GuessGameAbort)(nil), "types.GuessGameAbort")
proto.RegisterType((*GuessGamePublish)(nil), "types.GuessGamePublish") proto.RegisterType((*GuessGamePublish)(nil), "types.GuessGamePublish")
proto.RegisterType((*GuessGameQuery)(nil), "types.GuessGameQuery") proto.RegisterType((*GuessGameQuery)(nil), "types.GuessGameQuery")
proto.RegisterType((*QueryPBGameListByStatusAndPlayerNum)(nil), "types.QueryPBGameListByStatusAndPlayerNum")
proto.RegisterType((*PBGameRecord)(nil), "types.PBGameRecord")
proto.RegisterType((*PBGameIndexRecord)(nil), "types.PBGameIndexRecord")
proto.RegisterType((*PBGameRecords)(nil), "types.PBGameRecords")
proto.RegisterType((*QueryPBGameInfo)(nil), "types.QueryPBGameInfo")
proto.RegisterType((*ReplyPBGame)(nil), "types.ReplyPBGame")
proto.RegisterType((*QueryPBGameInfos)(nil), "types.QueryPBGameInfos")
proto.RegisterType((*ReplyPBGameList)(nil), "types.ReplyPBGameList")
proto.RegisterType((*QueryGuessGameInfo)(nil), "types.QueryGuessGameInfo") proto.RegisterType((*QueryGuessGameInfo)(nil), "types.QueryGuessGameInfo")
proto.RegisterType((*ReplyGuessGameInfo)(nil), "types.ReplyGuessGameInfo") proto.RegisterType((*ReplyGuessGameInfo)(nil), "types.ReplyGuessGameInfo")
proto.RegisterType((*QueryGuessGameInfos)(nil), "types.QueryGuessGameInfos") proto.RegisterType((*QueryGuessGameInfos)(nil), "types.QueryGuessGameInfos")
...@@ -3273,9 +1963,6 @@ func init() { ...@@ -3273,9 +1963,6 @@ func init() {
proto.RegisterType((*GuessBetTxReq)(nil), "types.GuessBetTxReq") proto.RegisterType((*GuessBetTxReq)(nil), "types.GuessBetTxReq")
proto.RegisterType((*GuessAbortTxReq)(nil), "types.GuessAbortTxReq") proto.RegisterType((*GuessAbortTxReq)(nil), "types.GuessAbortTxReq")
proto.RegisterType((*GuessPublishTxReq)(nil), "types.GuessPublishTxReq") proto.RegisterType((*GuessPublishTxReq)(nil), "types.GuessPublishTxReq")
proto.RegisterType((*PBContinueTxReq)(nil), "types.PBContinueTxReq")
proto.RegisterType((*PBQuitTxReq)(nil), "types.PBQuitTxReq")
proto.RegisterType((*PBQueryReq)(nil), "types.PBQueryReq")
proto.RegisterType((*GuessGameRecord)(nil), "types.GuessGameRecord") proto.RegisterType((*GuessGameRecord)(nil), "types.GuessGameRecord")
proto.RegisterType((*GuessGameIndexRecord)(nil), "types.GuessGameIndexRecord") proto.RegisterType((*GuessGameIndexRecord)(nil), "types.GuessGameIndexRecord")
proto.RegisterType((*GuessGameRecords)(nil), "types.GuessGameRecords") proto.RegisterType((*GuessGameRecords)(nil), "types.GuessGameRecords")
...@@ -3284,120 +1971,87 @@ func init() { ...@@ -3284,120 +1971,87 @@ func init() {
func init() { proto.RegisterFile("guess.proto", fileDescriptor_7574406c5d3430e8) } func init() { proto.RegisterFile("guess.proto", fileDescriptor_7574406c5d3430e8) }
var fileDescriptor_7574406c5d3430e8 = []byte{ var fileDescriptor_7574406c5d3430e8 = []byte{
// 1808 bytes of a gzipped FileDescriptorProto // 1267 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4b, 0x6f, 0xdb, 0xca, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6f, 0xdb, 0xc6,
0x15, 0xb6, 0x1e, 0xd4, 0xe3, 0xc8, 0x92, 0xec, 0x71, 0xe2, 0xcb, 0x1a, 0x17, 0x85, 0xcb, 0xeb, 0x13, 0x8f, 0x48, 0x51, 0x8f, 0x91, 0x65, 0x2b, 0xeb, 0x3c, 0xf6, 0x6f, 0x04, 0x7f, 0xa8, 0x44,
0xde, 0x28, 0x45, 0x93, 0x16, 0x32, 0x90, 0x36, 0x29, 0x5a, 0xc0, 0x4a, 0x80, 0xd8, 0x40, 0x10, 0xd0, 0xaa, 0x87, 0xa4, 0x85, 0x02, 0xf4, 0x60,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0x8b, 0xa8, 0xe8,
0x77, 0x2f, 0x14, 0x36, 0xd6, 0x98, 0x74, 0xd3, 0xd3, 0xa8, 0xe0, 0xb7, 0xa3, 0x1a, 0xfe, 0x89,
0x70, 0xfa, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6c, 0x1e, 0x01, 0xe9, 0x6d, 0x18, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
......
...@@ -5,9 +5,16 @@ ...@@ -5,9 +5,16 @@
package types package types
import ( import (
"encoding/json"
"github.com/33cn/chain33/common/address"
"reflect" "reflect"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
log "github.com/33cn/chain33/common/log/log15"
)
var (
llog = log.New("module", "exectype." + GuessX)
) )
func init() { func init() {
...@@ -53,5 +60,149 @@ func (t *GuessType) GetLogMap() map[int64]*types.LogInfo { ...@@ -53,5 +60,149 @@ func (t *GuessType) GetLogMap() map[int64]*types.LogInfo {
} }
} }
// CreateTx method
func (t *GuessType) CreateTx(action string, message json.RawMessage) (*types.Transaction, error) {
llog.Debug("Guess.CreateTx", "action", action)
if action == "GuessStart" {
var param GuessStartTxReq
err := json.Unmarshal(message, &param)
if err != nil {
llog.Error("CreateTx.GuessStart", "Error", err)
return nil, types.ErrInvalidParam
}
return CreateRawGuessStartTx(&param)
} else if action == "GuessBet" {
var param GuessBetTxReq
err := json.Unmarshal(message, &param)
if err != nil {
llog.Error("CreateTx.GuessBet", "Error", err)
return nil, types.ErrInvalidParam
}
return CreateRawGuessBetTx(&param)
} else if action == "GuessPublish" {
var param GuessPublishTxReq
err := json.Unmarshal(message, &param)
if err != nil {
llog.Error("CreateTx.GuessPublish", "Error", err)
return nil, types.ErrInvalidParam
}
return CreateRawGuessPublishTx(&param)
} else if action == "GuessAbort" {
var param GuessAbortTxReq
err := json.Unmarshal(message, &param)
if err != nil {
llog.Error("CreateTx.GuessAbort", "Error", err)
return nil, types.ErrInvalidParam
}
return CreateRawGuessAbortTx(&param)
} else {
return nil, types.ErrNotSupport
}
}
// CreateRawLotteryCreateTx method
func CreateRawGuessStartTx(parm *GuessGameStart) (*types.Transaction, error) {
if parm == nil {
llog.Error("CreateRawGuessStartTx", "parm", parm)
return nil, types.ErrInvalidParam
}
val := &GuessGameAction{
Ty: GuessGameActionStart,
Value: &GuessGameAction_Start{Start: parm},
}
name := types.ExecName(GuessX)
tx := &types.Transaction{
Execer: []byte(types.ExecName(GuessX)),
Payload: types.Encode(val),
Fee: parm.Fee,
To: address.ExecAddress(name),
}
tx, err := types.FormatTx(name, tx)
if err != nil {
return nil, err
}
return tx, nil
}
// CreateRawGuessBetTx method
func CreateRawGuessBetTx(parm *GuessGameBet) (*types.Transaction, error) {
if parm == nil {
llog.Error("CreateRawGuessBet", "parm", parm)
return nil, types.ErrInvalidParam
}
val := &GuessGameAction{
Ty: GuessGameActionBet,
Value: &GuessGameAction_Bet{Bet: parm},
}
name := types.ExecName(GuessX)
tx := &types.Transaction{
Execer: []byte(types.ExecName(GuessX)),
Payload: types.Encode(val),
Fee: parm.Fee,
To: address.ExecAddress(name),
}
tx, err := types.FormatTx(name, tx)
if err != nil {
return nil, err
}
return tx, nil
}
// CreateRawGuessPublishTx method
func CreateRawGuessPublishTx(parm *GuessGamePublish) (*types.Transaction, error) {
if parm == nil {
llog.Error("CreateRawGuessPublish", "parm", parm)
return nil, types.ErrInvalidParam
}
val := &GuessGameAction{
Ty: GuessGameActionPublish,
Value: &GuessGameAction_Publish{Publish: parm},
}
name := types.ExecName(GuessX)
tx := &types.Transaction{
Execer: []byte(types.ExecName(GuessX)),
Payload: types.Encode(val),
Fee: parm.Fee,
To: address.ExecAddress(name),
}
tx, err := types.FormatTx(name, tx)
if err != nil {
return nil, err
}
return tx, nil
}
// CreateRawGuessAbortTx method
func CreateRawGuessAbortTx(parm *GuessGameAbort) (*types.Transaction, error) {
if parm == nil {
llog.Error("CreateRawGuessAbortTx", "parm", parm)
return nil, types.ErrInvalidParam
}
val := &GuessGameAction{
Ty: GuessGameActionAbort,
Value: &GuessGameAction_Abort{Abort: parm},
}
name := types.ExecName(GuessX)
tx := &types.Transaction{
Execer: []byte(types.ExecName(GuessX)),
Payload: types.Encode(val),
Fee: parm.Fee,
To: address.ExecAddress(name),
}
tx, err := types.FormatTx(name, tx)
if err != nil {
return nil, err
}
return tx, nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment