Fixed hard-coded host/port, and bump to version 2.1

This commit is contained in:
Andrew Lalis 2021-06-19 22:34:37 +02:00
parent 95ba8c8746
commit 876bd32bdc
5 changed files with 13 additions and 14 deletions

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ace-of-shades</artifactId> <artifactId>ace-of-shades</artifactId>
<groupId>nl.andrewlalis</groupId> <groupId>nl.andrewlalis</groupId>
<version>2.0</version> <version>2.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -2,7 +2,6 @@ package nl.andrewlalis.aos_client;
import nl.andrewlalis.aos_client.view.GameFrame; import nl.andrewlalis.aos_client.view.GameFrame;
import nl.andrewlalis.aos_client.view.GamePanel; import nl.andrewlalis.aos_client.view.GamePanel;
import nl.andrewlalis.aos_core.model.Player;
import nl.andrewlalis.aos_core.model.PlayerControlState; import nl.andrewlalis.aos_core.model.PlayerControlState;
import nl.andrewlalis.aos_core.model.World; import nl.andrewlalis.aos_core.model.World;
import nl.andrewlalis.aos_core.net.PlayerControlStateMessage; import nl.andrewlalis.aos_core.net.PlayerControlStateMessage;
@ -151,18 +150,18 @@ public class Client {
public static void main(String[] args) { public static void main(String[] args) {
// String hostAndPort = JOptionPane.showInputDialog("Enter server host and port (host:port):"); String hostAndPort = JOptionPane.showInputDialog("Enter server host and port (host:port):");
// if (hostAndPort == null) throw new IllegalArgumentException("A host and port is required."); if (hostAndPort == null) throw new IllegalArgumentException("A host and port is required.");
// String[] parts = hostAndPort.split(":"); String[] parts = hostAndPort.split(":");
// if (parts.length != 2) throw new IllegalArgumentException("Invalid host:port."); if (parts.length != 2) throw new IllegalArgumentException("Invalid host:port.");
// String host = parts[0].trim(); String host = parts[0].trim();
// int port = Integer.parseInt(parts[1]); int port = Integer.parseInt(parts[1]);
// String username = JOptionPane.showInputDialog("Enter a username:"); String username = JOptionPane.showInputDialog("Enter a username:");
// if (username == null || username.isBlank()) throw new IllegalArgumentException("Username is required."); if (username == null || username.isBlank()) throw new IllegalArgumentException("Username is required.");
Client client = new Client(); Client client = new Client();
try { try {
client.connect("localhost", 8035, "andrew"); client.connect(host, port, username);
} catch (IOException | ClassNotFoundException e) { } catch (IOException | ClassNotFoundException e) {
client.shutdown(); client.shutdown();
e.printStackTrace(); e.printStackTrace();

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ace-of-shades</artifactId> <artifactId>ace-of-shades</artifactId>
<groupId>nl.andrewlalis</groupId> <groupId>nl.andrewlalis</groupId>
<version>2.0</version> <version>2.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -7,7 +7,7 @@
<groupId>nl.andrewlalis</groupId> <groupId>nl.andrewlalis</groupId>
<artifactId>ace-of-shades</artifactId> <artifactId>ace-of-shades</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0</version> <version>2.1</version>
<modules> <modules>
<module>server</module> <module>server</module>
<module>client</module> <module>client</module>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ace-of-shades</artifactId> <artifactId>ace-of-shades</artifactId>
<groupId>nl.andrewlalis</groupId> <groupId>nl.andrewlalis</groupId>
<version>2.0</version> <version>2.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>