Chat Tutorial in NetBeans/Deploy Text Client: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>SimonSmall →Run it!: correction for server.jar |
imported>SimonSmall m →Server: removed superfluous -l parameter |
||
| (41 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
Deployment is the copying of files from the Development directories to a location that will be accessed by the users. Do not expect these to be the same. |
Deployment is the copying of files from the Development directories to a location that will be accessed by the users. Do not expect these to be the same. |
||
You will need a location for the destination of your developed code. This is referred to as PLAYPATH. Replace this with whatever you have chosen as that location. |
You will need a location for the destination of your developed code. This is referred to as '''PLAYPATH'''. Replace this with whatever you have chosen as that location. Create sub-directories '''lib''' and '''log'''. |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
== Marauroa == |
== Marauroa == |
||
This is copied when copying the Client files. |
|||
When you build the Marauroa engine, it creates a marauroa.jar file in the dist directory of the marauroa project. |
|||
* Copy the marauroa.jar file from the dist directory into the lib sub-directory of PLAYPATH. |
|||
== Server == |
== Server == |
||
When you build the Server library, it creates a server.jar file in the dist directory of the Server project. |
When you build the Server library, it creates a '''server.jar''' file in the '''dist''' directory of the Server project. |
||
* Copy the server.jar file into the lib sub-directory of PLAYPATH. |
* Copy the '''server.jar''' file into the lib sub-directory of PLAYPATH. |
||
* Copy the server.ini and |
* Copy the '''server.ini''' and '''log4j_server.properties''' files from the '''src\server''' directory of the Server project to your PLAYPATH directory. |
||
* Create an empty admins.txt file in your PLAYPATH directory. |
* Create an empty '''admins.txt''' file in your PLAYPATH directory. |
||
* Copy '''h2.jar''' from the downloaded sources to the lib sub-directory, assuming you are using the h2 database. |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
= Run it! = |
= Run it! = |
||
== Server == |
|||
| ⚫ | |||
| ⚫ | |||
<pre> |
<pre> |
||
set LOCALCLASSPATH=.;lib/marauroa.jar;lib/log4j.jar;lib/h2.jar;lib/server.jar |
set LOCALCLASSPATH=.;lib/marauroa.jar;lib/log4j.jar;lib/h2.jar;lib/server.jar |
||
java -cp "%LOCALCLASSPATH%" marauroa.server.marauroad -c server.ini |
java -cp "%LOCALCLASSPATH%" marauroa.server.marauroad -c server.ini |
||
</pre> |
</pre> |
||
For a UNIX / Linux system, use : instead of ; to define the LOCALCLASSPATH |
For a UNIX / Linux system, use : instead of ; to define the LOCALCLASSPATH |
||
The server should start up. |
The server should start up. You can copy these command lines to a command file if you wish, to make it easier. |
||
== Client == |
|||
The client will not run if the server is not started. |
|||
To test the client files open another command / terminal window. Type the following lines (for a Windows system): |
To test the client files open another command / terminal window. Type the following lines (for a Windows system): |
||
<pre> |
<pre> |
||
set LOCALCLASSPATH=.;lib/marauroa.jar;lib/log4j |
set LOCALCLASSPATH=.;lib/marauroa.jar;lib/log4j.jar |
||
java -cp "%LOCALCLASSPATH%" -jar "client.jar" test1 test1 test1@mail.net |
java -cp "%LOCALCLASSPATH%" -jar "client.jar" test1 test1 test1@mail.net |
||
| Line 46: | Line 52: | ||
For a UNIX / Linux system, use : instead of ; to define the LOCALCLASSPATH |
For a UNIX / Linux system, use : instead of ; to define the LOCALCLASSPATH |
||
The client should start up. The output should be something like: |
The client should start up. You can copy these command lines to a command file if you wish, to make it easier. The output should be something like: |
||
<pre> |
<pre> |
||
0. |
0.1 |
||
Chat |
Chat |
||
*test1* : test50 |
*test1* : test50 |
||
| Line 56: | Line 62: | ||
It will repeat forever; use Ctrl-C to stop it, or close the client window. Then use Ctrl-C to stop the server, or close the server window. |
It will repeat forever; use Ctrl-C to stop it, or close the client window. Then use Ctrl-C to stop the server, or close the server window. |
||
You might like to read the [[Chat Tutorial in NetBeans/Text Client explanation|Text Client explanation]]. |
|||
== Errors? == |
|||
You should not get any errors, but if you do then there are a few things you can check. |
|||
* Your directory and files should be as follows: |
|||
<pre> |
|||
PLAYPATH (the location into which you chose to put your files) |
|||
+- admins.txt (created in deploy server, above) |
|||
+- client.jar (created for the client, and copied in deploy client) |
|||
+- h2db.h2.db (created if the server runs successfully) |
|||
+- h2db.lock.db (created if the server runs successfully) |
|||
+- log4j.properties (created for the server, and copied in deploy server) |
|||
+- server.ini (created for the server, and copied in deploy server) |
|||
+- server_stats.xml (created if the server runs successfully) |
|||
+- lib (sub-directory, created above) |
|||
| +- h2.jar (copied in deploy server) |
|||
| +- log4j.jar (copied in deploy client) |
|||
| +- marauroa.jar (copied in deploy client) |
|||
| +- server.jar (created for the server, and copied in deploy server) |
|||
|- log (sub-directory, created above) |
|||
+- server.log (created if the server runs successfully) |
|||
</pre> |
|||
* Check the files were copied correctly into NetBeans and the .jar files have compiled correctly. |
|||
If these are correct, you can try to work out what is wrong from error messages, or delete everything and start again. |
|||
[[Category:NetBeans]] |
|||