Use name in game

This commit is contained in:
jl777
2019-02-12 19:11:09 -11:00
parent 13a3898082
commit a12fe67278
2 changed files with 4 additions and 4 deletions

View File

@@ -170,10 +170,10 @@ int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr)
if ( strcmp(statusstr,"registered") == 0 )
{
retval = 0;
if ( (pname= jstr(item,"pname")) != 0 && strlen(pname) < MAXSTR-1 )
strcpy(whoami,pname);
if ( (item= jobj(item,"player")) != 0 && (datastr= jstr(item,"data")) != 0 )
{
if ( (pname= jstr(item,"pname")) != 0 && strlen(pname) < MAXSTR-1 )
strcpy(whoami,pname);
decode_hex((uint8_t *)&rs->P,(int32_t)strlen(datastr)/2,datastr);
//fprintf(stderr,"set datastr[%d]\n",(int32_t)strlen(datastr));
rs->restoring = 1;

View File

@@ -462,7 +462,7 @@ int32_t rogue_playerdata(struct CCcontract_info *cp,uint256 &origplayergame,uint
return(0);
} else fprintf(stderr,"hash mismatch or illegal gametxid\n");
} else fprintf(stderr,"invalid game %s\n",gametxid.GetHex().c_str());
} else fprintf(stderr,"invalid player funcid.%c\n",f);
} //else fprintf(stderr,"invalid player funcid.%c\n",f);
} else fprintf(stderr,"couldnt get playertxid.%s\n",playertxid.GetHex().c_str());
return(-1);
}
@@ -933,7 +933,7 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param
{
opret = rogue_highlanderopret(funcid, gametxid, regslot, mypk, nodata,pname);
rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,opret);
fprintf(stderr,"nodata finalizetx.(%s)\n",rawtx.c_str());
//fprintf(stderr,"nodata finalizetx.(%s)\n",rawtx.c_str());
}
else
{