Chat Tutorial in NetBeans/Deploy Text Client: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>SimonSmall
Tidy up
imported>SimonSmall
Wrong directory used (typo)
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. Create sub-directories '''libs''' and '''log'''.
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 ==


If you built the Marauroa engine from source code, it creates a '''marauroa.jar''' file in the '''dist''' directory of the marauroa project.
If you built the Marauroa engine from source code, 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 libs sub-directory of PLAYPATH.
* Copy the '''marauroa.jar''' file from the dist directory into the lib sub-directory of PLAYPATH.


== Other libs files ==
== Other lib files ==


If you did not build the '''marauroa.jar''' file from source, you will need to copy this from the downloaded sources to the libs directory. You also need to copy '''h2.jar''' and '''log4j.jar''' from the downloaded sources to the libs directory.
If you did not build the '''marauroa.jar''' file from source, you will need to copy this from the downloaded sources to the lib directory. You also need to copy '''h2.jar''' and '''log4j.jar''' from the downloaded sources to the lib directory.


== 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 libs sub-directory of PLAYPATH.
* Copy the '''server.jar''' file into the lib sub-directory of PLAYPATH.
* Copy the '''server.ini''' and '''log4j.properties''' files from the '''src\server''' directory of the Server project to your PLAYPATH directory.
* Copy the '''server.ini''' and '''log4j.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.
Line 33: Line 33:


<pre>
<pre>
set LOCALCLASSPATH=.;libs/marauroa.jar;libs/log4j.jar;libs/h2.jar;libs/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 -l
java -cp "%LOCALCLASSPATH%" marauroa.server.marauroad -c server.ini -l
Line 47: Line 47:


<pre>
<pre>
set LOCALCLASSPATH=.;libs/marauroa.jar;libs/log4j.jar;libs/h2.jar
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

Revision as of 14:44, 4 March 2012

Deployment

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. Create sub-directories lib and log.

Marauroa

If you built the Marauroa engine from source code, 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.

Other lib files

If you did not build the marauroa.jar file from source, you will need to copy this from the downloaded sources to the lib directory. You also need to copy h2.jar and log4j.jar from the downloaded sources to the lib directory.

Server

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.ini and log4j.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.

Client

When you build the Client, it creates a client.jar file in the dist directory of the Client project.

  • Copy the client.jar file from the dist directory to your PLAYPATH directory.

Run it!

Server

To test the server files open a command / terminal window in the PLAYPATH directory. Type the following lines (for a Windows system):

set LOCALCLASSPATH=.;lib/marauroa.jar;lib/log4j.jar;lib/h2.jar;lib/server.jar

java -cp "%LOCALCLASSPATH%" marauroa.server.marauroad -c server.ini -l

For a UNIX / Linux system, use : instead of ; to define the LOCALCLASSPATH

The server should start up. You can copy these command lines to a command file if you wish, to make it easier.

Client

To test the client files open another command / terminal window. Type the following lines (for a Windows system):

set LOCALCLASSPATH=.;lib/marauroa.jar;lib/log4j.jar

java -cp "%LOCALCLASSPATH%" -jar "client.jar" test1 test1 test1@mail.net

For a UNIX / Linux system, use : instead of ; to define the LOCALCLASSPATH

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:

0.1
Chat
*test1* : test50
*test1* : test150

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 Text Client explanation.