mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-28 18:59:47 +01:00
get client id
This commit is contained in:
parent
9b4cac4e56
commit
437114704a
@ -41,6 +41,11 @@ public class NetworkSupport implements MessageListener<Client>, ClientStateListe
|
||||
return app;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
if (client == null) return 0;
|
||||
return client.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @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) {
|
||||
throw new IllegalStateException("Already connected to the game server.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user