Commit 14a2af66 authored by vipwzw's avatar vipwzw

auto ci

parent 9e3a8968
...@@ -167,7 +167,7 @@ func pokerbullQuery(cmd *cobra.Command, args []string) { ...@@ -167,7 +167,7 @@ func pokerbullQuery(cmd *cobra.Command, args []string) {
indexstr, _ := cmd.Flags().GetString("index") indexstr, _ := cmd.Flags().GetString("index")
index, _ := strconv.ParseInt(indexstr, 10, 64) index, _ := strconv.ParseInt(indexstr, 10, 64)
gameIDs, _ := cmd.Flags().GetString("gameIDs") gameIDs, _ := cmd.Flags().GetString("gameIDs")
round,_ := cmd.Flags().GetString("round") round, _ := cmd.Flags().GetString("round")
var params rpctypes.Query4Jrpc var params rpctypes.Query4Jrpc
params.Execer = pkt.PokerBullX params.Execer = pkt.PokerBullX
...@@ -186,14 +186,14 @@ func pokerbullQuery(cmd *cobra.Command, args []string) { ...@@ -186,14 +186,14 @@ func pokerbullQuery(cmd *cobra.Command, args []string) {
ctx.Run() ctx.Run()
} else { } else {
params.FuncName = pkt.FuncNameQueryGameByRound params.FuncName = pkt.FuncNameQueryGameByRound
roundInt,err := strconv.ParseInt(round, 10, 32) roundInt, err := strconv.ParseInt(round, 10, 32)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
return return
} }
req := &pkt.QueryPBGameByRound{ req := &pkt.QueryPBGameByRound{
GameId:gameID, GameId: gameID,
Round:int32(roundInt), Round: int32(roundInt),
} }
params.Payload = types.MustPBToJSON(req) params.Payload = types.MustPBToJSON(req)
var res pkt.ReplyPBGameByRound var res pkt.ReplyPBGameByRound
......
...@@ -418,7 +418,7 @@ func (action *Action) settleDefaultAccount(lastAddress string, game *pkt.PokerBu ...@@ -418,7 +418,7 @@ func (action *Action) settleDefaultAccount(lastAddress string, game *pkt.PokerBu
// 佣金扣除 // 佣金扣除
func (action *Action) defaultFeeTransfer(winner string, feeAddr string, fee int64, value int64) *types.Receipt { func (action *Action) defaultFeeTransfer(winner string, feeAddr string, fee int64, value int64) *types.Receipt {
receipt, err := action.coinsAccount.ExecTransfer(winner, feeAddr, action.execaddr, (value/types.Coin) * fee /**int64(result.Leverage)*/) //TODO Dealer:暂时不支持倍数 receipt, err := action.coinsAccount.ExecTransfer(winner, feeAddr, action.execaddr, (value/types.Coin)*fee /**int64(result.Leverage)*/) //TODO Dealer:暂时不支持倍数
if err != nil { if err != nil {
action.coinsAccount.ExecFrozen(winner, action.execaddr, (value/types.Coin)*fee) // rollback action.coinsAccount.ExecFrozen(winner, action.execaddr, (value/types.Coin)*fee) // rollback
logger.Error("GameSettleDefault.ExecTransfer", "addr", winner, "execaddr", action.execaddr, "amount", logger.Error("GameSettleDefault.ExecTransfer", "addr", winner, "execaddr", action.execaddr, "amount",
......
...@@ -64,7 +64,7 @@ func (g *PokerBull) Query_QueryGameByRound(in *pkt.QueryPBGameByRound) (types.Me ...@@ -64,7 +64,7 @@ func (g *PokerBull) Query_QueryGameByRound(in *pkt.QueryPBGameByRound) (types.Me
} }
roundPlayer := &pkt.PBPlayer{ roundPlayer := &pkt.PBPlayer{
Address: player.Address, Address: player.Address,
Ready : isReady, Ready: isReady,
} }
roundPlayers = append(roundPlayers, roundPlayer) roundPlayers = append(roundPlayers, roundPlayer)
} }
...@@ -76,7 +76,6 @@ func (g *PokerBull) Query_QueryGameByRound(in *pkt.QueryPBGameByRound) (types.Me ...@@ -76,7 +76,6 @@ func (g *PokerBull) Query_QueryGameByRound(in *pkt.QueryPBGameByRound) (types.Me
result = game.Results[in.Round-1] result = game.Results[in.Round-1]
} }
gameInfo := &pkt.ReplyPBGameByRound{ gameInfo := &pkt.ReplyPBGameByRound{
GameId: game.GameId, GameId: game.GameId,
Status: game.Status, Status: game.Status,
...@@ -84,7 +83,7 @@ func (g *PokerBull) Query_QueryGameByRound(in *pkt.QueryPBGameByRound) (types.Me ...@@ -84,7 +83,7 @@ func (g *PokerBull) Query_QueryGameByRound(in *pkt.QueryPBGameByRound) (types.Me
IsWaiting: game.IsWaiting, IsWaiting: game.IsWaiting,
Value: game.Value, Value: game.Value,
Players: roundPlayers, Players: roundPlayers,
Return: (game.Value/types.Coin) * pkt.WinnerReturn, Return: (game.Value / types.Coin) * pkt.WinnerReturn,
} }
return gameInfo, nil return gameInfo, nil
......
...@@ -60,7 +60,6 @@ const ( ...@@ -60,7 +60,6 @@ const (
CreatequitTx = "CreatequitTx" CreatequitTx = "CreatequitTx"
) )
const ( const (
// ListDESC 降序 // ListDESC 降序
ListDESC = int32(0) ListDESC = int32(0)
...@@ -82,4 +81,4 @@ const ( ...@@ -82,4 +81,4 @@ const (
DeveloperFee = int64(0.005 * float64(types.Coin)) DeveloperFee = int64(0.005 * float64(types.Coin))
// WinnerReturn 赢家回报率 // WinnerReturn 赢家回报率
WinnerReturn = types.Coin - DeveloperFee WinnerReturn = types.Coin - DeveloperFee
) )
\ No newline at end of file
...@@ -6,10 +6,11 @@ package types ...@@ -6,10 +6,11 @@ package types
import ( import (
context "context" context "context"
fmt "fmt" fmt "fmt"
math "math"
types "github.com/33cn/chain33/types" types "github.com/33cn/chain33/types"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
math "math"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
......
...@@ -7,10 +7,11 @@ package types ...@@ -7,10 +7,11 @@ package types
import ( import (
"reflect" "reflect"
"github.com/33cn/chain33/types"
"encoding/json" "encoding/json"
log "github.com/33cn/chain33/common/log/log15"
"errors" "errors"
log "github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
) )
var ( var (
...@@ -140,4 +141,4 @@ func CreateRawPBQuitTx(head *PBGameQuit) (*types.Transaction, error) { ...@@ -140,4 +141,4 @@ func CreateRawPBQuitTx(head *PBGameQuit) (*types.Transaction, error) {
return nil, err return nil, err
} }
return tx, nil return tx, nil
} }
\ No newline at end of file
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