Use name in game
This commit is contained in:
@@ -170,10 +170,10 @@ int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr)
|
|||||||
if ( strcmp(statusstr,"registered") == 0 )
|
if ( strcmp(statusstr,"registered") == 0 )
|
||||||
{
|
{
|
||||||
retval = 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 ( (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);
|
decode_hex((uint8_t *)&rs->P,(int32_t)strlen(datastr)/2,datastr);
|
||||||
//fprintf(stderr,"set datastr[%d]\n",(int32_t)strlen(datastr));
|
//fprintf(stderr,"set datastr[%d]\n",(int32_t)strlen(datastr));
|
||||||
rs->restoring = 1;
|
rs->restoring = 1;
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ int32_t rogue_playerdata(struct CCcontract_info *cp,uint256 &origplayergame,uint
|
|||||||
return(0);
|
return(0);
|
||||||
} else fprintf(stderr,"hash mismatch or illegal gametxid\n");
|
} else fprintf(stderr,"hash mismatch or illegal gametxid\n");
|
||||||
} else fprintf(stderr,"invalid game %s\n",gametxid.GetHex().c_str());
|
} 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());
|
} else fprintf(stderr,"couldnt get playertxid.%s\n",playertxid.GetHex().c_str());
|
||||||
return(-1);
|
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);
|
opret = rogue_highlanderopret(funcid, gametxid, regslot, mypk, nodata,pname);
|
||||||
rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,opret);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user