added missing javadocs in the NetworkDialog.java

This commit is contained in:
Hanno Fleischer hanno.fleischer@unibw.de
2024-10-04 17:30:21 +02:00
parent 05271beded
commit 961242bb20

View File

@@ -92,6 +92,9 @@ private void connectServer() {
}
}
/**
* This method will start a server or just connect to one based on the boolean hostServer
*/
private void connect() {
if(hostServer){
startServer();
@@ -106,13 +109,16 @@ private void connect() {
}
}
/**
* This method starts a server in a new thread
*/
private void startServer() {
new Thread(() -> {
try{
BattleshipServer battleshipServer = new BattleshipServer();
battleshipServer.run();
} catch (Exception e) {
LOGGER.log(Level.ERROR,e);
LOGGER.log(Level.ERROR, e.getMessage(), e);
}
}).start();
}