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
9b5c0ca6
Commit
9b5c0ca6
authored
Dec 21, 2018
by
pengjun
Committed by
vipwzw
Jan 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复2人局匹配3玩家问题
parent
f4d8ec54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
pokerbulldb.go
plugin/dapp/pokerbull/executor/pokerbulldb.go
+8
-2
No files found.
plugin/dapp/pokerbull/executor/pokerbulldb.go
View file @
9b5c0ca6
...
...
@@ -505,13 +505,19 @@ func (action *Action) newGame(gameID string, start *pkt.PBGameStart) (*pkt.Poker
// 筛选合适的牌局
func
(
action
*
Action
)
selectGameFromIds
(
ids
[]
string
,
value
int64
)
*
pkt
.
PokerBull
{
var
gameRet
*
pkt
.
PokerBull
for
_
,
id
:=
range
ids
{
for
num
:=
len
(
ids
)
-
1
;
num
>
-
1
;
num
--
{
id
:=
ids
[
num
]
game
,
err
:=
action
.
readGame
(
id
)
if
err
!=
nil
{
logger
.
Error
(
"Poker bull game start"
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"get game failed"
,
id
,
"err"
,
err
)
continue
}
// 玩家已经满了,不需要再匹配(防止多交易在同一区块没有刷新localdb的场景)
if
int32
(
len
(
game
.
Players
))
==
game
.
PlayerNum
{
continue
}
//不能自己和自己玩
if
action
.
checkDupPlayerAddress
(
id
,
game
.
Players
)
!=
nil
{
continue
...
...
@@ -593,7 +599,7 @@ func (action *Action) GameStart(start *pkt.PBGameStart) (*types.Receipt, error)
return
nil
,
err
}
}
logger
.
Debug
(
fmt
.
Sprintf
(
"Match a new game %s for player %s"
,
game
.
GameId
,
game
.
GameId
))
logger
.
Debug
(
fmt
.
Sprintf
(
"Match a new game %s for player %s"
,
game
.
GameId
,
action
.
fromaddr
))
}
//发牌随机数取txhash
...
...
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