Modification Utilisateur
This commit is contained in:
parent
142a9e021c
commit
f56866329d
4 changed files with 19 additions and 5 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
chatapp/Launcher.java
|
chatapp/Launcher.java
|
||||||
chatapp.Launcher
|
chatapp.Launcher
|
||||||
|
chatapp/View/ConnexionScreen.java
|
||||||
|
chatapp.View.ConnexionScreen
|
||||||
chatapp/Protocol/RunnerEcouteTCP.java
|
chatapp/Protocol/RunnerEcouteTCP.java
|
||||||
chatapp.Protocol.RunnerEcouteTCP
|
chatapp.Protocol.RunnerEcouteTCP
|
||||||
chatapp/View/FenetreSession.java
|
chatapp/View/FenetreSession.java
|
||||||
|
|
@ -27,8 +29,6 @@ chatapp/View/Clavardage.java
|
||||||
chatapp.View.Clavardage$1
|
chatapp.View.Clavardage$1
|
||||||
chatapp/Protocol/SessionClavardage.java
|
chatapp/Protocol/SessionClavardage.java
|
||||||
chatapp.Protocol.SessionClavardage
|
chatapp.Protocol.SessionClavardage
|
||||||
chatapp/View/ConnexionScreen.java
|
|
||||||
chatapp.View.ConnexionScreen
|
|
||||||
chatapp/View/View_Utilisateurs.java
|
chatapp/View/View_Utilisateurs.java
|
||||||
chatapp.View.View_Utilisateurs
|
chatapp.View.View_Utilisateurs
|
||||||
chatapp/Model/Utilisateur.java
|
chatapp/Model/Utilisateur.java
|
||||||
|
|
|
||||||
|
|
@ -125,9 +125,8 @@ public class ListUtilisateurs {
|
||||||
boolean appartient = false ;
|
boolean appartient = false ;
|
||||||
for(Utilisateur elem: this.actifUsers)
|
for(Utilisateur elem: this.actifUsers)
|
||||||
{
|
{
|
||||||
if (elem.equals(u) ) {
|
if (elem.getId().equals(u.getId()) ) {
|
||||||
appartient = true ;
|
appartient = true ;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println("Test appartient : " + appartient);
|
System.out.println("Test appartient : " + appartient);
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,20 @@ public class Utilisateur {
|
||||||
this.id = aux ;
|
this.id = aux ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur : Utilisateur
|
||||||
|
* @param pseudo Le pseudo associé
|
||||||
|
* @param port Le port
|
||||||
|
* @param ip L'adresse IP
|
||||||
|
* @param id L'id
|
||||||
|
*/
|
||||||
|
public Utilisateur(String pseudo,Integer port, InetAddress ip , String id){
|
||||||
|
this.setPseudo(pseudo) ;
|
||||||
|
this.setPort(port);
|
||||||
|
this.ip = ip ;
|
||||||
|
this.id = id ;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter Pseudo
|
* Getter Pseudo
|
||||||
* @return Le pseudo de l'utilisateur
|
* @return Le pseudo de l'utilisateur
|
||||||
|
|
@ -119,7 +133,7 @@ public class Utilisateur {
|
||||||
id=mots[10];
|
id=mots[10];
|
||||||
Utilisateur user = null;
|
Utilisateur user = null;
|
||||||
try {
|
try {
|
||||||
user = new Utilisateur(name,port,InetAddress.getByName(ip.split("/")[1]));
|
user = new Utilisateur(name,port,InetAddress.getByName(ip.split("/")[1]), id);
|
||||||
} catch (UnknownHostException e) {
|
} catch (UnknownHostException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ public class HttpEchange {
|
||||||
String suite = response.body().split("\n")[i];
|
String suite = response.body().split("\n")[i];
|
||||||
// Le server nous envoie les utilisateurs connectés en local ou à distance
|
// Le server nous envoie les utilisateurs connectés en local ou à distance
|
||||||
if (!suite.equals("")){
|
if (!suite.equals("")){
|
||||||
|
System.out.println(suite);
|
||||||
this.chatapp.getActifUsers().addList(Utilisateur.stringToUtilisateur(suite));
|
this.chatapp.getActifUsers().addList(Utilisateur.stringToUtilisateur(suite));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue