Sleeptime var
This commit is contained in:
@@ -73,7 +73,7 @@ CClib_methods[] =
|
||||
std::string CClib_rawtxgen(struct CCcontract_info *cp,uint8_t funcid,cJSON *params);
|
||||
|
||||
#ifdef BUILD_ROGUE
|
||||
int32_t rogue_replay(uint64_t seed);
|
||||
int32_t rogue_replay(uint64_t seed,int32_t sleeptime);
|
||||
|
||||
bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx)
|
||||
{
|
||||
@@ -102,7 +102,7 @@ UniValue CClib_method(struct CCcontract_info *cp,char *method,cJSON *params)
|
||||
#ifdef BUILD_ROGUE
|
||||
if ( cp->evalcode == EVAL_ROGUE )
|
||||
{
|
||||
rogue_replay(777);
|
||||
rogue_replay(777,0);
|
||||
if ( strcmp(method,"newgame") == 0 )
|
||||
return(rogue_newgame(txfee,cp,params));
|
||||
else if ( strcmp(method,"pending") == 0 )
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int32_t rogue_replay(uint64_t seed);
|
||||
int32_t rogue_replay(uint64_t seed,int32_t sleeptime);
|
||||
int rogue(int argc, char **argv, char **envp);
|
||||
|
||||
int main(int argc, char **argv, char **envp)
|
||||
@@ -36,7 +36,7 @@ int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
seed = atol(argv[1]);
|
||||
fprintf(stderr,"replay %llu\n",(long long)seed);
|
||||
return(rogue_replay(seed));
|
||||
return(rogue_replay(seed,50000));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ long get_filesize(FILE *fp)
|
||||
return(fsize);
|
||||
}
|
||||
|
||||
int32_t rogue_replay(uint64_t seed)
|
||||
int32_t rogue_replay(uint64_t seed,int32_t sleeptime)
|
||||
{
|
||||
FILE *fp; char fname[1024]; char *keystrokes = 0; long num=0,fsize; int32_t i,counter = 0; struct rogue_state *rs;
|
||||
if ( seed == 0 )
|
||||
@@ -145,6 +145,7 @@ int32_t rogue_replay(uint64_t seed)
|
||||
rs->seed = seed;
|
||||
rs->keystrokes = keystrokes;
|
||||
rs->numkeys = num;
|
||||
rs->sleeptime = sleeptime;
|
||||
rogueiterate(rs);
|
||||
if ( (fp= fopen("checkfile","wb")) != 0 )
|
||||
{
|
||||
@@ -403,7 +404,8 @@ playit(struct rogue_state *rs)
|
||||
//fprintf(stderr,"replaydone\n"); sleep(3);
|
||||
return;
|
||||
}
|
||||
usleep(50000);
|
||||
if ( rs->sleeptime != 0 )
|
||||
usleep(rs->sleeptime);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -318,7 +318,7 @@ struct rogue_state
|
||||
uint64_t seed;
|
||||
char *keystrokes;
|
||||
uint32_t needflush,replaydone;
|
||||
int32_t numkeys,ind,num,guiflag,counter;
|
||||
int32_t numkeys,ind,num,guiflag,counter,sleeptime;
|
||||
char buffered[512];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user