Update Setting up IntelliJ authored by Austin Pliska's avatar Austin Pliska
...@@ -2,94 +2,96 @@ ...@@ -2,94 +2,96 @@
# Getting the right IntelliJ # Getting the right IntelliJ
You need the Ultimate version of IntelliJ. You can get that through the School of Engineering. Look at the [Essential Software] for specific instructions for how to get that. You need the Ultimate version of IntelliJ. You can get that through the School of Engineering. Look at the \[Essential Software\] for specific instructions for how to get that.
# Importing into IntelliJ # Importing into IntelliJ
$\textcolor{red}{\text{You need to import the project that is in the FreshmanRPG folder within the repository.}}$ $`\textcolor{red}{\text{You need to import the project that is in the FreshmanRPG folder within the repository.}}`$
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)
# Run Configurations Setup
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)
# Run Configurations Setup
## Creating a run configuration ## 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". After you have imported the project into IntelliJ, you will need to create a few run configurations.\
The image below will guide you to the correct location. There will already be a few loaded, so below are the steps to create a new one.
![image](uploads/intellij/edit-configurations.png)
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". 2) Next, click the plus in the top left and select "Application".
3) Be sure to set the "Module" as the Java 17 JVM installed on your machine. 3) Be sure to set the "Module" as the Java 17 JVM installed on your machine.
4) Fill in the remaining information as listed in the configurations below. 4) Fill in the remaining information as listed in the configurations below.
## Running locally ## Running locally
To run the game on your machine, use these run configurations for the Desktop Client, Login Server and Game Servers with the following arguments.
The Working Directory fields that are listed will be added after the "FreshmanRPGSuite" path.
$\textcolor{red}{\text{All Class names are prefixed with (edu.ship.engr.shipsim.) Example: edu.ship.engr.shipsim.Server}}$ To run the game on your machine, use these run configurations for the Desktop Client, Login Server and Game Servers with the following arguments.\
The Working Directory fields that are listed will be added after the "FreshmanRPGSuite" path.
$`\textcolor{red}{\text{All Class names are prefixed with (edu.ship.engr.shipsim.) Example: edu.ship.engr.shipsim.Server}}`$
The environment variables text box in each run configuration should contain: `INTELLIJ_MODE=true` The environment variables text box in each run configuration should contain: `INTELLIJ_MODE=true`
| Name | Main Class | Module | Program Arguments | Working Directory | | Name | Main Class | Module | Program Arguments | Working Directory |
|---|---|---|---|---| |------|------------|--------|-------------------|-------------------|
| Login Server | LoginServer | `LoginServer.main` | --localhost | FreshmanRPG/LoginServer | | Login Server | LoginServer | `LoginServer.main` | \--localhost | FreshmanRPG/LoginServer |
| Desktop Client | DesktopClient | `GameClient-desktop.main` | --localhost | FreshmanRPG/GameClient-desktop | | Desktop Client | DesktopClient | `GameClient-desktop.main` | \--localhost | FreshmanRPG/GameClient-desktop |
| Rec Center | Server | `GameServer.main` | --port="1873" --map="recCenter.tmx" | FreshmanRPG/GameServer | | Rec Center | Server | `GameServer.main` | \--port="1873" --map="recCenter.tmx" | FreshmanRPG/GameServer |
| Library | Server | `GameServer.main` | --port="1874" --map="library.tmx" | FreshmanRPG/GameServer | | Library | Server | `GameServer.main` | \--port="1874" --map="library.tmx" | FreshmanRPG/GameServer |
| Sorting Room | Server | `GameServer.main` | --port="1875" --map="sortingRoom.tmx" | FreshmanRPG/GameServer | | Sorting Room | Server | `GameServer.main` | \--port="1875" --map="sortingRoom.tmx" | FreshmanRPG/GameServer |
| Wellington Room | Server | `GameServer.main` | --port="1876" --map="wellingtonRoom.tmx" | FreshmanRPG/GameServer | | Wellington Room | Server | `GameServer.main` | \--port="1876" --map="wellingtonRoom.tmx" | FreshmanRPG/GameServer |
| MCT Room | Server | `GameServer.main` | --port="1877" --map="mct1.tmx" | FreshmanRPG/GameServer | | MCT Room | Server | `GameServer.main` | \--port="1877" --map="mct1.tmx" | FreshmanRPG/GameServer |
| Ducktopia | Server | `GameServer.main` | --port="1879" --map="Ducktopia.tmx" | FreshmanRPG/GameServer | | Ducktopia | Server | `GameServer.main` | \--port="1879" --map="Ducktopia.tmx" | FreshmanRPG/GameServer |
| Cub | Server | `GameServer.main` | --port="1880" --map="cub.tmx" | FreshmanRPG/GameServer | | Cub | Server | `GameServer.main` | \--port="1880" --map="cub.tmx" | FreshmanRPG/GameServer |
| Mowrey | Server | `GameServer.main` | --port="1881" --map="mowrey.tmx" | FreshmanRPG/GameServer | | Mowrey | Server | `GameServer.main` | \--port="1881" --map="mowrey.tmx" | FreshmanRPG/GameServer |
| Outside Mowrey | Server | `GameServer.main` | --port="1882" --map="outsideOfMowrey.tmx" | FreshmanRPG/GameServer | | Outside Mowrey | Server | `GameServer.main` | \--port="1882" --map="outsideOfMowrey.tmx" | FreshmanRPG/GameServer |
| Quad | Server | `GameServer.main` | --port="1883" --map="quad.tmx" | FreshmanRPG/GameServer | | Quad | Server | `GameServer.main` | \--port="1883" --map="quad.tmx" | FreshmanRPG/GameServer |
| DHC1 | Server | `GameServer.main` | --port="1884" --map="dhc1.tmx" | FreshmanRPG/GameServer | | DHC1 | Server | `GameServer.main` | \--port="1884" --map="dhc1.tmx" | FreshmanRPG/GameServer |
| Rail Trail | Server | `GameServer.main` | --port="1885" --map="RailTrail.tmx" | FreshmanRPG/GameServer | | Rail Trail | Server | `GameServer.main` | \--port="1885" --map="RailTrail.tmx" | FreshmanRPG/GameServer |
| Fountain | Server | `GameServer.main` | --port="1886" --map="Fountain.tmx" | FreshmanRPG/GameServer | | Fountain | Server | `GameServer.main` | \--port="1886" --map="Fountain.tmx" | FreshmanRPG/GameServer |
| Old Main | Server | `GameServer.main` | --port="1887" --map="oldMainInside.tmx | FreshmanRPG/GameServer| | Old Main | Server | `GameServer.main` | \--port="1887" --map="oldMainInside.tmx | FreshmanRPG/GameServer |
| Restful Server | Server | `GameServer.main` | --localhost --restfulServer | FreshmanRPG/GameServer | | Restful Server | Server | `GameServer.main` | \--localhost --restfulServer | FreshmanRPG/GameServer |
# Connecting to Your Local Database # Connecting to Your Local Database
--- ---
### Open the menu to create a new connection. ### Open the menu to create a new connection.
--- ---
1) In IntelliJ Ultimate, open the database tab in the top right. 1) In IntelliJ Ultimate, open the database tab in the top right.
2) In the top-left of the panel that opened, click the `+`. 2) In the top-left of the panel that opened, click the `+`.
1) Hover over `Data Source` and select `MySQL` in the context menu that appears. 1) Hover over `Data Source` and select `MySQL` in the context menu that appears.
3) Setting the parameters: 3) Setting the parameters:
1) Set the port to 3308 1) Set the port to 3308
2) Set the User to frpg 2) Set the User to frpg
3) Set the Password to Database_Password 3) Set the Password to Database_Password
4) Click `Test Connection` 4) Click `Test Connection`
1) If the connection fails, please verify that you entered the correct credentials 1) If the connection fails, please verify that you entered the correct credentials
5) Viewing Your Local Database:
5.) Viewing Your Local Database 1) Click on the `Schemas` section.
1) Click on the 'Schemas' section. 2) Check 'frpg' and apply.
2) Check 'frpg' and apply.
### Click OK and enjoy your database access ### Click OK and enjoy your database access
# Connecting to the Production Database # Connecting to the Production Database
--- ---
### Open the menu to create a new connection. ### Open the menu to create a new connection.
--- ---
1) In IntelliJ Ultimate, open the database tab in the top right. 1) In IntelliJ Ultimate, open the database tab in the top right.
2) In the top-left of the panel that opened, click the `+`. 2) In the top-left of the panel that opened, click the `+`.
1) Hover over `Data Source` and select `MySQL` in the context menu that appears. 1) Hover over `Data Source` and select `MySQL` in the context menu that appears.
### Open the SSH/SSL tab of the creation window. This is only required if connecting to the production database. ### Open the SSH/SSL tab of the creation window. This is only required if connecting to the production database.
--- ---
1) Click on the checkbox labeled `Use SSH Tunnel` and then click the `...` to the right of the dropdown list. 1) Click on the checkbox labeled `Use SSH Tunnel` and then click the `...` to the right of the dropdown list.
2) In the screen that appears, click the `+` in the top-left 2) In the screen that appears, click the `+` in the top-left
3) Enter the following information: 3) Enter the following information:
...@@ -97,20 +99,24 @@ The environment variables text box in each run configuration should contain: `IN ...@@ -97,20 +99,24 @@ The environment variables text box in each run configuration should contain: `IN
Request login information from Dr. Wellington Request login information from Dr. Wellington
4) Click `Test Connection` 4) Click `Test Connection`
1) If the connection fails, please verify that you entered the correct credentials 1) If the connection fails, please verify that you entered the correct credentials
### Open the General tab of the creation window. ### Open the General tab of the creation window.
--- ---
1) Enter the following information: 1) Enter the following information:
Request login information from Dr. Wellington Request login information from Dr. Wellington
2) Under the text boxes that you just changed, click `Test Connection` 2) Under the text boxes that you just changed, click `Test Connection`
1) If the connection fails, please verify that you entered the correct credentials 1) If the connection fails, please verify that you entered the correct credentials
### Open the Schemas tab of the creation window. ### Open the Schemas tab of the creation window.
--- ---
1) Click the box labeled `frpg` until a checkmark appears. 1) Click the box labeled `frpg` until a checkmark appears.
1) If you do not see the above-mentioned label, give IntelliJ a minute to connect to the database or try to reopen the window to save the configuration. 1) If you do not see the above-mentioned label, give IntelliJ a minute to connect to the database or try to reopen the window to save the configuration.
### Click OK and enjoy your database access ### Click OK and enjoy your database access
\ No newline at end of file