Update Stuff authored by Derek Williams's avatar Derek Williams
# EGit
Since we are keeping this in a Git repository, you need to have EGit installed in your Eclipse
# Setting up the repository
1. Open the Git Repository perspective
1. Choose the icon for "clone a Git repository and add the clone to this view"
2.1. Use the URL for this repository and your github credentials
2.2. Choose "master" for the branch
2.3. For the directory, pick your Eclipse workspace
2.4. Let it add projects to your workspace. It should create five projects for the five parts of the system.
# Making a branch
No one should make changes directly to the Master branch of the repository. That is kept pristine except for new releases (think of it as a release stream). When we start new development on something, we will agree on a branching structure.
When you want to create a branch, go to the Git Repositories perspective, right click on the repository and select "Switch to -> Create Branch." Give the branch a name and you are ready to go. You can use that "Switch to" to see the current version of any branch. If we want a branch to pick up the changes in the Master branch, we can "rebase" it.
When something is ready to be released, the project manager (Merlin!) will merge the branch back into the Master.
# Warnings
Please set your javadoc warnings to match these:
![](https://web.cs.ship.edu/~merlin/MMO/WarningsSettings.JPG)
# 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 have imported the project into IntelliJ, you will need to create a few run configurations.
<br />
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". <br />
The image below will guide you to the correct location. <br/>
![image](uploads/edit-configurations.png)
2) Next, click the plus in the top left and select "Application".
## Running locally
To run the game on your machine, use these run configurations for the Login Server and Game Servers with the following arguments:
Name: LoginServer
Project: LoginServer
Main Class: LoginServer
Arguments: --localhost
Name: ServerCurrent
Project: GameServer
Main Class: edu.ship.shipsim.areaserver.Server
Arguments: --port=1872 --map=current.tmx --localhost
Name: ServerQuiznasium
Project: GameServer
Main Class: edu.ship.shipsim.areaserver.Server
Arguments: --port=1873 --map=quiznasium.tmx --localhost
Name: ServerStudyHall
Project: GameServer
Main Class: edu.ship.shipsim.areaserver.Server
Arguments: --port=1874 --map=homework.tmx --localhost
Name: ServerSortingRoom
Project: GameServer
Main Class: edu.ship.shipsim.areaserver.Server
Arguments: --port=1875 --map=sortingRoom.tmx --localhost
Name: WellingtonRoom
Project: GameServer
Main Class: edu.ship.shipsim.areaserver.Server
Arguments: --port=1876 --map=wellingtonRoom.tmx --localhost
Name: ServerMCTRoom
Project: GameServer
Main Class: edu.ship.shipsim.areaserver.Server
Arguments: --port=1877 --map=mct1.tmx --localhost
Name: ServerTheGreen
Project: GameServer
Main Class: edu.ship.shipsim.areaserver.Server
Arguments: --port=1878 --map=theGreen.tmx --localhost
Name: GameClient-desktop
Project: DesktopClient
Arguments: --localhost
Name: GameManager
Project: GameManager
Main Class: manager.GameManager
Arguments: --localhost --db=x (where x is your database identifier)
## 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]]