|
|
@ -23,6 +23,7 @@ import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.InputStreamReader; |
|
|
|
import java.io.InputStreamReader; |
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
@ -31,7 +32,7 @@ public class PandaPrinter implements TTDReachedListener { |
|
|
|
|
|
|
|
|
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(PandaPrinter.class); |
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(PandaPrinter.class); |
|
|
|
private static final String pandaBanner = PandaPrinter.loadBanner(); |
|
|
|
private static final String pandaBanner = PandaPrinter.loadBanner(); |
|
|
|
private boolean beenDisplayed = false; |
|
|
|
private final AtomicBoolean beenDisplayed = new AtomicBoolean(); |
|
|
|
|
|
|
|
|
|
|
|
private static String loadBanner() { |
|
|
|
private static String loadBanner() { |
|
|
|
Class<PandaPrinter> c = PandaPrinter.class; |
|
|
|
Class<PandaPrinter> c = PandaPrinter.class; |
|
|
@ -51,9 +52,8 @@ public class PandaPrinter implements TTDReachedListener { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onTTDReached(final boolean reached) { |
|
|
|
public void onTTDReached(final boolean reached) { |
|
|
|
if (reached && !beenDisplayed) { |
|
|
|
if (reached && beenDisplayed.compareAndSet(false, true)) { |
|
|
|
LOG.info("\n" + pandaBanner); |
|
|
|
LOG.info("\n" + pandaBanner); |
|
|
|
this.beenDisplayed = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|