31may09 CmdrZin
01jun09 CmdrZin

And Now for Something Completly Different.
A clean NetBeans project for DarkMUD Redux

NetBeans->File->New Project->Java->Java Application
Project Name: darkmudReduxNB
Project Location: directory where I put my game work
Project Folder: ...\darkmudReduxNB
Uncheck Creat Main Class
Leave Set as Main Project checked
Ok..now have a blank project..going to build up with just the pieces need to make a server app.
The Client will get its own project after this one is set up.
Copy (or Export) 7400_darkstar\darkstar\src contents to darkmudReduxNB\src
All of the pakages now show up in the Source Package area in the NetBeans project.
Delete the Test Packages and test Libraries folders usless you want them. (use Project Properties)
Delete the com.sun.sgs.darkmud.client and client.img packages since this is only a server project.
RMC the Libraries and add the server distribution jar files from where ever they are installed.
These will be in the ...\sgs-server-dist-0.9.9\lib folder
Libraries->Add Jar/Folder->
    sgs-server-0.9.9.jar
    sgs-server-api-0.9.9.jar
from \src floder
    sgs-server-0.9.9-sources.jar    Added to be able to look at server source code during debug.
To make this an "all in one spot" project, add a conf directory under darkmudReduxNB to hold the properties files.
Try to build..bah..no main class..add back in client packages to use their main class..doesn't add that much code to the final jar.
Have to add client support librariesfrom ...\sgs-client-0.9.9\lib
Libraries->Add Jar/Folder->
    sgs-client.jar
try build again..successful..makes \dist\darkmudReduxNB.jar file...now the tricky part..setting up a server launch area inside the project. Want to use
    java -jar bin/sgs-boot.jar conf/darkmudRedux.boot
from inside the project directory to launch the server so I don;t have to copy the .jar file each time.
dist folder maybe whiped each time..so may need another plan.
Add conf and data folders under dist directory..rebuild to see if they get erased..yup..bah
ok..add a data folder under darkmudRedux to go with the conf folder added earlier..will use the .boot file for paths.
Add a sgsbin folder for the server jar files.
Copy
    sgs-boot.jar
into sgsbin.
Copy
    7400_Darkstar.boot    rename to darkmudReduxNB.boot
    logging.properties
    MudMain.properties
into the darkmudReduxNB\conf directory
Command will now be
    java -jar sgsbin/sgs-boot.jar conf/darkmudReduxNB.boot
from the darkmudReduxNB dierctory.
Remove "/tutorial" from darkmudReduxNB.boot file.
Change MudMain.properties from
    com.sun.sgs.app.name=7400_Darkstar
    com.sun.sgs.app.root=tutorial/data/7400_Darkstar
to
    com.sun.sgs.app.name=darkmudReduxNB
    com.sun.sgs.app.root=data/darkmudReduxNB
ok..looks good..try to launch server from darkmudReduxNB directory...open a Command Prompt window and cd to the directory, then use
    java -jar sgsbin/sgs-boot.jar conf/darkmudReduxNB.boot
to lauch..hmm..ah.change .boot for path to jar..add /dist..
    SGS_DEPLOY=${SGS_HOME}/dist
    ROOT=${SGS_HOME}/dist
hmm..didn't like sgsbin..change name to bin..better..thread "main" exception..try setting MudClient as main...nope..try copying "lib" directory from distribution into project...ah ha..almost there..
need to fix logging path error in properties..
In logging.properties file, change
    java.util.logging.FileHandler.pattern=tutorial/java%u.log
to
    java.util.logging.FileHandler.pattern=log/java%u.log
and make a log folder in the project.
server launches...no app.properties file found???
try change in .boot
    ROOT=${SGS_HOME}/dist
to
    ROOT=${SGS_HOME}
hmm..better..no app still..try change to MudMain.properties
    com.sun.sgs.app.name=darkmudReduxNB
to
    com.sun.sgs.app.name=dist/darkmudReduxNB
hmm..try a test directory like the tutorial..will have to copy file now..but may work..
make a test folder in project.
change
    SGS_DEPLOY=${SGS_HOME}/dist
to
    SGS_DEPLOY=${SGS_HOME}/test
and add /test to paths
move config and data into test folder
change
    com.sun.sgs.app.name=dist/darkmudReduxNB
    com.sun.sgs.app.root=data/darkmudReduxNB
back to
    com.sun.sgs.app.name=darkmudReduxNB
    com.sun.sgs.app.root=test/data/darkmudReduxNB
Command will now be
    java -jar bin/sgs-boot.jar test/conf/darkmudReduxNB.boot
arrrgggh..try copying 7400_Darkstar.properties and rename to darkmudReduxNB.properties
change tutorial to test and 7400_Darkstar to darkmudReduxNB
bah..try copying conf from sgs-server-dist-0.9.9 into project
nope..try copying this project's jar file to the turotial folder and rename it to 7400_Darkstar.jar.
$%&#@...it works fine..must be a a friggin path config problem..hmm..maybe BootClassPath is the key.
Possible topic question.

ERROR:
com.sun.sgs.system.Boot bootClassPath
WARNING: No application jar found with META-INF/app.properties configuration file in the C:\<my working directory>
I can run the server app jar by copying it into the tutorial directory, but I can't seem to make it run anywhere else. Anyonle know what properties file is causing this error? Where does bootClassPath come from?
Looking in the Forum for bootClassPath and apperently you can't get there from here. Have to
use the distibution directory and installation to launch the server...well boo.
Setting up a minmal deploy of server distribution and then copy server app jar there as needed..bah
Ok, here's my minimal file structure after copying the distribution over and deleting the excess stuff. I also deleted all of the tutorial/conf files and anyting in the tutorial/data folder.
sgsMinDeploy099
    bin
    conf
    data
        dsdb
    deploy
    lib
        native
            win32-x86
    license
    tutorial
        conf
        data
Now, copy
  darkmudReduxNB\dist\darkmudReduxNB.jar -> sgsMinDeploy099\tutorial
  darkmudReduxNB\conf\darkmudReduxNB.boot -> sgsMinDeploy099\tutorial\conf
  darkmudReduxNB\conf\logging.properties -> sgsMinDeploy099\tutorial
  darkmudReduxNB\conf\MudMain.properties -> sgsMinDeploy099\tutorial
Edit darkmudReduxNB.boot to be
  SGS_DEPLOY=${SGS_HOME}/tutorial
  SGS_PROPERTIES=${SGS_HOME}/tutorial/conf/MudMain.properties
  SGS_LOGGING=${SGS_HOME}/tutorial/conf/logging.properties
  ROOT=${SGS_HOME}/tutorial
Edit .app.root in MudMain.properties to be
  com.sun.sgs.app.root=tutorial/data/darkmudReduxNB
Edit FileHandler.pattern in logging.properties to be
  java.util.logging.FileHandler.pattern=java%u.log
Open a Command Prompt window, cd to ..\sgsMinDeploy099 and launch server with
  java -jar bin/sgs-boot.jar tutorial/conf/darkmudReduxNB.boot
This all didn't work..APPERENTLY you can ONLY use the original distribution due to environment variables or some such thing..arrrggghh...brain hurt.
Ok, copy the .jar and conf file to the sgs-server-dist-0.9.9 area where the tutorial is, cd there, and launch with
  java -jar bin/sgs-boot.jar tutorial/conf/darkmudReduxNB.boot
GEE..it works now....

ok, back to the cleaned up NetBeans project.
In darkmudReduxNB, delete the added folders bin, conf, data, lib, log, and test
Clean and Build project and test with server to be sure nothing broke..good..all still ok.
darkmudReduxNB will now be the working project area..importing into java.net SVN
Clean darkmudReduxNB then copy into test fold that was checked out..commint to add darkmudReduxNB under Netbeans SVN project.
You can now Check Out the clean project with TortoiseSVN from URL
  https://darkmud-redux.dev.java.net/svn/darkmud-redux/trunk/NetBeans/darkmudReduxNB
into a working folder and then open the project using NetBeans. You still need to add the distribution jar files to the Libraries though. Just the two server and the client jar files.
Builds fine..and runs fine..now, back to Plan 7.