Taille maximale des pseudonymes mise en place
This commit is contained in:
parent
d916a66bed
commit
51c81a61e3
11 changed files with 132 additions and 43 deletions
|
@ -1,6 +1,10 @@
|
||||||
<component name="ArtifactManager">
|
<component name="ArtifactManager">
|
||||||
<artifact type="jar" name="chatapp">
|
<artifact type="jar" name="chatapp">
|
||||||
<output-path>$PROJECT_DIR$/out/artifacts/chatapp</output-path>
|
<output-path>$PROJECT_DIR$/out/artifacts/chatapp</output-path>
|
||||||
<root id="archive" name="chatapp.jar" />
|
<root id="archive" name="chatapp.jar">
|
||||||
|
<element id="directory" name="META-INF">
|
||||||
|
<element id="file-copy" path="$PROJECT_DIR$/src/main/resources/META-INF/MANIFEST.MF" />
|
||||||
|
</element>
|
||||||
|
</root>
|
||||||
</artifact>
|
</artifact>
|
||||||
</component>
|
</component>
|
29
Implementation/chatapp/.idea/artifacts/chatapp_jar.xml
Normal file
29
Implementation/chatapp/.idea/artifacts/chatapp_jar.xml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="chatapp:jar">
|
||||||
|
<output-path>$PROJECT_DIR$/out/artifacts/chatapp_jar</output-path>
|
||||||
|
<root id="archive" name="chatapp.jar">
|
||||||
|
<element id="directory" name="META-INF">
|
||||||
|
<element id="file-copy" path="$PROJECT_DIR$/src/resources/META-INF/MANIFEST.MF" />
|
||||||
|
</element>
|
||||||
|
<element id="library" level="project" name="Gradle: com.google.protobuf:protobuf-java:3.11.4" />
|
||||||
|
<element id="library" level="project" name="Gradle: mysql:mysql-connector-java:8.0.22" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.apiguardian:apiguardian-api:1.1.0" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.junit.jupiter:junit-jupiter-api:5.6.0" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.junit.jupiter:junit-jupiter-engine:5.6.0" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.junit.platform:junit-platform-commons:1.6.0" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.junit.platform:junit-platform-engine:1.6.0" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-base:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-base:win:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-controls:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-controls:win:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-fxml:win:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-graphics:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-graphics:linux:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-graphics:mac:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.openjfx:javafx-graphics:win:11.0.2" />
|
||||||
|
<element id="library" level="project" name="Gradle: org.opentest4j:opentest4j:1.2.0" />
|
||||||
|
<element id="library" level="project" name="lib" />
|
||||||
|
<element id="library" level="project" name="mysql-connector-java-8.0.22" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
20
Implementation/chatapp/.idea/artifacts/chatapp_main_jar.xml
Normal file
20
Implementation/chatapp/.idea/artifacts/chatapp_main_jar.xml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="chatapp.main:jar">
|
||||||
|
<output-path>$PROJECT_DIR$/out/artifacts/chatapp_main_jar</output-path>
|
||||||
|
<root id="archive" name="chatapp.main.jar">
|
||||||
|
<element id="module-output" name="chatapp.main" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-controls/11.0.2/6c763707769c18adce406904c771c2ad1fcc370b/javafx-controls-11.0.2-win.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/mysql/mysql-connector-java/8.0.22/ec8bfce16c8bd18d6cb598b1147aa145be1408f/mysql-connector-java-8.0.22.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-graphics/11.0.2/ef4c34f0ca77cd99100b76c2ccf1dce383572bb1/javafx-graphics-11.0.2-linux.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-graphics/11.0.2/e522eb4ea422eceeee207b1c266ba3db19b2343a/javafx-graphics-11.0.2.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protobuf-java/3.11.4/7ec0925cc3aef0335bbc7d57edfd42b0f86f8267/protobuf-java-3.11.4.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-controls/11.0.2/4ab633cf1eea60f76e2ae9905aedac862da88b08/javafx-controls-11.0.2.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-base/11.0.2/1852e57b8cf9a9b6488c33605bccd5d06ff210e1/javafx-base-11.0.2-win.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-graphics/11.0.2/c1d99ae5bc48e7173f4514a941d27d8f8c972c71/javafx-graphics-11.0.2-mac.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-fxml/11.0.2/b3242e4c031558574de2a1da685bb5fcdbb8a530/javafx-fxml-11.0.2-win.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-base/11.0.2/7fb2e4a8528ec9e434a9ac9ee98b39af79e6dcb8/javafx-base-11.0.2.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-graphics/11.0.2/20459ea2cf714942bcbeb78a7f70ba3531dc1a44/javafx-graphics-11.0.2-win.jar" path-in-jar="/" />
|
||||||
|
<element id="artifact" artifact-name="chatapp" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
|
@ -1,10 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
<component name="JavadocGenerationManager">
|
<component name="JavadocGenerationManager">
|
||||||
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/../../Javadoc" />
|
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/../../Javadoc" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="13" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="13" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -1,6 +1,7 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'application'
|
id 'application'
|
||||||
|
id 'com.github.johnrengelman.shadow' version '6.1.0'
|
||||||
id 'org.openjfx.javafxplugin' version '0.0.9'
|
id 'org.openjfx.javafxplugin' version '0.0.9'
|
||||||
id 'org.beryx.jlink' version '2.15.1'
|
id 'org.beryx.jlink' version '2.15.1'
|
||||||
}
|
}
|
||||||
|
@ -42,3 +43,13 @@ jlink {
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
manifest {
|
||||||
|
attributes "Main-Class": "chatapp.Launcher"
|
||||||
|
}
|
||||||
|
|
||||||
|
from {
|
||||||
|
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ chatapp/View/FenetreSession.java
|
||||||
chatapp.View.FenetreSession
|
chatapp.View.FenetreSession
|
||||||
chatapp/Controller/ChatApp.java
|
chatapp/Controller/ChatApp.java
|
||||||
chatapp.Controller.ChatApp
|
chatapp.Controller.ChatApp
|
||||||
chatapp/View/ChangementPseudo.java
|
chatapp/View/DemarrerSession.java
|
||||||
chatapp.View.ChangementPseudo
|
chatapp.View.DemarrerSession
|
||||||
chatapp/Protocol/RunnerEcouteUDP.java
|
chatapp/Protocol/RunnerEcouteUDP.java
|
||||||
chatapp.Protocol.RunnerEcouteUDP
|
chatapp.Protocol.RunnerEcouteUDP
|
||||||
chatapp/Protocol/UDPEchange.java
|
chatapp/Protocol/UDPEchange.java
|
||||||
|
@ -28,13 +28,13 @@ 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/Protocol/HttpEchange.java
|
||||||
chatapp.View.ConnexionScreen
|
chatapp.Protocol.HttpEchange
|
||||||
chatapp/View/View_Utilisateurs.java
|
chatapp/View/View_Utilisateurs.java
|
||||||
chatapp.View.View_Utilisateurs
|
chatapp.View.View_Utilisateurs
|
||||||
chatapp/View/View_Menu.java
|
chatapp/View/View_Menu.java
|
||||||
chatapp.View.View_Menu
|
chatapp.View.View_Menu
|
||||||
chatapp/Protocol/HttpEchange.java
|
chatapp/View/ChangementPseudo.java
|
||||||
chatapp.Protocol.HttpEchange
|
chatapp.View.ChangementPseudo
|
||||||
chatapp/View/DemarrerSession.java
|
chatapp/View/ConnexionScreen.java
|
||||||
chatapp.View.DemarrerSession
|
chatapp.View.ConnexionScreen
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package chatapp.Controller;
|
package chatapp.Controller;
|
||||||
|
|
||||||
|
import chatapp.Model.DataBase;
|
||||||
import chatapp.Model.ListUtilisateurs;
|
import chatapp.Model.ListUtilisateurs;
|
||||||
import chatapp.Model.Utilisateur;
|
import chatapp.Model.Utilisateur;
|
||||||
import chatapp.Protocol.*;
|
import chatapp.Protocol.*;
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class HttpEchange {
|
||||||
/* URL de notre serveur de presence */
|
/* URL de notre serveur de presence */
|
||||||
private String url = "http://192.168.1.72:8080/Server_AL_NM/";
|
private String url = "http://192.168.1.72:8080/Server_AL_NM/";
|
||||||
// private String url = "https://srv-gei-tomcat.insa-toulouse.fr/Server_AL_NM/";
|
// private String url = "https://srv-gei-tomcat.insa-toulouse.fr/Server_AL_NM/";
|
||||||
|
//private String url = "https://srv-gei-tomcat.insa-toulouse.fr/Server_AL_NM/";
|
||||||
/* True si l'utilisateur peut se connecter avec ce nom d'utilisateur , False sinon */
|
/* True si l'utilisateur peut se connecter avec ce nom d'utilisateur , False sinon */
|
||||||
private static boolean connecte = false;
|
private static boolean connecte = false;
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class ChangementPseudo {
|
||||||
|
|
||||||
/* Une instance de chatApp */
|
/* Une instance de chatApp */
|
||||||
private ChatApp chatApp;
|
private ChatApp chatApp;
|
||||||
|
private int MaxLength=10;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
/**
|
/**
|
||||||
|
@ -70,6 +71,14 @@ public class ChangementPseudo {
|
||||||
*/
|
*/
|
||||||
void validerPseudo(ActionEvent event) {
|
void validerPseudo(ActionEvent event) {
|
||||||
boolean pseudoOK = false;
|
boolean pseudoOK = false;
|
||||||
|
if (pseudonyme.getText().length() > MaxLength) {
|
||||||
|
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||||
|
alert.setTitle("Connexion");
|
||||||
|
// Header Text: null
|
||||||
|
alert.setHeaderText(null);
|
||||||
|
alert.setContentText("Echec de Connexion: le pseudo entre fait plus de " + MaxLength + " caracteres");
|
||||||
|
alert.showAndWait();
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
pseudoOK = chatApp.modifierPseudo(pseudonyme.getText());
|
pseudoOK = chatApp.modifierPseudo(pseudonyme.getText());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -77,8 +86,7 @@ public class ChangementPseudo {
|
||||||
}
|
}
|
||||||
if (pseudoOK) {
|
if (pseudoOK) {
|
||||||
this.retourMenu(null);
|
this.retourMenu(null);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||||
alert.setTitle("Changement pseudo");
|
alert.setTitle("Changement pseudo");
|
||||||
// Header Text: null
|
// Header Text: null
|
||||||
|
@ -87,6 +95,7 @@ public class ChangementPseudo {
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> Initialization de la classe ChangementPseudo et permet d'initialiser les parametres</p>
|
* <p> Initialization de la classe ChangementPseudo et permet d'initialiser les parametres</p>
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class Clavardage implements Initializable, PropertyChangeListener {
|
||||||
public void ajouterMessagesHistorique(ActionEvent actionEvent) {
|
public void ajouterMessagesHistorique(ActionEvent actionEvent) {
|
||||||
//this.nomTable = this.session.getApp().getDb().getNomTable(u2,this.session.getApp().getMe());
|
//this.nomTable = this.session.getApp().getDb().getNomTable(u2,this.session.getApp().getMe());
|
||||||
//String historique = this.session.getApp().getDb().recupNMsg(session.getApp().getMe().getId(),this.u2.getId(), this.session.getApp().getDb().tailleBDD(nomTable));
|
//String historique = this.session.getApp().getDb().recupNMsg(session.getApp().getMe().getId(),this.u2.getId(), this.session.getApp().getDb().tailleBDD(nomTable));
|
||||||
ChatText.clear();
|
//ChatText.clear();
|
||||||
//ChatText.insertText(0,historique);
|
//ChatText.insertText(0,historique);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -36,6 +36,8 @@ public class ConnexionScreen {
|
||||||
/* RadioButton : l'utilisateur est local */
|
/* RadioButton : l'utilisateur est local */
|
||||||
public RadioButton localButton;
|
public RadioButton localButton;
|
||||||
|
|
||||||
|
private int MaxLength = 10;
|
||||||
|
|
||||||
@FXML // ResourceBundle that was given to the FXMLLoader
|
@FXML // ResourceBundle that was given to the FXMLLoader
|
||||||
private ResourceBundle resources;
|
private ResourceBundle resources;
|
||||||
|
|
||||||
|
@ -58,11 +60,20 @@ public class ConnexionScreen {
|
||||||
if (this.localButton.isSelected()) {
|
if (this.localButton.isSelected()) {
|
||||||
// PARTIE CONNEXION LOCALE
|
// PARTIE CONNEXION LOCALE
|
||||||
ChatApp.getInstance().setExterne(false);
|
ChatApp.getInstance().setExterne(false);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
// PARTIE CONNEXION DISTANTE
|
// PARTIE CONNEXION DISTANTE
|
||||||
ChatApp.getInstance().setExterne(true);
|
ChatApp.getInstance().setExterne(true);
|
||||||
}
|
}
|
||||||
|
if (pseudonyme.getText().length() > MaxLength) {
|
||||||
|
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||||
|
alert.setTitle("Connexion");
|
||||||
|
// Header Text: null
|
||||||
|
alert.setHeaderText(null);
|
||||||
|
alert.setContentText("Echec de Connexion: le pseudo entre fait plus de " + MaxLength + " caracteres");
|
||||||
|
alert.showAndWait();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
connexion = ChatApp.getInstance().connexion(pseudonyme.getText());
|
connexion = ChatApp.getInstance().connexion(pseudonyme.getText());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -89,3 +100,4 @@ public class ConnexionScreen {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue