Implemented server re-registration when a server closes / updates

- When a server is closed, it will disappear from the server list
- When a player joins a server, the number of spaces left will decrease
- Servers now disappear instead of duplicating
- Added tests for ServerDescription
- Added documentation for new classes

Tags: #story[1247]
This commit is contained in:
Michael Rausch
2017-09-01 16:05:47 +12:00
parent 0c5d661995
commit b346d5a706
10 changed files with 316 additions and 136 deletions
+8 -7
View File
@@ -7,16 +7,10 @@ import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import seng302.gameServer.ServerAdvertiser;
import seng302.model.PolarTable;
import seng302.visualiser.ServerListener;
import java.io.IOException;
@@ -87,6 +81,13 @@ public class App extends Application {
// ClientPacketParser.appClose();
// ClientPacketParser.appClose();
try {
ServerAdvertiser.getInstance().unregister();
} catch (IOException e1) {
logger.warn("Could not un-register game");
}
System.exit(0);
});