WIP3 système de connection à plusieurs utilisateurs
This commit is contained in:
parent
73664235ba
commit
17e9a0b650
1 changed files with 5 additions and 4 deletions
|
@ -139,8 +139,9 @@ class ConnectionListenerThread extends Thread {
|
|||
response2 = bStream.toByteArray();
|
||||
responsePacket2 = new DatagramPacket(response2, response2.length, clientAddress, 1338);
|
||||
responseSocket.send(responsePacket2);
|
||||
|
||||
if(!user.findUser(username))
|
||||
user.add_to_known_users(username, clientAddress.toString());
|
||||
user.add_to_known_users(username, clientAddress.getHostAddress());
|
||||
|
||||
}
|
||||
catch(SocketTimeoutException e)
|
||||
|
@ -236,8 +237,8 @@ public class ClientWindow implements ActionListener {
|
|||
user.add_to_known_users(username, InetAddress.getLocalHost().getHostAddress());
|
||||
for(int i = 0;i < userList.size();i ++)
|
||||
{
|
||||
System.out.println(userList.get(i));
|
||||
System.out.println(hostList.get(i));
|
||||
System.out.println("Name:" + userList.get(i));
|
||||
System.out.println("Address:" + hostList.get(i));
|
||||
user.add_to_known_users(userList.get(i), hostList.get(i));
|
||||
}
|
||||
connected = true;
|
||||
|
|
Loading…
Reference in a new issue