mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-09-13 12:16:37 +02:00
get client id
This commit is contained in:
@@ -41,6 +41,11 @@ public class NetworkSupport implements MessageListener<Client>, ClientStateListe
|
|||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
if (client == null) return 0;
|
||||||
|
return client.getId();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if there is a connection to the game server.
|
* Checks if there is a connection to the game server.
|
||||||
*
|
*
|
||||||
@@ -80,7 +85,7 @@ public class NetworkSupport implements MessageListener<Client>, ClientStateListe
|
|||||||
* @param port The server's port.
|
* @param port The server's port.
|
||||||
* @throws IOException If an I/O error occurs when creating the client.
|
* @throws IOException If an I/O error occurs when creating the client.
|
||||||
*/
|
*/
|
||||||
void initNetwork(String host, int port) throws IOException {
|
public void initNetwork(String host, int port) throws IOException {
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
throw new IllegalStateException("Already connected to the game server.");
|
throw new IllegalStateException("Already connected to the game server.");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user