Project: * Clean-up (Eclipse cruft, unused files, etc...) * Git-specific changes * Maven POMs clean-up and changes for the build system * Version set to 1.0.0-0 in the development branches * Maven plug-ins updated to latest versions * Very partial dev. documentation added
This commit is contained in:
parent
c74e30d5ba
commit
0665a760de
1439 changed files with 1020 additions and 1649 deletions
legacyworlds/doc
58
legacyworlds/doc/Eclipse-import.txt
Normal file
58
legacyworlds/doc/Eclipse-import.txt
Normal file
|
@ -0,0 +1,58 @@
|
|||
Legacy Worlds Eclipse projects import
|
||||
======================================
|
||||
|
||||
While it is not strictly necessary, it is recommended to import the Legacy
|
||||
Worlds code into a separate workspace, as it will be easier to use e.g. the LW
|
||||
code formatting configuration without interfering with other projects.
|
||||
|
||||
Before you start, make sure the following Eclipse plug-ins are active:
|
||||
* M2E (the Maven integration plug-in)
|
||||
* EGit or equivalent
|
||||
|
||||
This guide assumes that you've already cloned the source code from the
|
||||
server's Git repositories.
|
||||
|
||||
|
||||
Importing the projects
|
||||
-----------------------
|
||||
|
||||
1) Select the Java perspective (the Java EE perspective tries to be clever and
|
||||
fails).
|
||||
2) In the Package Explorer, right-click then select Import.
|
||||
3) Select Maven > Existing Maven projects.
|
||||
4) Select the root directory of your local Git repository. It will list all
|
||||
parts of the Legacy Worlds code. Make sure they're all selected, then click the
|
||||
Finish button.
|
||||
|
||||
The projects should be imported, and after a while, they should all build
|
||||
successfully. This may take a few minutes, as Maven will download all
|
||||
dependencies and plug-ins.
|
||||
|
||||
At this point, Eclipse knows of the projects, but has no clue they're in a Git
|
||||
repository.
|
||||
|
||||
|
||||
Git support
|
||||
------------
|
||||
|
||||
1) Open the Git Repositories perspective, and add the local repository to the
|
||||
list.
|
||||
2) Go back to the Java perspective, select all projects, right-click then select
|
||||
Team > Share Project
|
||||
3) Select the Git repository type,
|
||||
4) Select the local repository then click Finish.
|
||||
|
||||
Eclipse will proceed to "link" the local repository with the projects in the
|
||||
workspace.
|
||||
|
||||
|
||||
Editor set-up
|
||||
--------------
|
||||
|
||||
1) Select Window > Preferences in the main menu
|
||||
2) Select Java > Code Style > Formatter
|
||||
3) Click the Import button and select the eclipse-code-format.xml file found in
|
||||
the legacyworlds/ directory.
|
||||
4) Select Java > Code Style > Clean Up
|
||||
5) Click the Import button and select the eclipse-code-cleanup.xml file found
|
||||
in the legacyworlds/ directory.
|
48
legacyworlds/doc/TODO.txt
Normal file
48
legacyworlds/doc/TODO.txt
Normal file
|
@ -0,0 +1,48 @@
|
|||
NOTES:
|
||||
-> This is *NOT* a complete list. Some of the tasks here will be decomposed
|
||||
later and new tasks will be added as we go.
|
||||
-> If you feel like trying to take on some task, talk to me about it.
|
||||
-> Tasks that start with '!' are urgent, tasks that start with '?' are
|
||||
low-priority.
|
||||
|
||||
|
||||
PROJECT:
|
||||
|
||||
! Write the new build system
|
||||
|
||||
* Update all dependencies to the latest versions
|
||||
|
||||
|
||||
SERVER & DATABASE:
|
||||
|
||||
! Migrate to PostgreSQL 9.1
|
||||
-> add logging to some of the bigger stored procedures through an
|
||||
external connection
|
||||
|
||||
! Add some form of database version control to allow easier updates
|
||||
-> once migrated to Pg9.1, there are some interesting extensions that
|
||||
may be satisfactory
|
||||
|
||||
* Replace all single-precision reals with double precision reals
|
||||
|
||||
* Add a tool to initialise the database
|
||||
|
||||
* I18N loader: improve text file loading (use relative paths)
|
||||
|
||||
* Replace current authentication information (pair of hashes) with a
|
||||
salted SHA512 hash.
|
||||
-> Make sure it is still possible to import old passwords using the
|
||||
new implementation.
|
||||
|
||||
? Mailer configuration shouldn't be hardcoded
|
||||
|
||||
|
||||
GENERAL:
|
||||
|
||||
! Add comments wherever necessary
|
||||
-> that would be "everywhere"
|
||||
|
||||
* Write unit tests
|
||||
? Check out PostgreSQL extensions to test stored procedures
|
||||
* Write unit tests for new code
|
||||
? add more tests if possible
|
86
legacyworlds/doc/local-deployment.txt
Normal file
86
legacyworlds/doc/local-deployment.txt
Normal file
|
@ -0,0 +1,86 @@
|
|||
Deploying a local Legacy Worlds server
|
||||
=======================================
|
||||
|
||||
|
||||
1) Before the server can be deployed, it is necessary to build the whole thing.
|
||||
Enter the legacyworlds/ directory, and run:
|
||||
|
||||
mvn package
|
||||
|
||||
The server's distribution will be prepared in the
|
||||
legacyworlds-server-DIST/target/legacyworlds-server-1.0.0-0/ directory. It
|
||||
includes the server's main archive and libraries, the SQL scripts that
|
||||
initialise the database and the initial game data.
|
||||
|
||||
|
||||
|
||||
2) The database needs to be created. In order to do that, you need to have a
|
||||
PostgreSQL instance onto which you can connect locally, without password, as an
|
||||
administrative user.
|
||||
|
||||
In the server distribution's sql/ directory, copy the db-config.sample.txt file
|
||||
to db-config.txt, and edit it. The "admin" field should be the name of the
|
||||
administrative user, the "db" field the name of the database, the "user" field
|
||||
the name of the Legacy Worlds user, and the "password" field the Legacy Worlds
|
||||
user's password.
|
||||
|
||||
Once this is done, connect to PostgreSQL and run:
|
||||
|
||||
\i database.sql
|
||||
|
||||
|
||||
3) Configure the server's data source by copying the data-source.sample.xml file
|
||||
to data-source.xml, and modifying the JDBC URL, user name and password to match
|
||||
the values used at step 2.
|
||||
|
||||
|
||||
4) Load the game's base data. In order to do that, run the following commands
|
||||
from the root of the server's distribution:
|
||||
|
||||
java -jar legacyworlds-server-main-1.0.0-0.jar \
|
||||
--run-tool ImportText data/i18n-text.xml
|
||||
java -jar legacyworlds-server-main-1.0.0-0.jar \
|
||||
--run-tool ImportTechs data/techs.xml
|
||||
java -jar legacyworlds-server-main-1.0.0-0.jar \
|
||||
--run-tool ImportBuildables data/buildables.xml
|
||||
|
||||
|
||||
5) Run the server for a few seconds by typing:
|
||||
|
||||
java -jar legacyworlds-server-main-1.0.0-0.jar
|
||||
|
||||
Stop it by running
|
||||
|
||||
java -jar legacyworlds-server-main-1.0.0-0.jar --run-tool Stop
|
||||
|
||||
in another terminal.
|
||||
|
||||
|
||||
6) Create the server's super user. First, create an inactive user account:
|
||||
|
||||
java -jar legacyworlds-server-main-0.0-0.jar --run-tool CreateUser
|
||||
|
||||
The tool will prompt for an email address, password (which /will/ appear on the
|
||||
console) and language identifier ('en' or 'fr' are supported). Please note that
|
||||
the usual password strength restrictions apply.
|
||||
|
||||
Once this has been completed, make this user a superuser by running:
|
||||
|
||||
java -jar legacyworlds-server-main-1.0.0-0.jar \
|
||||
--run-tool CreateSuperuser 'user@example.org VisibleName'
|
||||
|
||||
Replace 'user@example.org' with the user's actual email address, and
|
||||
'VisibleName' with the name of the administrator as seen by the users.
|
||||
|
||||
|
||||
7) Web sites:
|
||||
* Set up a local Tomcat instance.
|
||||
* Make sure its manager application is enabled.
|
||||
* Make sure there is a local, XML-based user database configured.
|
||||
* Create an "admin" user with an empty password and the "manager" role.
|
||||
* From the legacyworlds/ directory, run:
|
||||
mvn package tomcat:deploy
|
||||
This will deploy the main and administrative sites to /lwmain and /lwadmin,
|
||||
respectively.
|
||||
* If you need to redeploy the sites later, you need to run
|
||||
mvn package tomcat:redeploy
|
Reference in a new issue