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
374b034b
Commit
374b034b
authored
Dec 05, 2018
by
张振华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge master
parent
1563bca8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
22 deletions
+23
-22
game.go
plugin/dapp/guess/commands/game.go
+22
-21
guessdb.go
plugin/dapp/guess/executor/guessdb.go
+1
-1
No files found.
plugin/dapp/guess/commands/game.go
View file @
374b034b
...
@@ -7,6 +7,7 @@ package commands
...
@@ -7,6 +7,7 @@ package commands
import
(
import
(
"fmt"
"fmt"
jsonrpc
"github.com/33cn/chain33/rpc/jsonclient"
jsonrpc
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
"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"
...
@@ -107,7 +108,7 @@ func guessStart(cmd *cobra.Command, args []string) {
...
@@ -107,7 +108,7 @@ func guessStart(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"guess.GuessStartTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"guess.GuessStartTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -143,7 +144,7 @@ func guessBet(cmd *cobra.Command, args []string) {
...
@@ -143,7 +144,7 @@ func guessBet(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"guess.GuessBetTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"guess.GuessBetTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -171,7 +172,7 @@ func guessAbort(cmd *cobra.Command, args []string) {
...
@@ -171,7 +172,7 @@ func guessAbort(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"guess.GuessAbortTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"guess.GuessAbortTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -204,7 +205,7 @@ func guessPublish(cmd *cobra.Command, args []string) {
...
@@ -204,7 +205,7 @@ func guessPublish(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"guess.GuessPublishTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"guess.GuessPublishTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -242,7 +243,7 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -242,7 +243,7 @@ func guessQuery(cmd *cobra.Command, args []string) {
category
,
_
:=
cmd
.
Flags
()
.
GetString
(
"category"
)
category
,
_
:=
cmd
.
Flags
()
.
GetString
(
"category"
)
fmt
.
Println
(
"ooo"
)
fmt
.
Println
(
"ooo"
)
var
params
types
.
Query4Cli
var
params
rpctypes
.
Query4Jrpc
params
.
Execer
=
pkt
.
GuessX
params
.
Execer
=
pkt
.
GuessX
//query type,
//query type,
...
@@ -261,9 +262,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -261,9 +262,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
GameIds
:
gameIds
,
GameIds
:
gameIds
,
}
}
params
.
FuncName
=
pkt
.
FuncName_QueryGamesByIds
params
.
FuncName
=
pkt
.
FuncName_QueryGamesByIds
params
.
Payload
=
req
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
pkt
.
ReplyGuessGameInfos
var
res
pkt
.
ReplyGuessGameInfos
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
case
2
:
case
2
:
...
@@ -271,9 +272,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -271,9 +272,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
GameId
:
gameId
,
GameId
:
gameId
,
}
}
params
.
FuncName
=
pkt
.
FuncName_QueryGameById
params
.
FuncName
=
pkt
.
FuncName_QueryGameById
params
.
Payload
=
req
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
pkt
.
ReplyGuessGameInfo
var
res
pkt
.
ReplyGuessGameInfo
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
case
3
:
case
3
:
...
@@ -282,9 +283,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -282,9 +283,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
Index
:
index
,
Index
:
index
,
}
}
params
.
FuncName
=
pkt
.
FuncName_QueryGameByAddr
params
.
FuncName
=
pkt
.
FuncName_QueryGameByAddr
params
.
Payload
=
req
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
pkt
.
GuessGameRecords
var
res
pkt
.
GuessGameRecords
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
case
4
:
case
4
:
...
@@ -293,9 +294,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -293,9 +294,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
Index
:
index
,
Index
:
index
,
}
}
params
.
FuncName
=
pkt
.
FuncName_QueryGameByStatus
params
.
FuncName
=
pkt
.
FuncName_QueryGameByStatus
params
.
Payload
=
req
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
pkt
.
GuessGameRecords
var
res
pkt
.
GuessGameRecords
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
case
5
:
case
5
:
...
@@ -304,9 +305,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -304,9 +305,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
Index
:
index
,
Index
:
index
,
}
}
params
.
FuncName
=
pkt
.
FuncName_QueryGameByAdminAddr
params
.
FuncName
=
pkt
.
FuncName_QueryGameByAdminAddr
params
.
Payload
=
req
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
pkt
.
GuessGameRecords
var
res
pkt
.
GuessGameRecords
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
case
6
:
case
6
:
...
@@ -316,9 +317,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -316,9 +317,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
Index
:
index
,
Index
:
index
,
}
}
params
.
FuncName
=
pkt
.
FuncName_QueryGameByAddrStatus
params
.
FuncName
=
pkt
.
FuncName_QueryGameByAddrStatus
params
.
Payload
=
req
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
pkt
.
GuessGameRecords
var
res
pkt
.
GuessGameRecords
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
...
@@ -329,9 +330,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -329,9 +330,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
Index
:
index
,
Index
:
index
,
}
}
params
.
FuncName
=
pkt
.
FuncName_QueryGameByAdminStatus
params
.
FuncName
=
pkt
.
FuncName_QueryGameByAdminStatus
params
.
Payload
=
req
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
pkt
.
GuessGameRecords
var
res
pkt
.
GuessGameRecords
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
case
8
:
case
8
:
...
@@ -341,9 +342,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
...
@@ -341,9 +342,9 @@ func guessQuery(cmd *cobra.Command, args []string) {
Index
:
index
,
Index
:
index
,
}
}
params
.
FuncName
=
pkt
.
FuncName_QueryGameByCategoryStatus
params
.
FuncName
=
pkt
.
FuncName_QueryGameByCategoryStatus
params
.
Payload
=
req
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
pkt
.
GuessGameRecords
var
res
pkt
.
GuessGameRecords
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
}
}
plugin/dapp/guess/executor/guessdb.go
View file @
374b034b
...
@@ -76,7 +76,7 @@ func NewAction(guess *Guess, tx *types.Transaction, index int) *Action {
...
@@ -76,7 +76,7 @@ func NewAction(guess *Guess, tx *types.Transaction, index int) *Action {
execaddr
:
dapp
.
ExecAddress
(
string
(
tx
.
Execer
)),
execaddr
:
dapp
.
ExecAddress
(
string
(
tx
.
Execer
)),
localDB
:
guess
.
GetLocalDB
(),
localDB
:
guess
.
GetLocalDB
(),
index
:
index
,
index
:
index
,
api
:
guess
.
GetA
pi
(),
api
:
guess
.
GetA
PI
(),
conn
:
conn
,
conn
:
conn
,
grpcClient
:
grpcClient
,
grpcClient
:
grpcClient
,
}
}
...
...
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