Create Setting up IntelliJ authored by Derek Williams's avatar Derek Williams
# Importing into IntelliJ
Click the link below to learn how to import the project.
[Importing a project into IntelliJ](https://www.jetbrains.com/help/idea/import-project-or-module-wizard.html)
# YouTrack Setup
The YouTrack integration is a great way to sync your issues between YouTrack and IntelliJ.
## Configuring the Integration
1) Go to "File -> Settings", which will open a new window.
2) In the search box in the top left, enter "YouTrack" and go into "Tools -> Tasks -> Servers".
3) Click the plus, and select "YouTrack".
4) Enter the following information:
- Server URL: https://youtrack.engr.ship.edu:8443
- Username: The username you used to make your YouTrack account
- Password: The password you used to make your YouTrack account
- Search: `project: FreshmanRPG SWE-State: Backlog, Started Assignee: me`
5) Click **OK** and you're done with this part
## Using the Integration
After configuring the integration, you should see a new drop-down menu in the top right labeled "Default Task".
If you click on that, then on "Open Task...", you can click on any task you wish to start.
You can change whatever you want in that window, and then click **OK**
# Run Configurations Setup
## Command Line Arguments
**LoginServer** *(always listens to port 1871)*
* --localhost - will use the test RDS database
* --production - will use the production RDS database
**GameServer**
* --port=x - will listen for connections on that port number
* --map=x - specifies the map file the server should manage (required)
* --localhost - will cause it to use the test RDS database
* --production - will cause it to use the production RDS database
**GameClient**
* --loginhost - the hostname of the machine running the login server
**GameManager**
* --localhost - will use the test RDS database
* --db= - will specify which RDS database will be used
## Creating a run configuration
After you have imported the project into IntelliJ, you will need to create a few run configurations.
There will already be a few loaded, so below are the steps to create a new one.
1) First, click the "Edit Configurations..." button in the top right of the window, which will open a window titled "Run/Debug Configurations".
The image below will guide you to the correct location.
![image](uploads/intellij/edit-configurations.png)
2) Next, click the plus in the top left and select "Application".
3) Be sure to set the "Module" as the Java 11 JVM installed on your machine.
4) Fill in the remaining information as listed in the configurations below.
## Running locally
To run the game on your machine, use these run configurations for the Login Server and Game Servers with the following arguments.
The Working Directory fields that are listed will be added after the "FreshmanRPG" path.
Name: Login Server
Main Class: LoginServer
Module: `-cp Freshman_RPG.LoginServer.main`
Program Arguments: --localhost
Working Directory: FreshmanRPG/LoginServer
Name: Server Rec Center
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1873 --map=recCenter.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Server Library
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1874 --map=library.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Server Sorting Room
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1875 --map=sortingRoom.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Wellington Room
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1876 --map=wellingtonRoom.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Server MCT Room
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1877 --map=mct1.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Ducktopia
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1879 --map=Ducktopia.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Server Cub
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1880 --map=cub.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Mowrey
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1881 --map=mowrey.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Outside Mowrey
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1882 --map=outsideOfMowrey.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: Quad
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1883 --map=quad.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: DHC1
Main Class: edu.ship.shipsim.areaserver.Server
Module: `-cp Freshman_RPG.GameServer.main`
Program Arguments: --port=1884 --map=dhc1.tmx --localhost
Working Directory: FreshmanRPG/GameServer
Name: GameClient-desktop
Main Class: DesktopClient
Module: `-cp Freshman_RPG.GameClient-desktop.main`
Program Arguments: --localhost
Working Directory: FreshmanRPG/GameClient-desktop
Name: GameManager
Main Class: manager.GameManagerFX
Module: `-cp Freshman_RPG.GameManager.main`
Program Arguments: --localhost --db=x (where x is your database identifier)
Working Directory: FreshmanRPG/GameManager
VM Options (show this from the "Modify options" drop down): --module-path "INSERT FILE PATH TO JFX LIBRARY" --add-modules=javafx.controls,javafx.fxml --add-exports javafx.graphics/com.sun.javafx.sg.prism=ALL-UNNAMED
## Running in production for testing
To test using the production database, change the --localhost arguments for all run configurations to --production **except** GameClient-desktop, which should still use the --localhost argument. Since you are running the servers on your local machine, the client needs to know that they are being run locally.
## Setup JavaFX for GameManager
If JavaFX isn't already configured on your machine, follow this guide to adding it to Eclipse.
[[Javafx environment setup]]
\ No newline at end of file