Commit c40dba14 authored by pengjun's avatar pengjun

pokerbull由统一接口创建交易

parent b4efbed2
......@@ -56,19 +56,15 @@ func pokerbullStart(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
value, _ := cmd.Flags().GetUint64("value")
playerCount, _ := cmd.Flags().GetUint32("playerCount")
fee, _ := cmd.Flags().GetFloat64("fee")
feeInt64 := int64(fee * 1e4)
amountInt64 := int64(value)
params := &pkt.PBStartTxReq{
Value: amountInt64 * types.Coin,
PlayerNum: int32(playerCount),
Fee: feeInt64,
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pkt.PokerBullX),
ActionName: pkt.CreateStartTx,
Payload: []byte(fmt.Sprintf("{\"value\":%d,\"playerNum\":%d}", int64(value) * types.Coin, int32(playerCount))),
}
var res string
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "pokerbull.PokerBullStartTx", params, &res)
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "Chain33.CreateTransaction", params, &res)
ctx.RunWithoutMarshal()
}
......@@ -91,17 +87,15 @@ func addPokerbullContinueFlags(cmd *cobra.Command) {
func pokerbullContinue(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
gameID, _ := cmd.Flags().GetString("gameID")
fee, _ := cmd.Flags().GetFloat64("fee")
feeInt64 := int64(fee * 1e4)
params := &pkt.PBContinueTxReq{
GameId: gameID,
Fee: feeInt64,
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pkt.PokerBullX),
ActionName: pkt.CreateContinueTx,
Payload: []byte(fmt.Sprintf("{\"gameId\":\"%s\"}", gameID)),
}
var res string
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "pokerbull.PokerBullContinueTx", params, &res)
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "Chain33.CreateTransaction", params, &res)
ctx.RunWithoutMarshal()
}
......@@ -124,17 +118,15 @@ func addPokerbullQuitFlags(cmd *cobra.Command) {
func pokerbullQuit(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
gameID, _ := cmd.Flags().GetString("gameID")
fee, _ := cmd.Flags().GetFloat64("fee")
feeInt64 := int64(fee * 1e4)
params := &pkt.PBContinueTxReq{
GameId: gameID,
Fee: feeInt64,
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pkt.PokerBullX),
ActionName: pkt.CreatequitTx,
Payload: []byte(fmt.Sprintf("{\"gameId\":\"%s\"}", gameID)),
}
var res string
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "pokerbull.PokerBullQuitTx", params, &res)
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "Chain33.CreateTransaction", params, &res)
ctx.RunWithoutMarshal()
}
......
......@@ -8,7 +8,6 @@ import (
"github.com/33cn/chain33/pluginmgr"
"github.com/33cn/plugin/plugin/dapp/pokerbull/commands"
"github.com/33cn/plugin/plugin/dapp/pokerbull/executor"
"github.com/33cn/plugin/plugin/dapp/pokerbull/rpc"
"github.com/33cn/plugin/plugin/dapp/pokerbull/types"
)
......@@ -18,6 +17,5 @@ func init() {
ExecName: executor.GetName(),
Exec: executor.Init,
Cmd: commands.PokerBullCmd,
RPC: rpc.Init,
})
}
syntax = "proto3";
import "transaction.proto";
package types;
//斗牛游戏内容
......@@ -187,12 +185,3 @@ message PBQueryReq {
int64 fee = 2;
}
// pokerbull 对外提供服务的接口
service pokerbull {
//游戏开始
rpc Start(PBGameStart) returns (UnsignTx) {}
//游戏继续
rpc Continue(PBGameContinue) returns (UnsignTx) {}
//游戏结束
rpc Quit(PBGameQuit) returns (UnsignTx) {}
}
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package rpc
import (
"context"
"encoding/hex"
"github.com/33cn/chain33/types"
pb "github.com/33cn/plugin/plugin/dapp/pokerbull/types"
)
// PokerBullStartTx 创建游戏开始交易
func (c *Jrpc) PokerBullStartTx(parm *pb.PBStartTxReq, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
head := &pb.PBGameStart{
Value: parm.Value,
PlayerNum: parm.PlayerNum,
}
reply, err := c.cli.Start(context.Background(), head)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
// PokerBullContinueTx 创建游戏继续交易
func (c *Jrpc) PokerBullContinueTx(parm *pb.PBContinueTxReq, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
head := &pb.PBGameContinue{
GameId: parm.GameId,
}
reply, err := c.cli.Continue(context.Background(), head)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
// PokerBullQuitTx 创建游戏推出交易
func (c *Jrpc) PokerBullQuitTx(parm *pb.PBQuitTxReq, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
head := &pb.PBGameQuit{
GameId: parm.GameId,
}
reply, err := c.cli.Quit(context.Background(), head)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
// PokerBullQueryTx 创建游戏查询交易
func (c *Jrpc) PokerBullQueryTx(parm *pb.PBQueryReq, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
head := &pb.PBGameQuery{
GameId: parm.GameId,
}
reply, err := c.cli.Show(context.Background(), head)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
......@@ -43,6 +43,9 @@ func TestJRPCChannel(t *testing.T) {
{fn: testQuitRawTxCmd},
{fn: testQueryGameByID},
{fn: testQueryGameByAddr},
{fn: testQueryGameByIDs},
{fn: testQueryGameByStatus},
{fn: testQueryGameByRound},
}
for index, testCase := range testCases {
err := testCase.fn(t, jrpcClient)
......@@ -57,29 +60,42 @@ func TestJRPCChannel(t *testing.T) {
}
func testStartRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := pty.PBStartTxReq{}
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pty.PokerBullX),
ActionName: pty.CreateStartTx,
Payload: []byte(""),
}
var res string
return jrpc.Call("pokerbull.PokerBullStartTx", params, &res)
return jrpc.Call("Chain33.CreateTransaction", params, &res)
}
func testContinueRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := pty.PBContinueTxReq{}
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pty.PokerBullX),
ActionName: pty.CreateContinueTx,
Payload: []byte(""),
}
var res string
return jrpc.Call("pokerbull.PokerBullContinueTx", params, &res)
return jrpc.Call("Chain33.CreateTransaction", params, &res)
}
func testQuitRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := pty.PBContinueTxReq{}
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pty.PokerBullX),
ActionName: pty.CreatequitTx,
Payload: []byte(""),
}
var res string
return jrpc.Call("pokerbull.PokerBullQuitTx", params, &res)
return jrpc.Call("Chain33.CreateTransaction", params, &res)
}
func testQueryGameByID(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &pty.QueryPBGameInfo{}
params.Execer = "pokerbull"
params.FuncName = "QueryGameByID"
params.Execer = pty.PokerBullX
params.FuncName = pty.FuncNameQueryGameByID
params.Payload = types.MustPBToJSON(req)
rep = &pty.ReplyPBGame{}
return jrpc.Call("Chain33.Query", params, rep)
......@@ -89,9 +105,43 @@ func testQueryGameByAddr(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &pty.QueryPBGameInfo{}
params.Execer = "pokerbull"
params.FuncName = "QueryGameByAddr"
params.Execer = pty.PokerBullX
params.FuncName = pty.FuncNameQueryGameByAddr
params.Payload = types.MustPBToJSON(req)
rep = &pty.PBGameRecords{}
return jrpc.Call("Chain33.Query", params, rep)
}
func testQueryGameByIDs(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &pty.QueryPBGameInfos{}
params.Execer = pty.PokerBullX
params.FuncName = pty.FuncNameQueryGameListByIDs
params.Payload = types.MustPBToJSON(req)
rep = &pty.ReplyPBGameList{}
return jrpc.Call("Chain33.Query", params, rep)
}
func testQueryGameByStatus(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &pty.QueryPBGameInfo{}
params.Execer = pty.PokerBullX
params.FuncName = pty.FuncNameQueryGameByStatus
params.Payload = types.MustPBToJSON(req)
rep = &pty.PBGameRecords{}
return jrpc.Call("Chain33.Query", params, rep)
}
func testQueryGameByRound(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &pty.QueryPBGameByRound{}
params.Execer = pty.PokerBullX
params.FuncName = pty.FuncNameQueryGameByRound
params.Payload = types.MustPBToJSON(req)
rep = &pty.PBGameRecords{}
return jrpc.Call("Chain33.Query", params, rep)
}
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package rpc
import (
"context"
"github.com/33cn/chain33/types"
pb "github.com/33cn/plugin/plugin/dapp/pokerbull/types"
"github.com/pkg/errors"
)
func (c *channelClient) Start(ctx context.Context, head *pb.PBGameStart) (*types.UnsignTx, error) {
if head.PlayerNum > pb.MaxPlayerNum {
return nil, errors.New("Player number should be maximum 5")
}
val := &pb.PBGameAction{
Ty: pb.PBGameActionStart,
Value: &pb.PBGameAction_Start{Start: head},
}
tx, err := types.CreateFormatTx(types.ExecName(pb.PokerBullX), types.Encode(val))
if err != nil {
return nil, err
}
data := types.Encode(tx)
return &types.UnsignTx{Data: data}, nil
}
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},
}
tx, err := types.CreateFormatTx(types.ExecName(pb.PokerBullX), types.Encode(val))
if err != nil {
return nil, err
}
data := types.Encode(tx)
return &types.UnsignTx{Data: data}, nil
}
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},
}
tx, err := types.CreateFormatTx(types.ExecName(pb.PokerBullX), types.Encode(val))
if err != nil {
return nil, err
}
data := types.Encode(tx)
return &types.UnsignTx{Data: data}, nil
}
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},
}
tx, err := types.CreateFormatTx(types.ExecName(pb.PokerBullX), types.Encode(val))
if err != nil {
return nil, err
}
data := types.Encode(tx)
return &types.UnsignTx{Data: data}, nil
}
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package rpc
import (
"github.com/33cn/chain33/rpc/types"
)
// Jrpc jrpc句柄
type Jrpc struct {
cli *channelClient
}
// Grpc grpc句柄
type Grpc struct {
*channelClient
}
type channelClient struct {
types.ChannelClient
}
// Init 初始化rpc
func Init(name string, s types.RPCServer) {
cli := &channelClient{}
grpc := &Grpc{channelClient: cli}
cli.Init(name, s, &Jrpc{cli: cli}, grpc)
}
......@@ -4,13 +4,9 @@
package types
import (
context "context"
fmt "fmt"
math "math"
types "github.com/33cn/chain33/types"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
......@@ -1737,217 +1733,69 @@ func init() {
func init() { proto.RegisterFile("pokerbull.proto", fileDescriptor_8d22e4ee2313e311) }
var fileDescriptor_8d22e4ee2313e311 = []byte{
// 1081 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4b, 0x6f, 0xdb, 0x46,
0x10, 0x36, 0x25, 0x51, 0x8f, 0x61, 0x6c, 0xd9, 0xdb, 0xd6, 0x58, 0x18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 0x56, 0xb9, 0x6e, 0xc0, 0xc6, 0x75, 0xc3,
0xb3, 0x1b, 0x02, 0x21, 0xe8, 0x82, 0x36, 0x42, 0x21, 0x6f, 0x3e, 0x06, 0xb0, 0xd9, 0x2e, 0xb4,
0xdf, 0x4a, 0xb3, 0x7e, 0xaa, 0x4f, 0xff, 0x07, 0x18, 0xce, 0xa6, 0x06, 0xbe, 0xc9, 0xf0, 0xa6,
0x02, 0xe8, 0xc3, 0xad, 0xea, 0xf0, 0xf7, 0x0a, 0xaf, 0xcf, 0x71, 0x07, 0x7b, 0xdc, 0xc1, 0xef,
0xd4, 0x38, 0xc0, 0x27, 0xf2, 0xa8, 0x73, 0x93, 0x3f, 0x1c, 0x18, 0x94, 0x0b, 0x3b, 0x3b, 0x02,
0x97, 0x66, 0xd7, 0x9a, 0x51, 0x7c, 0x60, 0x5a, 0xf1, 0xd7, 0x24, 0x8b, 0xae, 0x92, 0xcb, 0x3b,
0x7f, 0x8b, 0x7d, 0x0b, 0xfd, 0x72, 0x50, 0xad, 0x1f, 0xc7, 0xeb, 0x4e, 0xbd, 0x80, 0x0e, 0x0e,
0xad, 0xfb, 0xf3, 0x78, 0x8d, 0xf6, 0x9b, 0x2e, 0xfe, 0x2b, 0x1c, 0xff, 0x1b, 0x00, 0x00, 0xff,
0xff, 0x4f, 0x37, 0xe9, 0x8e, 0x58, 0x0c, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// PokerbullClient is the client API for Pokerbull service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type PokerbullClient interface {
//游戏开始
Start(ctx context.Context, in *PBGameStart, opts ...grpc.CallOption) (*types.UnsignTx, error)
//游戏继续
Continue(ctx context.Context, in *PBGameContinue, opts ...grpc.CallOption) (*types.UnsignTx, error)
//游戏结束
Quit(ctx context.Context, in *PBGameQuit, opts ...grpc.CallOption) (*types.UnsignTx, error)
}
type pokerbullClient struct {
cc *grpc.ClientConn
}
func NewPokerbullClient(cc *grpc.ClientConn) PokerbullClient {
return &pokerbullClient{cc}
}
func (c *pokerbullClient) Start(ctx context.Context, in *PBGameStart, opts ...grpc.CallOption) (*types.UnsignTx, error) {
out := new(types.UnsignTx)
err := c.cc.Invoke(ctx, "/types.pokerbull/Start", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *pokerbullClient) Continue(ctx context.Context, in *PBGameContinue, opts ...grpc.CallOption) (*types.UnsignTx, error) {
out := new(types.UnsignTx)
err := c.cc.Invoke(ctx, "/types.pokerbull/Continue", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *pokerbullClient) Quit(ctx context.Context, in *PBGameQuit, opts ...grpc.CallOption) (*types.UnsignTx, error) {
out := new(types.UnsignTx)
err := c.cc.Invoke(ctx, "/types.pokerbull/Quit", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// PokerbullServer is the server API for Pokerbull service.
type PokerbullServer interface {
//游戏开始
Start(context.Context, *PBGameStart) (*types.UnsignTx, error)
//游戏继续
Continue(context.Context, *PBGameContinue) (*types.UnsignTx, error)
//游戏结束
Quit(context.Context, *PBGameQuit) (*types.UnsignTx, error)
}
func RegisterPokerbullServer(s *grpc.Server, srv PokerbullServer) {
s.RegisterService(&_Pokerbull_serviceDesc, srv)
}
func _Pokerbull_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PBGameStart)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PokerbullServer).Start(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.pokerbull/Start",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PokerbullServer).Start(ctx, req.(*PBGameStart))
}
return interceptor(ctx, in, info, handler)
}
func _Pokerbull_Continue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PBGameContinue)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PokerbullServer).Continue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.pokerbull/Continue",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PokerbullServer).Continue(ctx, req.(*PBGameContinue))
}
return interceptor(ctx, in, info, handler)
}
func _Pokerbull_Quit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PBGameQuit)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PokerbullServer).Quit(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.pokerbull/Quit",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PokerbullServer).Quit(ctx, req.(*PBGameQuit))
}
return interceptor(ctx, in, info, handler)
}
var _Pokerbull_serviceDesc = grpc.ServiceDesc{
ServiceName: "types.pokerbull",
HandlerType: (*PokerbullServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Start",
Handler: _Pokerbull_Start_Handler,
},
{
MethodName: "Continue",
Handler: _Pokerbull_Continue_Handler,
},
{
MethodName: "Quit",
Handler: _Pokerbull_Quit_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "pokerbull.proto",
// 1021 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4b, 0x6f, 0x23, 0x45,
0x10, 0xde, 0xb1, 0x3d, 0x7e, 0xd4, 0x6c, 0xec, 0xa4, 0x81, 0xa8, 0x85, 0x10, 0xb2, 0x66, 0xc3,
0xae, 0x41, 0x90, 0x83, 0x23, 0x81, 0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,
0x5f, 0x18, 0xb9, 0x72, 0x93, 0x8e, 0xbf, 0x16, 0xd7, 0xbc, 0x8f, 0x11, 0x54, 0x0c, 0x65, 0x28,
0x95, 0x59, 0x11, 0xe7, 0x19, 0x1f, 0x34, 0x0c, 0x09, 0xe4, 0x0b, 0x23, 0x57, 0xfe, 0x46, 0x49,
0x28, 0xef, 0x38, 0x90, 0xbf, 0x48, 0xa0, 0xf9, 0x54, 0xde, 0x9e, 0xa3, 0xc4, 0xa3, 0x2c, 0x94,
0x0c, 0xf6, 0x39, 0xf4, 0x6f, 0x8a, 0x88, 0x52, 0xf4, 0x14, 0x85, 0x25, 0xcd, 0xbe, 0x04, 0xc0,
0x33, 0x25, 0xe8, 0x00, 0x13, 0x64, 0x71, 0x94, 0x3c, 0x94, 0x41, 0x2c, 0xd3, 0x59, 0x18, 0xa6,
0x7c, 0x48, 0xf2, 0x8a, 0xa3, 0x5e, 0x8e, 0xb2, 0x37, 0x41, 0x94, 0x47, 0xc9, 0x15, 0x1f, 0x8d,
0x9d, 0x49, 0x5f, 0x54, 0x0c, 0xed, 0xd7, 0x25, 0x15, 0xee, 0x50, 0x87, 0x6d, 0x18, 0x2a, 0x96,
0x74, 0x5d, 0x24, 0x21, 0x3f, 0x42, 0x09, 0x11, 0xfe, 0x6f, 0x0e, 0x74, 0x97, 0xf3, 0x45, 0x90,
0x84, 0x4a, 0x61, 0x15, 0xa4, 0x61, 0xc6, 0x9d, 0x71, 0x5b, 0x29, 0x20, 0xa1, 0x5a, 0x81, 0xb2,
0x61, 0x5a, 0x81, 0x28, 0xc6, 0xa1, 0x17, 0x84, 0x61, 0x2a, 0xb3, 0x0c, 0x1b, 0x61, 0x20, 0x0c,
0x89, 0x49, 0xcb, 0xde, 0x44, 0x09, 0x36, 0x40, 0x5f, 0x10, 0xa1, 0xd2, 0x12, 0xcb, 0x5b, 0x99,
0x06, 0x57, 0x54, 0x7d, 0x57, 0x94, 0xb4, 0xff, 0x11, 0xfa, 0xa6, 0x88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f, 0x49, 0xb3, 0x7e, 0xaa, 0xa3, 0xff, 0x23, 0x8c, 0x96, 0x73, 0x03, 0xdf,
0x64, 0x78, 0x5f, 0x01, 0xf4, 0xe5, 0x56, 0x75, 0xf9, 0x07, 0x85, 0xd7, 0x17, 0xb8, 0x83, 0x3d,
0xee, 0xe2, 0xf7, 0x6a, 0x1c, 0xe0, 0x17, 0x79, 0xd4, 0xbd, 0xb7, 0x5d, 0x5c, 0xc8, 0xcf, 0xfe,
0x09, 0x00, 0x00, 0xff, 0xff, 0xda, 0x14, 0x34, 0x44, 0xa3, 0x0b, 0x00, 0x00,
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment