Activate replay
This commit is contained in:
@@ -886,10 +886,10 @@ gamesevent *games_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter
|
||||
{
|
||||
char fname[1024]; gamesevent *keystrokes = 0; FILE *fp; long fsize; int32_t num = 0;
|
||||
*numkeysp = 0;
|
||||
while ( 1 )
|
||||
if ( 1 )
|
||||
{
|
||||
gamesfname(fname,seed,counter);
|
||||
printf("check (%s)\n",fname);
|
||||
//printf("check (%s)\n",fname);
|
||||
if ( (fp= fopen(fname,"rb")) == 0 )
|
||||
break;
|
||||
if ( (fsize= get_filesize(fp)) <= 0 )
|
||||
@@ -939,6 +939,7 @@ int32_t games_replay(uint64_t seed,int32_t sleeptime)
|
||||
if ( seed == 0 )
|
||||
seed = 777;
|
||||
keystrokes = games_keystrokesload(&num,seed,counter);
|
||||
fprintf(stderr,"keystrokes.%p num.%d\n",keystrokes,num);
|
||||
if ( num > 0 )
|
||||
{
|
||||
sprintf(fname,"%s.%llu.player",GAMENAME,(long long)seed);
|
||||
|
||||
@@ -102,7 +102,6 @@ gamesevent games_readevent(struct games_state *rs)
|
||||
int32_t games_replay2(uint8_t *newdata,uint64_t seed,gamesevent *keystrokes,int32_t num,struct games_player *player,int32_t sleepmillis)
|
||||
{
|
||||
struct games_state *rs; FILE *fp; int32_t i,n; void *ptr;
|
||||
return(0);
|
||||
rs = (struct games_state *)calloc(1,sizeof(*rs));
|
||||
rs->seed = rs->origseed = seed;
|
||||
rs->keystrokes = keystrokes;
|
||||
|
||||
Reference in New Issue
Block a user