Code Monkey home page Code Monkey logo

ing-sw-2019-collovigh-contini-dei_cas's Introduction

Prova Finale Ingegneria del Software 2019

Gruppo AM18

adrenaline_image

evaluation: 29/30

Functionality State
Basic rules GREEN
Complete rules GREEN
Socket GREEN
RMI GREEN
GUI GREEN
CLI GREEN
Persistence GREEN

Adrenaline

Server

server.jar

without parameters

java -jar server.jar

it starts the server with the default configuration: startUpServerConfig.json, placed in the same folder as the jar. If this file doesn't exist, it will start the game with default args, and export the config in the folder.

This is the only way to init the game with custom min players or/and timer

with 1 parameter

java -jar server.jar socket_port

this init takes only the socket port and sets all the other values to default

with 3 parameters

java -jar ./server.jar socket_port rmi_server_port rmi_client_port

this init takes the socket port, the rmi register port for server and client, and sets the other parameters to default

Client

client.jar

without parameters

java -jar client.jar

Starts the client with the default config read from startUpClientConfig.json, placed in the same folder as the jar. If this file doesn't exist, it will start the game with default args, and export the config in the folder.

WARNING: this init method, if there is no json file in the folder, will launch the client w/ server ip localhost

with 1 parameters

java -jar client.jar server_ip

This method will take only the server ip and sets all the other param to default

with 3 parameters

java -jar client.jar server_ip socket_port user_interface

This method will take only server ip, socket port, ( "-cli" for cli, "-gui" for cli ) and sets all the other param to default

with 5 parameters

java -jar client.jar server_ip socket_port user_interface rmi_server_port rmi_client_port

This method will take only server ip, socket port, ( "-cli" for cli, "-gui" for cli ), rmi registry port for server and client, and sets all the other param to default

toAdd in case of gui

in the case the user wants to launch the program with a gui it is required to add before the parameters specified above :

java -jar --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml 

changing $PATH_TO_FX to the path to the javafx-sdk-11.0.2/bin folder

the project has been tested on javafx-sdk-11.0.2

Note

Whatever init chosen the jar will create a json file in the same folder whit the current config, but this will be read only in the startup process, and every modification done to it will not be effective while the program is running. The file will also only be read if the jar is launched with no args, otherwise the non specified parameters will be set to default

The default param are:

  • server ip is set to localhost
  • default socket port is 22222,
  • rmi register default server port is 22220
  • rmi register default client port is 22221
  • ui default is gui
  • min player default is 3
  • default timer is 30 sec
  • default timer state is enabled

the timer can be disabled by launching the server jar w/ no args and by setting the relative field in the jar to false

Persistence

Saved games

Every game will be saved in the root folder where the executable jar is started, at the end of every turn, with a different ID ( one id for game, every turn the saved file for a given game are overwritten with the current changes).

The game will save 4 json files for game + a sheared file across all to keep the reference to all of them:

for each game started in the folder will be written:

  • savegames_game_id_x_Map.json
  • savegames_game_id_x_Players.json
  • savegames_game_id_x_Controller.json
  • savegames_game_id_x_CurrentGame.json

x will be the game id

there will also be a shared file:

  • savegames_games.json

that will contain the list of the games

How to load a saved game

To load a saved game, edit the StartUpServerConfig file "game" parameter with the ID of the game you wish to reload from file.

-1 is the default value to start a new game

Once the server has started, it will wait for at least MIN_PLAYER that were in the saved game to reconnect by typing their name.

Once every player present in the saved game has reconnected (you can read the saved names in the file: savegamesgame_Id_X_Players.json) the game will start again from the point it was at the time of save.

ing-sw-2019-collovigh-contini-dei_cas's People

Watchers

 avatar  avatar  avatar  avatar

Forkers

contedigital

ing-sw-2019-collovigh-contini-dei_cas's Issues

I can see exception if client runs with NO server

I got:
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.base/java.net.Socket.connect(Socket.java:591)
at java.base/java.net.Socket.connect(Socket.java:540)
at java.base/java.net.Socket.(Socket.java:436)
at java.base/java.net.Socket.(Socket.java:213)
at it.polimi.ingsw.network.client.socket.SocketClient.run(SocketClient.java:103)
at java.base/java.lang.Thread.run(Thread.java:835)
Jul 07, 2019 12:25:37 PM it.polimi.ingsw.network.client.socket.SocketClient run
WARNING: Could not find the server

pls manage gracefully "no server".

Why no advanced functionalities?

As from requirements doc:

Requisiti Soddisfatti Voto Massimo
Regole Semplificate + CLI + (Socket o RMI) 18
Regole Complete + CLI + (Socket o RMI) 21
Regole Complete + CLI + (Socket o RMI) + 1 FA 22
Regole Complete + GUI + (Socket o RMI) + 1 FA 24
Regole Complete + GUI + Socket + RMI + 1 FA 27
Regole Complete + CLI + GUI + Socket + RMI + 1 FA 30
Regole Complete + CLI + GUI + Socket + RMI + 2 FA 30L

Your maximum grade would be 21, even if you implemented much more. Are you really sure you don't want to deliver any advanced functionality? With just one your maximum grade will become 30...

minor glitch

You can allow an empty name.
I tried once, and the second client get:

Screenshot 2019-07-07 at 12 18 27

Test issues

Hi, this issue is to inform you that two of your tests are failing. Moreover, your tests are way too verbose, please delete all the println.

[ERROR] Tests run: 20, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.265 s <<< FAILURE! - in it.polimi.ingsw.model.NormalWeaponTest
[ERROR] heatSeekerTest Time elapsed: 0.015 s <<< FAILURE!
java.lang.AssertionError
at it.polimi.ingsw.model.NormalWeaponTest.heatSeekerTest(NormalWeaponTest.java:849)

[ERROR] grenadeLauncherTest Time elapsed: 0.007 s <<< FAILURE!
java.lang.AssertionError
at it.polimi.ingsw.model.NormalWeaponTest.grenadeLauncherTest(NormalWeaponTest.java:1031)

empty methods in tests

@test
void getPowerUp() {

}

@Test
void getAmmoCube1() {
}

@Test
void getAmmoCube2() {
}

@Test
void getAmmoCube3() {
}

}

pls fix asap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.