Skip to content

Commit 5b36174

Browse files
committed
Reduced stdout spamming
1 parent 30e7a52 commit 5b36174

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/main/java/bwapi/BWClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public void startGame(BWClientConfiguration configuration) {
5252
client.reconnect();
5353

5454
do {
55-
System.out.println("Client: Beginning game loop");
55+
//System.out.println("Client: Beginning game loop");
5656
ClientData.GameData liveGameData = client.clientData().gameData();
5757
while (!liveGameData.isInGame()) {
5858
if (client.isConnected()) {
59-
System.out.println("Client: Not in game; Connected.");
59+
//System.out.println("Client: Not in game; Connected.");
6060
} else {
61-
System.out.println("Client: Not in game; Not connected.");
61+
//System.out.println("Client: Not in game; Not connected.");
6262
return;
6363
}
6464
client.update();
@@ -67,13 +67,13 @@ public void startGame(BWClientConfiguration configuration) {
6767
}
6868
}
6969
while (liveGameData.isInGame()) {
70-
System.out.println("Client: In game on frame " + liveGameData.getFrameCount());
70+
//System.out.println("Client: In game on frame " + liveGameData.getFrameCount());
7171
botWrapper.onFrame();
72-
System.out.println("Client: Sending commands for frame " + liveGameData.getFrameCount());
72+
//System.out.println("Client: Sending commands for frame " + liveGameData.getFrameCount());
7373
getGame().sideEffects.flushTo(liveGameData);
7474
client.update();
7575
if (!client.isConnected()) {
76-
System.out.println("Reconnecting...");
76+
//System.out.println("Reconnecting...");
7777
client.reconnect();
7878
}
7979
}

src/main/java/bwapi/BotWrapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void onFrame() {
7272
long startNanos = System.nanoTime();
7373
long endNanos = startNanos + configuration.asyncFrameDurationNanos;
7474
if (botThread == null) {
75-
System.out.println("Creating bot thread");
75+
//System.out.println("Creating bot thread");
7676
botThread = createBotThread();
7777
botThread.setName("JBWAPI Bot");
7878
botThread.start();
@@ -116,12 +116,12 @@ private Thread createBotThread() {
116116
try { while (frameBuffer.empty()) frameBuffer.conditionSize.awaitUninterruptibly(); } finally { frameBuffer.lockSize.unlock(); }
117117

118118
game.clientData().setBuffer(frameBuffer.peek());
119-
System.out.println("Bot thread: Handling events.");
119+
//System.out.println("Bot thread: Handling events.");
120120
handleEvents();
121-
System.out.println("Bot thread: Handled events.");
121+
//System.out.println("Bot thread: Handled events.");
122122
frameBuffer.dequeue();
123123
}
124-
System.out.println("Bot thread: Ending because game is over.");
124+
//System.out.println("Bot thread: Ending because game is over.");
125125
});
126126
}
127127

src/main/java/bwapi/FrameBuffer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ void enqueueFrame() {
120120
lockSize.lock();
121121
try {
122122
++stepGame;
123-
System.out.println("FrameBuffer: Enqueued buffer " + indexGame() + " on game step #" + stepGame);
123+
//System.out.println("FrameBuffer: Enqueued buffer " + indexGame() + " on game step #" + stepGame);
124124
if (framesBuffered() > 0) {
125-
System.out.println("FrameBuffer: There are now " + framesBuffered() + " frames buffered.");
125+
//System.out.println("FrameBuffer: There are now " + framesBuffered() + " frames buffered.");
126126
}
127127
conditionSize.signalAll();
128128
} finally { lockSize.unlock(); }
@@ -136,7 +136,7 @@ ByteBuffer peek() {
136136
lockSize.lock();
137137
try {
138138
while(empty()) conditionSize.awaitUninterruptibly();
139-
System.out.println("FrameBuffer: Sharing buffer " + indexBot() + " on bot step #" + stepBot);
139+
//System.out.println("FrameBuffer: Sharing buffer " + indexBot() + " on bot step #" + stepBot);
140140
return dataBuffer.get(indexBot());
141141
} finally { lockSize.unlock(); }
142142

@@ -149,7 +149,7 @@ void dequeue() {
149149
lockSize.lock();
150150
try {
151151
while(empty()) conditionSize.awaitUninterruptibly();
152-
System.out.println("FrameBuffer: Dequeuing buffer " + indexBot() + " on bot step #" + stepBot);
152+
//System.out.println("FrameBuffer: Dequeuing buffer " + indexBot() + " on bot step #" + stepBot);
153153
++stepBot;
154154
conditionSize.signalAll();
155155
} finally { lockSize.unlock(); }

0 commit comments

Comments
 (0)