Difference between revisions of "MW Server Tutorial"

From MMNet Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
## Install the JDK
 
## Install the JDK
 
# Eclipse
 
# Eclipse
## Download eclipse from https://eclipse.org/downloads/
+
## Download eclipse from https://eclipse.org/downloads/ and install
 
## Start eclipse and set up an initial workspace  
 
## Start eclipse and set up an initial workspace  
 
# Subclipse
 
# Subclipse
Line 15: Line 15:
 
## Drag the install button to your open eclipse window
 
## Drag the install button to your open eclipse window
 
## Follow the prompts to install
 
## Follow the prompts to install
## Change the SSH Connector
+
## Change the SSH Connector (probably not necessary unless you have Write permissions to the repository, but it doesn't hurt anything)
 
### Windows -> Preferences
 
### Windows -> Preferences
 
### Expand Team -> SVN
 
### Expand Team -> SVN
Line 22: Line 22:
 
## Open the SVN Resource Exploring perspectie (Window -> Perspective -> Open Perspective -> Other)
 
## Open the SVN Resource Exploring perspectie (Window -> Perspective -> Open Perspective -> Other)
 
## Right-click in the SVN Repositories area and choose New -> Repository Location
 
## Right-click in the SVN Repositories area and choose New -> Repository Location
## For the URL, e
+
## For the URL, enter svn://svn.code.sf.net/p/mekwars/code/trunk
 +
# Check out the MekWars repository
 +
## From the SVN Repositories screen, right-click the MekWars repository you set up and select "Check Out"
 +
## Choose "Check out as a project configured using the New Project Wizard" and hit Finish
 +
## Select Java -> Java Project
 +
## Hit "Next"
 +
## Give the project a name ("MekWars" works for me) and hit "Next"
 +
## Finish
 +
## Click Yes and OK
 +
## When the project is downloaded:
 +
### Right-click the project and choose properties
 +
### Go to Java Build Path
 +
### Under Libraries, choose "Add JARs"
 +
### Select all jar files in client-dist/lib
 +
### Choose "Add JARs" again and select all jar files in server-dist/lib
 +
### Choose "Add JARs" again and select MegaMek.jar
 +
### Select OK and Finish
 +
## This may now give you an error about the Motif Look and Feel.  If so:
 +
### Open properties back up
 +
### Go to Java Build Path -> Libraries
 +
### Select the JRE System Library and Remove
 +
### Select Add Library
 +
### Select JRE System Library
 +
### Select your Java 8 JRE (mine is listed under workspace default)
 +
### Select Finish
 +
 
 +
You now have a functional build environment.
  
 
# Build MekWars
 
# Build MekWars
## Check out Sourceforge SVN Repository
+
## Update the repository
## Set project properties
+
### Right-click the project
## Compile
+
### Choose Team -> Update to HEAD
 +
## Build
 +
## Right-click build.xml
 +
## Select Run As -> Ant Build...
 +
## Choose your targets and put them in order:
 +
### init
 +
### clean
 +
### compile
 +
### server-jar
 +
### client-jar
 +
### opEditor-jar
 +
### MekWarsAutoUpdate-jar
 +
## Click Run
 +
 
 +
You will now have new JAR files in the root of your project workspace.
  
 
'''Step 2: Set up the initial environment
 
'''Step 2: Set up the initial environment
 +
If you run build.xml with the dist target selected, the Eclipse will build you a basic environment in /dist/server and /dist/client
 +
 +
Copy those two folders somewhere outside of the workspace.
 +
 +
In Server:
 +
# edit data/serverconfig.txt as needed
  
 
'''Step 3: First server start
 
'''Step 3: First server start
 +
# run java -server -jar MekWarsServer.jar or customize as required
 +
 +
 +
Run the client, log in, enroll, and register.  You will probably have a hangar full of OMGs, but we can fix that.  It looks like I have to fix the default build tables, maybe I can fix it for you!
 +
 +
Make yourself an administrator:
 +
 +
*/adminpassword level#<your name>#200
 +
 +
Set the required level to run adminpassword to something reasonable:
 +
 +
*/adminsetcommandlevel adminpassword#200
 +
  
 
'''Step 4: Logs, logs, logs
 
'''Step 4: Logs, logs, logs
  
 
(obviously a work in progress)
 
(obviously a work in progress)

Latest revision as of 14:57, 18 August 2017

How to Build a MekWars Server

Step 1: Learn to compile

This is really not an optional step. TubeAlloy taught you how to set up IntelliJ, so I'm going to teach you how to set up Eclipse.

  1. Java
    1. Get a JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html
    2. Install the JDK
  2. Eclipse
    1. Download eclipse from https://eclipse.org/downloads/ and install
    2. Start eclipse and set up an initial workspace
  3. Subclipse
    1. Point your browser to https://marketplace.eclipse.org/content/subclipse#group-external-install-button
    2. Drag the install button to your open eclipse window
    3. Follow the prompts to install
    4. Change the SSH Connector (probably not necessary unless you have Write permissions to the repository, but it doesn't hurt anything)
      1. Windows -> Preferences
      2. Expand Team -> SVN
      3. Change SVN interface to SVNKit (Pure Java)
  4. Set up the MekWars repository
    1. Open the SVN Resource Exploring perspectie (Window -> Perspective -> Open Perspective -> Other)
    2. Right-click in the SVN Repositories area and choose New -> Repository Location
    3. For the URL, enter svn://svn.code.sf.net/p/mekwars/code/trunk
  5. Check out the MekWars repository
    1. From the SVN Repositories screen, right-click the MekWars repository you set up and select "Check Out"
    2. Choose "Check out as a project configured using the New Project Wizard" and hit Finish
    3. Select Java -> Java Project
    4. Hit "Next"
    5. Give the project a name ("MekWars" works for me) and hit "Next"
    6. Finish
    7. Click Yes and OK
    8. When the project is downloaded:
      1. Right-click the project and choose properties
      2. Go to Java Build Path
      3. Under Libraries, choose "Add JARs"
      4. Select all jar files in client-dist/lib
      5. Choose "Add JARs" again and select all jar files in server-dist/lib
      6. Choose "Add JARs" again and select MegaMek.jar
      7. Select OK and Finish
    9. This may now give you an error about the Motif Look and Feel. If so:
      1. Open properties back up
      2. Go to Java Build Path -> Libraries
      3. Select the JRE System Library and Remove
      4. Select Add Library
      5. Select JRE System Library
      6. Select your Java 8 JRE (mine is listed under workspace default)
      7. Select Finish

You now have a functional build environment.

  1. Build MekWars
    1. Update the repository
      1. Right-click the project
      2. Choose Team -> Update to HEAD
    2. Build
    3. Right-click build.xml
    4. Select Run As -> Ant Build...
    5. Choose your targets and put them in order:
      1. init
      2. clean
      3. compile
      4. server-jar
      5. client-jar
      6. opEditor-jar
      7. MekWarsAutoUpdate-jar
    6. Click Run

You will now have new JAR files in the root of your project workspace.

Step 2: Set up the initial environment If you run build.xml with the dist target selected, the Eclipse will build you a basic environment in /dist/server and /dist/client

Copy those two folders somewhere outside of the workspace.

In Server:

  1. edit data/serverconfig.txt as needed

Step 3: First server start

  1. run java -server -jar MekWarsServer.jar or customize as required


Run the client, log in, enroll, and register. You will probably have a hangar full of OMGs, but we can fix that. It looks like I have to fix the default build tables, maybe I can fix it for you!

Make yourself an administrator:

  • /adminpassword level#<your name>#200

Set the required level to run adminpassword to something reasonable:

  • /adminsetcommandlevel adminpassword#200


Step 4: Logs, logs, logs

(obviously a work in progress)