Archived
1
0
Fork 0

Move ServerConfiguration to GUI package

This commit is contained in:
Ethanell 2022-01-30 18:26:06 +01:00
parent 58ffe690fe
commit d60f2803a5
3 changed files with 10 additions and 4 deletions

View file

@ -1,4 +1,4 @@
package fr.univ.lyon1.common;
package fr.univ.lyon1.gui;
import org.jetbrains.annotations.NotNull;
@ -10,7 +10,6 @@ import java.util.Properties;
/**
* The client server configuration
* ToDo should be in gui and not in common ?
*/
public record ServerConfiguration(@NotNull String address, int port, @NotNull String pseudo, @NotNull String password) {
@NotNull

View file

@ -3,7 +3,7 @@ package fr.univ.lyon1.gui.controller;
import fr.univ.lyon1.common.Channel;
import fr.univ.lyon1.common.ChatSSL;
import fr.univ.lyon1.common.Message;
import fr.univ.lyon1.common.ServerConfiguration;
import fr.univ.lyon1.gui.ServerConfiguration;
import fr.univ.lyon1.common.command.Command;
import fr.univ.lyon1.common.command.CommandType;
import fr.univ.lyon1.common.exception.ChatException;
@ -258,6 +258,13 @@ public class ApplicationController {
}
}
/**
* Pars user input to interpret command
* @param textToSend the user input
* @throws UnknownCommand The command is unknown
* @throws NotInChannel the user is not in the channel
* @throws IOException error with the server
*/
private void parsInput(String textToSend) throws UnknownCommand, NotInChannel, IOException {
if (textToSend.startsWith("/")) {
List<String> args = Arrays.asList(textToSend.split(" "));

View file

@ -1,6 +1,6 @@
package fr.univ.lyon1.gui.controller;
import fr.univ.lyon1.common.ServerConfiguration;
import fr.univ.lyon1.gui.ServerConfiguration;
import fr.univ.lyon1.gui.Dialog;
import fr.univ.lyon1.gui.handlers.ApplicationHandler;
import javafx.fxml.FXML;