merge dev into test #28
@@ -68,9 +68,7 @@ public void run() {
|
|||||||
private void startServer() {
|
private void startServer() {
|
||||||
try {
|
try {
|
||||||
LOGGER.log(Level.INFO, "Starting server..."); //NON-NLS
|
LOGGER.log(Level.INFO, "Starting server..."); //NON-NLS
|
||||||
InetAddress localhost;
|
|
||||||
localhost = InetAddress.getLocalHost();
|
|
||||||
String ip = localhost.getHostAddress();
|
|
||||||
myServer = Network.createServer(port);
|
myServer = Network.createServer(port);
|
||||||
initializeSerializables();
|
initializeSerializables();
|
||||||
myServer.start();
|
myServer.start();
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ private void tryHost() {
|
|||||||
private void tryJoin() {
|
private void tryJoin() {
|
||||||
int port = 0;
|
int port = 0;
|
||||||
String ip = joinDialog.getIpt();
|
String ip = joinDialog.getIpt();
|
||||||
String portText = hostDialog.getPort();
|
String portText = joinDialog.getPort();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Validate the port
|
// Validate the port
|
||||||
@@ -134,9 +134,10 @@ private void tryJoin() {
|
|||||||
if (port < 1 || port > 65535) {
|
if (port < 1 || port > 65535) {
|
||||||
throw new IllegalArgumentException("Invalid port");
|
throw new IllegalArgumentException("Invalid port");
|
||||||
}
|
}
|
||||||
|
joinDialog.setPortNumber(port);
|
||||||
// Validate the IP address
|
// Validate the IP address
|
||||||
if (isValidIpAddress(ip)) {
|
if (isValidIpAddress(ip)) {
|
||||||
|
joinDialog.setHostname(ip);
|
||||||
app.getModelSynchronize().setName(startDialog.getName());
|
app.getModelSynchronize().setName(startDialog.getName());
|
||||||
app.getModelSynchronize().setJoin(ip, port);
|
app.getModelSynchronize().setJoin(ip, port);
|
||||||
joinDialog.connectToServer();
|
joinDialog.connectToServer();
|
||||||
@@ -146,7 +147,7 @@ private void tryJoin() {
|
|||||||
// Invalid input, fall through to reset
|
// Invalid input, fall through to reset
|
||||||
}
|
}
|
||||||
|
|
||||||
hostDialog.resetPort();
|
joinDialog.resetPort();
|
||||||
joinDialog.resetIp();
|
joinDialog.resetIp();
|
||||||
app.getAcousticHandler().playSound(MdgaSound.WRONG_INPUT);
|
app.getAcousticHandler().playSound(MdgaSound.WRONG_INPUT);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user