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 {
17
17
public BWClient (final BWEventListener eventListener ) {
18
18
Objects .requireNonNull (eventListener );
19
19
this .eventListener = eventListener ;
20
- this .timerResolutionThread = new TimerResolutionThread ();
20
+ // this.timerResolutionThread = new TimerResolutionThread();
21
21
}
22
22
23
23
/**
@@ -81,7 +81,7 @@ public void startGame(BWClientConfiguration configuration) {
81
81
82
82
// Use reduced priority to encourage Windows to give priority to StarCraft.exe/BWAPI.
83
83
// 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 );
85
85
86
86
if (client == null ) {
87
87
client = new Client (configuration );
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ void onFrame() {
82
82
botThread = createBotThread ();
83
83
botThread .setName ("JBWAPI Bot" );
84
84
// 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 );
86
86
botThread .start ();
87
87
}
88
88
Original file line number Diff line number Diff line change @@ -247,9 +247,13 @@ void update() {
247
247
while (code != 2 ) {
248
248
try {
249
249
code = pipeObjectHandle .readByte ();
250
+ /*
250
251
if (code != 2) {
251
- Thread .sleep (0 , 1 );
252
+ try {
253
+ Thread.sleep(0, 1);
254
+ } catch (InterruptedException ignored) {}
252
255
}
256
+ */
253
257
}
254
258
catch (Exception e ) {
255
259
System .err .println ("failed, disconnecting" );
You can’t perform that action at this time.
0 commit comments