File tree Expand file tree Collapse file tree 4 files changed +83
-88
lines changed
Expand file tree Collapse file tree 4 files changed +83
-88
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public class BWClient {
1717 public BWClient (final BWEventListener eventListener ) {
1818 Objects .requireNonNull (eventListener );
1919 this .eventListener = eventListener ;
20- this .timerResolutionThread = new TimerResolutionThread ();
20+ // this.timerResolutionThread = new TimerResolutionThread();
2121 }
2222
2323 /**
@@ -81,7 +81,7 @@ public void startGame(BWClientConfiguration configuration) {
8181
8282 // Use reduced priority to encourage Windows to give priority to StarCraft.exe/BWAPI.
8383 // If BWAPI doesn't get priority, it may not detect completion of a frame on our end in timely fashion.
84- Thread .currentThread ().setPriority (Thread . NORM_PRIORITY );
84+ Thread .currentThread ().setPriority (4 );
8585
8686 if (client == null ) {
8787 client = new Client (configuration );
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ void onFrame() {
8282 botThread = createBotThread ();
8383 botThread .setName ("JBWAPI Bot" );
8484 // Reduced priority helps ensure that StarCraft.exe/BWAPI pick up on our frame completion in timely fashion
85- botThread .setPriority (Thread . MIN_PRIORITY );
85+ botThread .setPriority (3 );
8686 botThread .start ();
8787 }
8888
Original file line number Diff line number Diff line change @@ -247,9 +247,13 @@ void update() {
247247 while (code != 2 ) {
248248 try {
249249 code = pipeObjectHandle .readByte ();
250+ /*
250251 if (code != 2) {
251- Thread .sleep (0 , 1 );
252+ try {
253+ Thread.sleep(0, 1);
254+ } catch (InterruptedException ignored) {}
252255 }
256+ */
253257 }
254258 catch (Exception e ) {
255259 System .err .println ("failed, disconnecting" );
You can’t perform that action at this time.
0 commit comments