Fixed: TCP error sending, Server Crashed on GUIClient

This commit is contained in:
rubenpirreram
2026-05-26 20:56:16 +02:00
parent 2efee34f9f
commit 251795e0e4
5 changed files with 34 additions and 36 deletions
@@ -137,9 +137,14 @@ public class GUI extends Application implements IView {
@Override
public void showError(ErrorType error,String message) {
Platform.runLater(() -> {
synchronized (miniModel) {
controllerMain.isError = true;
controllerMain.render();
if(error==ErrorType.SERVER_CRASHED){
primaryStage.setScene(loginScene);
controllerLogin.showError(error);
}else {
synchronized (miniModel) {
controllerMain.isError = true;
controllerMain.render();
}
}
});
}
@@ -172,7 +172,7 @@ public class LoginFXMLController {
}
}
}
private void showError(ErrorType errorType) {
public void showError(ErrorType errorType) {
labelErrore.setTextFill(Color.web("#e05050"));
labelErrore.setText(errorType.toString());
}