giovdellap / IngSoft-Project-2018

Java project for a server-client board game
0 stars 0 forks source link

Problem on cli #7

Closed giovdellap closed 6 years ago

giovdellap commented 6 years ago

We have an huge problem on cli, can you help us please? The client isn't working without fixing it.

If you start server, then client, you type "localhost" in the textfield and press "multiplayer", client should switch to "CLI" scene, but it stops working passing by the "cli execution" lines, as you can see from the log.

The problem is somewhere between the CLI.fxml in Resources folder, GraphicsManager in PackageMP at lines 35-61 and MyCLIController in ViewMP->CLI.

I tried everything, including or not the controller in the fxml, starting another controller, everything... Before last modifies, it said NullPointerException in UsernameInsertion method in the CLI Controller, like if the Label wasn't initialized.

PLEASE HELP US

P.S.: for no reason, through changing fxml files and controllers, it never accepted methods to answer in Scene Builder

P.S:: the idea beside the launcher is the same and it has always worked

michele-bertoni commented 6 years ago

I did not understand one thing: why is it there a cli.fxml file? Cli stands for Command Line Interface, so why implementing it in javaFX?

giovdellap commented 6 years ago

We thought about implementing the CLI on a "command prompt emulator" for some reasons: 1) it's easier to improve flexibility between GUI and CLI 2) allows us to have only one "code" for the client, the idea is to have a "Graphics manager" that implements the GUI or the CLI without depending on the runnning code 3) it's "nicer" to go from a graphical launcher to a "command line emulator window" than switching to a real prompt

Is it a bad idea?

Should we go on prompt?

michele-bertoni commented 6 years ago

In my opinion this is a really bad idea for some reasons:

I hope you understood everything, please write us if anything's not clear. We are keeping this issue open and we will close it after checking you are not using anymore JavaFX for the CLI. Please, fix this ASAP and when you're done comment here, so that we can check and close the issue. Michele Bertoni

ingconti commented 6 years ago

I completely agree with Michele. in my idea Your app (client) must start in CLI and by options (for example from cmd line:
java -jar sagradaClient.jar -c or: java -jar sagradaClient.jar -g (c for console, g for gui for example..)

pass to GUI if requested.

and ad said on Piazza, do NOT waste time with targets and solutions OUTSIDE the specs we gave. During exam, your approach will not be appreciated as

giovdellap commented 6 years ago

You are totally right, we came back on the main route. Thanks for answering, new CLI needs some fixes but already works fine