From bd855221dfa67a79ac3b6c6c2545c355d5815684 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Mar 2019 06:36:47 -1100 Subject: [PATCH] Activate replay --- src/cc/dapps/dappstd.c | 5 +++-- src/cc/gamescc.cpp | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc/dapps/dappstd.c b/src/cc/dapps/dappstd.c index 18f66ca58..d8ed48b9b 100644 --- a/src/cc/dapps/dappstd.c +++ b/src/cc/dapps/dappstd.c @@ -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); diff --git a/src/cc/gamescc.cpp b/src/cc/gamescc.cpp index 1684e6a18..282b0051b 100644 --- a/src/cc/gamescc.cpp +++ b/src/cc/gamescc.cpp @@ -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;