This commit is contained in:
jl777
2019-03-22 01:53:15 -11:00
parent e74277a934
commit 21684cfa77
2 changed files with 30 additions and 11 deletions

View File

@@ -11,20 +11,20 @@ std::string MYCCLIBNAME = (char *)"gamescc";
#define MYCCNAME "games"
#define RPC_FUNCS \
{ (char *)MYCCNAME, (char *)"rng", (char *)"hash,seed,playerid", 2, 3, '0', EVAL_GAMES }, \
{ (char *)MYCCNAME, (char *)"func1", (char *)"<no args>", 0, 0, '1', EVAL_GAMES },
{ (char *)MYCCNAME, (char *)"rng", (char *)"hash,seed,playerid", 2, 3, ' ', EVAL_GAMES }, \
{ (char *)MYCCNAME, (char *)"rngnext", (char *)"seed", 1, 1, ' ', EVAL_GAMES },
bool games_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx);
UniValue games_rng(uint64_t txfee,struct CCcontract_info *cp,cJSON *params);
UniValue games_func1(uint64_t txfee,struct CCcontract_info *cp,cJSON *params);
UniValue games_rngnext(uint64_t txfee,struct CCcontract_info *cp,cJSON *params);
#define CUSTOM_DISPATCH \
if ( cp->evalcode == EVAL_GAMES ) \
{ \
if ( strcmp(method,"rng") == 0 ) \
return(games_rng(txfee,cp,params)); \
else if ( strcmp(method,"func1") == 0 ) \
return(games_func1(txfee,cp,params)); \
else if ( strcmp(method,"rngnext") == 0 ) \
return(games_rngnext(txfee,cp,params)); \
else \
{ \
result.push_back(Pair("result","error")); \