Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
14a2af66
Commit
14a2af66
authored
Dec 14, 2018
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
9e3a8968
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
16 deletions
+14
-16
game.go
plugin/dapp/pokerbull/commands/game.go
+4
-4
pokerbulldb.go
plugin/dapp/pokerbull/executor/pokerbulldb.go
+1
-1
query.go
plugin/dapp/pokerbull/executor/query.go
+2
-3
const.go
plugin/dapp/pokerbull/types/const.go
+1
-3
pokerbull.pb.go
plugin/dapp/pokerbull/types/pokerbull.pb.go
+2
-1
types.go
plugin/dapp/pokerbull/types/types.go
+4
-4
No files found.
plugin/dapp/pokerbull/commands/game.go
View file @
14a2af66
...
@@ -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
...
...
plugin/dapp/pokerbull/executor/pokerbulldb.go
View file @
14a2af66
...
@@ -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"
,
...
...
plugin/dapp/pokerbull/executor/query.go
View file @
14a2af66
...
@@ -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
...
...
plugin/dapp/pokerbull/types/const.go
View file @
14a2af66
...
@@ -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
plugin/dapp/pokerbull/types/pokerbull.pb.go
View file @
14a2af66
...
@@ -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.
...
...
plugin/dapp/pokerbull/types/types.go
View file @
14a2af66
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment