This commit is contained in:
28
app/src/main/java/network/server/ServerLogicThread.java
Normal file
28
app/src/main/java/network/server/ServerLogicThread.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package network.server;
|
||||
|
||||
public class ServerLogicThread extends Thread {
|
||||
|
||||
private final Server server;
|
||||
|
||||
public ServerLogicThread(Server server) {
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
interrupt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (!interrupted()) {
|
||||
server.update();
|
||||
try {
|
||||
Thread.sleep(50);
|
||||
} catch (InterruptedException e) {
|
||||
// e.printStackTrace();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user