@@ -52,13 +52,14 @@ class BotWrapper {
5252 /**
5353 * Resets the BotWrapper for a new game.
5454 */
55- void startNewGame (ByteBuffer dataSource , PerformanceMetrics performanceMetrics ) {
55+ void startNewGame (ByteBuffer liveData , PerformanceMetrics performanceMetrics ) {
5656 if (configuration .async ) {
57- frameBuffer .initialize (dataSource , performanceMetrics );
57+ frameBuffer .initialize (liveData , performanceMetrics );
5858 }
5959 this .performanceMetrics = performanceMetrics ;
60- game = new Game (liveClientData );
61- liveClientData .setBuffer (dataSource );
60+ game = new Game ();
61+ game .clientData ().setBuffer (liveData );
62+ liveClientData .setBuffer (liveData );
6263 botThread = null ;
6364 gameOver = false ;
6465 }
@@ -90,8 +91,8 @@ void onFrame() {
9091 If buffer is full, it will wait until it has capacity
9192 Wait for empty buffer OR termination condition
9293 */
93- configuration . log ( "Main: Enqueuing frame" );
94- boolean isFrameZero = liveClientData . gameData (). getFrameCount () == 0 ;
94+ int frame = liveClientData . gameData (). getFrameCount ( );
95+ configuration . log ( "Main: Enqueuing frame #" + frame ) ;
9596 frameBuffer .enqueueFrame ();
9697 performanceMetrics .bwapiResponse .startTiming ();
9798 frameBuffer .lockSize .lock ();
@@ -106,8 +107,8 @@ void onFrame() {
106107 throw new RuntimeException (lastThrow );
107108 }
108109
109- if (configuration .unlimitedFrameZero && isFrameZero ) {
110- configuration .log ("Main: Waiting indefinitely on frame 0" );
110+ if (configuration .unlimitedFrameZero && frame == 0 ) {
111+ configuration .log ("Main: Waiting indefinitely on frame " + frame );
111112 frameBuffer .conditionSize .await ();
112113 } else {
113114 long remainingNanos = endNanos - System .nanoTime ();
0 commit comments