merge dev into test #28

Merged
j23f0712 merged 29 commits from development into dev/test 2024-12-01 23:11:24 +01:00
2 changed files with 5 additions and 6 deletions
Showing only changes of commit 92be52b62a - Show all commits

View File

@@ -68,9 +68,7 @@ public void run() {
private void startServer() {
try {
LOGGER.log(Level.INFO, "Starting server..."); //NON-NLS
InetAddress localhost;
localhost = InetAddress.getLocalHost();
String ip = localhost.getHostAddress();
myServer = Network.createServer(port);
initializeSerializables();
myServer.start();

View File

@@ -126,7 +126,7 @@ private void tryHost() {
private void tryJoin() {
int port = 0;
String ip = joinDialog.getIpt();
String portText = hostDialog.getPort();
String portText = joinDialog.getPort();
try {
// Validate the port
@@ -134,9 +134,10 @@ private void tryJoin() {
if (port < 1 || port > 65535) {
throw new IllegalArgumentException("Invalid port");
}
joinDialog.setPortNumber(port);
// Validate the IP address
if (isValidIpAddress(ip)) {
joinDialog.setHostname(ip);
app.getModelSynchronize().setName(startDialog.getName());
app.getModelSynchronize().setJoin(ip, port);
joinDialog.connectToServer();
@@ -146,7 +147,7 @@ private void tryJoin() {
// Invalid input, fall through to reset
}
hostDialog.resetPort();
joinDialog.resetPort();
joinDialog.resetIp();
app.getAcousticHandler().playSound(MdgaSound.WRONG_INPUT);
}