Resultjson
This commit is contained in:
@@ -148,7 +148,7 @@ cJSON *cclib_reparse(int32_t *nump,char *jsonstr) // assumes origparams will be
|
|||||||
}
|
}
|
||||||
newstr[j] = 0;
|
newstr[j] = 0;
|
||||||
params = cJSON_Parse(newstr);
|
params = cJSON_Parse(newstr);
|
||||||
if ( 1 && params != 0 )
|
if ( 0 && params != 0 )
|
||||||
printf("new.(%s) -> %s\n",newstr,jprint(params,0));
|
printf("new.(%s) -> %s\n",newstr,jprint(params,0));
|
||||||
free(newstr);
|
free(newstr);
|
||||||
*nump = cJSON_GetArraySize(params);
|
*nump = cJSON_GetArraySize(params);
|
||||||
|
|||||||
@@ -727,7 +727,7 @@ void rogue_progress(struct rogue_state *rs,uint64_t seed,char *keystrokes,int32_
|
|||||||
|
|
||||||
int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr)
|
int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr)
|
||||||
{
|
{
|
||||||
char cmd[32768]; int32_t i,n,retval=-1; char params[1024],*filestr=0,*pname,*statusstr,*datastr,fname[128]; long allocsize; cJSON *retjson,*array,*item;
|
char cmd[32768]; int32_t i,n,retval=-1; char params[1024],*filestr=0,*pname,*statusstr,*datastr,fname[128]; long allocsize; cJSON *retjson,*array,*item,*resultjson;
|
||||||
if ( rs->guiflag == 0 )
|
if ( rs->guiflag == 0 )
|
||||||
return(-1);
|
return(-1);
|
||||||
if ( gametxidstr == 0 || *gametxidstr == 0 )
|
if ( gametxidstr == 0 || *gametxidstr == 0 )
|
||||||
@@ -747,10 +747,10 @@ int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr)
|
|||||||
}
|
}
|
||||||
if ( filestr != 0 )
|
if ( filestr != 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"gameinfo.(%s)\n",filestr);
|
if ( (retjson= cJSON_Parse(filestr)) != 0 && (resultjson= jitem(retjson,"result")) != 0 )
|
||||||
if ( (retjson= cJSON_Parse(filestr)) != 0 )
|
|
||||||
{
|
{
|
||||||
if ( (array= jarray(&n,retjson,"players")) != 0 )
|
fprintf(stderr,"gameinfo.(%s)\n",jprint(resultjson,0));
|
||||||
|
if ( (array= jarray(&n,resultjson,"players")) != 0 )
|
||||||
{
|
{
|
||||||
for (i=0; i<n; i++)
|
for (i=0; i<n; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user