Commit cdb3a89b authored by Theodore Lopez's avatar Theodore Lopez
parents 63ece288 37d383eb
...@@ -109,21 +109,24 @@ public class LocalGameLoop extends Thread{ ...@@ -109,21 +109,24 @@ public class LocalGameLoop extends Thread{
/** /**
* a separate thread which will verify periodically whether the network connection is still alive * a separate thread which will verify periodically whether the network connection is still alive
* wakes up every 2 seconds, thus it is not a performance issue * wakes up every 2 seconds, thus it is not a performance issue
* it would have been nice to not have this running when we are in Single Player
*/ */
private Runnable BrokenConnectionVerifier=new Runnable() { private Runnable BrokenConnectionVerifier=new Runnable() {
@Override @Override
public void run() { public void run() {
while (true) { while (true) {
if (LocalGameLoop.getInstance().isPlaying) {
//System.out.println("Broken Connection verifier!");
if (getNetworkConnection().isBroken())
GameStarter.initiateBrokenConnectionMeasures();
}
try { try {
sleep(2000); sleep(2000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (LocalGameLoop.getInstance().isPlaying) {
//System.out.println("Broken Connection verifier!");
if (getNetworkConnection().isBroken())
GameStarter.initiateBrokenConnectionMeasures();
}
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment