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
929cdc00
Commit
929cdc00
authored
Dec 29, 2018
by
pengjun
Committed by
vipwzw
Jan 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pokerbull调整游戏结束状态
parent
c18f93fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
pokerbulldb.go
plugin/dapp/pokerbull/executor/pokerbulldb.go
+8
-1
const.go
plugin/dapp/pokerbull/types/const.go
+1
-1
No files found.
plugin/dapp/pokerbull/executor/pokerbulldb.go
View file @
929cdc00
...
@@ -794,6 +794,11 @@ func (action *Action) GameQuit(pbend *pkt.PBGameQuit) (*types.Receipt, error) {
...
@@ -794,6 +794,11 @@ func (action *Action) GameQuit(pbend *pkt.PBGameQuit) (*types.Receipt, error) {
return
nil
,
err
return
nil
,
err
}
}
if
game
.
Status
==
pkt
.
PBGameActionQuit
{
logger
.
Error
(
"Quit pokerbull game"
,
"GameID"
,
pbend
.
GetGameId
(),
"value"
,
game
.
Value
,
"err"
,
"already game over"
)
return
nil
,
fmt
.
Errorf
(
"already game over"
)
}
if
!
action
.
checkPlayerAddressExist
(
game
.
Players
)
{
if
!
action
.
checkPlayerAddressExist
(
game
.
Players
)
{
if
action
.
fromaddr
!=
pkt
.
PlatformSignAddress
{
if
action
.
fromaddr
!=
pkt
.
PlatformSignAddress
{
logger
.
Error
(
"GameEnd"
,
"GameID"
,
pbend
.
GetGameId
(),
"addr"
,
action
.
fromaddr
,
"execaddr"
,
logger
.
Error
(
"GameEnd"
,
"GameID"
,
pbend
.
GetGameId
(),
"addr"
,
action
.
fromaddr
,
"execaddr"
,
...
@@ -939,8 +944,10 @@ func (action *Action) GamePlay(pbplay *pkt.PBGamePlay) (*types.Receipt, error) {
...
@@ -939,8 +944,10 @@ func (action *Action) GamePlay(pbplay *pkt.PBGamePlay) (*types.Receipt, error) {
game
.
Players
=
append
(
game
.
Players
,
player
)
game
.
Players
=
append
(
game
.
Players
,
player
)
}
}
game
.
Status
=
pkt
.
PBGameAction
Continue
// 更新游戏状态
game
.
Status
=
pkt
.
PBGameAction
Quit
// 更新游戏状态
game
.
PreStatus
=
pkt
.
PBGameActionStart
game
.
PreStatus
=
pkt
.
PBGameActionStart
game
.
QuitTime
=
time
.
Unix
(
action
.
blocktime
,
0
)
.
Format
(
"2006-01-02 15:04:05"
)
game
.
QuitTxHash
=
common
.
ToHex
(
action
.
txhash
)
}
}
logger
.
Info
(
fmt
.
Sprintf
(
"Game starting: %s round: %d"
,
game
.
GameId
,
game
.
Round
))
logger
.
Info
(
fmt
.
Sprintf
(
"Game starting: %s round: %d"
,
game
.
GameId
,
game
.
Round
))
...
...
plugin/dapp/pokerbull/types/const.go
View file @
929cdc00
...
@@ -87,7 +87,7 @@ const (
...
@@ -87,7 +87,7 @@ const (
// DeveloperFee 开发者佣金
// DeveloperFee 开发者佣金
DeveloperFee
=
int64
(
0.005
*
float64
(
types
.
Coin
))
DeveloperFee
=
int64
(
0.005
*
float64
(
types
.
Coin
))
// WinnerReturn 赢家回报率
// WinnerReturn 赢家回报率
WinnerReturn
=
types
.
Coin
-
DeveloperFee
WinnerReturn
=
types
.
Coin
-
DeveloperFee
-
PlatformFee
// PlatformSignAddress 平台签名地址
// PlatformSignAddress 平台签名地址
PlatformSignAddress
=
"1Geb4ppNiAwMKKyrJgcis3JA57FkqsXvdR"
PlatformSignAddress
=
"1Geb4ppNiAwMKKyrJgcis3JA57FkqsXvdR"
)
)
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