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
2447cb40
Commit
2447cb40
authored
Nov 21, 2018
by
gitlab
Committed by
vipwzw
Nov 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
1128378d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
33 additions
and
32 deletions
+33
-32
authority.go
plugin/dapp/cert/authority/authority.go
+4
-4
cryptogen.go
plugin/dapp/cert/authority/tools/cryptogen/cryptogen.go
+3
-3
csp.go
...in/dapp/cert/authority/tools/cryptogen/factory/csp/csp.go
+1
-1
const.go
plugin/dapp/cert/types/const.go
+1
-1
errors.go
plugin/dapp/cert/types/errors.go
+3
-3
types.go
plugin/dapp/cert/types/types.go
+2
-2
poker.go
plugin/dapp/pokerbull/executor/poker.go
+5
-5
pokerbulldb.go
plugin/dapp/pokerbull/executor/pokerbulldb.go
+4
-3
rpc.go
plugin/dapp/pokerbull/rpc/rpc.go
+3
-3
const.go
plugin/dapp/pokerbull/types/const.go
+7
-7
No files found.
plugin/dapp/cert/authority/authority.go
View file @
2447cb40
...
...
@@ -22,14 +22,14 @@ import (
)
var
(
alog
=
log
.
New
(
"module"
,
"authority"
)
cpuNum
=
runtime
.
NumCPU
()
alog
=
log
.
New
(
"module"
,
"authority"
)
cpuNum
=
runtime
.
NumCPU
()
// OrgName 默认证书组织名
OrgName
=
"Chain33"
OrgName
=
"Chain33"
// Author 全局证书校验器
Author
=
&
Authority
{}
Author
=
&
Authority
{}
// IsAuthEnable 是否开启全局校验开关
IsAuthEnable
=
false
...
...
plugin/dapp/cert/authority/tools/cryptogen/cryptogen.go
View file @
2447cb40
...
...
@@ -18,13 +18,13 @@ import (
const
(
// CANAME 默认CA名称
CANAME
=
"ca"
CANAME
=
"ca"
// CONFIGFILENAME 配置文件名
CONFIGFILENAME
=
"chain33.cryptogen.toml"
// OUTPUTDIR 证书文件输出路径
OUTPUTDIR
=
"./authdir/crypto"
OUTPUTDIR
=
"./authdir/crypto"
// ORGNAME 默认组织名
ORGNAME
=
"Chain33"
ORGNAME
=
"Chain33"
)
// Config 证书生成工具配置
...
...
plugin/dapp/cert/authority/tools/cryptogen/factory/csp/csp.go
View file @
2447cb40
...
...
@@ -10,7 +10,7 @@ const (
// ECDSAP256KeyGen ECDSA类型
ECDSAP256KeyGen
=
1
// SM2P256KygGen SM2类型
SM2P256KygGen
=
2
SM2P256KygGen
=
2
)
// Key 通用key接口
...
...
plugin/dapp/cert/types/const.go
View file @
2447cb40
...
...
@@ -6,7 +6,7 @@ package types
var
(
// CertX cert执行器名
CertX
=
"cert"
CertX
=
"cert"
// ExecerCert cert执行器字节
ExecerCert
=
[]
byte
(
CertX
)
actionName
=
map
[
string
]
int32
{
...
...
plugin/dapp/cert/types/errors.go
View file @
2447cb40
...
...
@@ -8,11 +8,11 @@ import "errors"
var
(
// ErrValidateCertFailed cert校验失败
ErrValidateCertFailed
=
errors
.
New
(
"ErrValidateCertFailed"
)
ErrValidateCertFailed
=
errors
.
New
(
"ErrValidateCertFailed"
)
// ErrGetHistoryCertData 获取证书错误
ErrGetHistoryCertData
=
errors
.
New
(
"ErrGetHistoryCertData"
)
ErrGetHistoryCertData
=
errors
.
New
(
"ErrGetHistoryCertData"
)
// ErrUnknowAuthSignType 无效签名类型
ErrUnknowAuthSignType
=
errors
.
New
(
"ErrUnknowAuthSignType"
)
ErrUnknowAuthSignType
=
errors
.
New
(
"ErrUnknowAuthSignType"
)
// ErrInitializeAuthority 初始化校验器失败
ErrInitializeAuthority
=
errors
.
New
(
"ErrInitializeAuthority"
)
)
plugin/dapp/cert/types/types.go
View file @
2447cb40
...
...
@@ -12,8 +12,8 @@ const (
CertActionUpdate
=
2
CertActionNormal
=
3
AuthECDSA
=
257
AuthSM2
=
258
AuthECDSA
=
257
AuthSM2
=
258
)
func
init
()
{
...
...
plugin/dapp/pokerbull/executor/poker.go
View file @
2447cb40
...
...
@@ -29,15 +29,15 @@ var CardNumPerGame = 5
const
(
// PokerbullResultX1 赌注倍数1倍
PokerbullResultX1
=
1
PokerbullResultX1
=
1
// PokerbullResultX2 赌注倍数2倍
PokerbullResultX2
=
2
PokerbullResultX2
=
2
// PokerbullResultX3 赌注倍数3倍
PokerbullResultX3
=
3
PokerbullResultX3
=
3
// PokerbullResultX4 赌注倍数4倍
PokerbullResultX4
=
4
PokerbullResultX4
=
4
// PokerbullResultX5 赌注倍数5倍
PokerbullResultX5
=
5
PokerbullResultX5
=
5
// PokerbullLeverageMax 赌注倍数最大倍数
PokerbullLeverageMax
=
PokerbullResultX1
)
...
...
plugin/dapp/pokerbull/executor/pokerbulldb.go
View file @
2447cb40
...
...
@@ -22,13 +22,13 @@ const (
// ListDESC 降序
ListDESC
=
int32
(
0
)
// DefaultCount 默认一次取多少条记录
DefaultCount
=
int32
(
20
)
DefaultCount
=
int32
(
20
)
// MaxPlayerNum 最大玩家数
MaxPlayerNum
=
5
// MinPlayValue 最小赌注
MinPlayValue
=
10
*
types
.
Coin
// DefaultStyle默认游戏类型
DefaultStyle
=
pkt
.
PlayStyleDefault
DefaultStyle
=
pkt
.
PlayStyleDefault
)
// Action 斗牛action结构
...
...
@@ -43,6 +43,7 @@ type Action struct {
localDB
dbm
.
Lister
index
int
}
// NewAction 创建action
func
NewAction
(
pb
*
PokerBull
,
tx
*
types
.
Transaction
,
index
int
)
*
Action
{
hash
:=
tx
.
Hash
()
...
...
@@ -614,7 +615,7 @@ func (action *Action) GameStart(start *pkt.PBGameStart) (*types.Receipt, error)
logs
=
append
(
logs
,
receiptLog
)
kv
=
append
(
kv
,
action
.
saveGame
(
game
)
...
)
return
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
kv
,
Logs
:
logs
},
nil
return
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
kv
,
Logs
:
logs
},
nil
}
func
getReadyPlayerNum
(
players
[]
*
pkt
.
PBPlayer
)
int
{
...
...
plugin/dapp/pokerbull/rpc/rpc.go
View file @
2447cb40
...
...
@@ -33,7 +33,7 @@ func (c *channelClient) Start(ctx context.Context, head *pb.PBGameStart) (*types
func
(
c
*
channelClient
)
Continue
(
ctx
context
.
Context
,
head
*
pb
.
PBGameContinue
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
pb
.
PBGameAction
{
Ty
:
pb
.
PBGameActionContinue
,
Value
:
&
pb
.
PBGameAction_Continue
{
Continue
:
head
},
Value
:
&
pb
.
PBGameAction_Continue
{
Continue
:
head
},
}
tx
,
err
:=
types
.
CreateFormatTx
(
pb
.
PokerBullX
,
types
.
Encode
(
val
))
if
err
!=
nil
{
...
...
@@ -46,7 +46,7 @@ func (c *channelClient) Continue(ctx context.Context, head *pb.PBGameContinue) (
func
(
c
*
channelClient
)
Quit
(
ctx
context
.
Context
,
head
*
pb
.
PBGameQuit
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
pb
.
PBGameAction
{
Ty
:
pb
.
PBGameActionQuit
,
Value
:
&
pb
.
PBGameAction_Quit
{
Quit
:
head
},
Value
:
&
pb
.
PBGameAction_Quit
{
Quit
:
head
},
}
tx
,
err
:=
types
.
CreateFormatTx
(
pb
.
PokerBullX
,
types
.
Encode
(
val
))
if
err
!=
nil
{
...
...
@@ -59,7 +59,7 @@ func (c *channelClient) Quit(ctx context.Context, head *pb.PBGameQuit) (*types.U
func
(
c
*
channelClient
)
Show
(
ctx
context
.
Context
,
head
*
pb
.
PBGameQuery
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
pb
.
PBGameAction
{
Ty
:
pb
.
PBGameActionQuery
,
Value
:
&
pb
.
PBGameAction_Query
{
Query
:
head
},
Value
:
&
pb
.
PBGameAction_Query
{
Query
:
head
},
}
tx
,
err
:=
types
.
CreateFormatTx
(
pb
.
PokerBullX
,
types
.
Encode
(
val
))
if
err
!=
nil
{
...
...
plugin/dapp/pokerbull/types/const.go
View file @
2447cb40
...
...
@@ -21,13 +21,13 @@ const (
const
(
// TyLogPBGameStart log for start PBgame
TyLogPBGameStart
=
721
// TyLogPBGameContinue log for continue PBgame
TyLogPBGameStart
=
721
// TyLogPBGameContinue log for continue PBgame
TyLogPBGameContinue
=
722
// TyLogPBGameQuit log for quit PBgame
TyLogPBGameQuit
=
723
TyLogPBGameQuit
=
723
// TyLogPBGameQuery log for query PBgame
TyLogPBGameQuery
=
724
TyLogPBGameQuery
=
724
)
//包的名字可以通过配置文件来配置
...
...
@@ -43,9 +43,9 @@ const (
// FuncNameQueryGameListByIDs 根据id列表查询game列表
FuncNameQueryGameListByIDs
=
"QueryGameListByIDs"
// FuncNameQueryGameByID 根据id查询game
FuncNameQueryGameByID
=
"QueryGameByID"
FuncNameQueryGameByID
=
"QueryGameByID"
// FuncNameQueryGameByAddr 根据地址查询game
FuncNameQueryGameByAddr
=
"QueryGameByAddr"
FuncNameQueryGameByAddr
=
"QueryGameByAddr"
// FuncNameQueryGameByStatus 根据status查询game
FuncNameQueryGameByStatus
=
"QueryGameByStatus"
FuncNameQueryGameByStatus
=
"QueryGameByStatus"
)
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