Launching server and client.
Before getting started, was wondering where the log file was. Turned
out to be in the user home directory. (which is what logging.properties
said)
Changes to logging.properties to put it with the jar file in tutorial/
handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler
java.util.logging.FileHandler.pattern=tutorial/java%u.log
AND had to add a blank line at the end of the file or it would not
execute the
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
line to use text instead of XML (default for files)
Still don't know whats causing the 10 MB log file in the db Must be
a Berkley DB thing.
The part on Data Management gives insight into the ManagedObject / ManagedReference thing. Apperantly, ClientSession has become a ManagedObject which can not be stored in another ManagedObject. So, the rererance has to be stored and the the get() method used to access the object.
"To retrieve a ManagedObject from a ManagedReference, we call ManagedReference.get() and pass in a class of the type we expect the ManagedObject to be."This is no longer the case. The return is now cast to the class expected instead of the class being sent as a parameter. This was what most of the changes were about.
Woosh..long read. The GOOD thing is at the end they describe how the
properties file is used to "build" the world with both generic and custom
objects..this looks like a winner..now to copy the code from the exercise
into the project.
From the end of Step 1 item r..updating the Rope class and adding comments.
Will only be recording code changes here..see final source for added
coments.
Changes to com.sun.sgs.darkmud.trapdoor.Rope.java
inserted code for parseCommandType()
inserted code for setUntieTarget()..this
will need fixing..MObj/MRef thing...add
TrapDoor td = (TrapDoor)trapDoorRef.get();
and use td.getDescription()
in string.
inserted code for setTieTarget()
inserted code for notifyCommand()
inserted code for executeTieCommand()
inserted code for executeUntieCommand()..one
line to fixup..Mobj/MRef thing..use
TrapDoor trapDoor = (TrapDoor)trapDoorRef.get();
From the end of Step 2 item e..updating the Rug class and adding comments.
Changes to com.sun.sgs.darkmud.trapdoor.Rug.java
inserted code for parseOuterCommand()
inserted code for executeTakeCommand()..fixup
TrapDoor trapDoor = (TrapDoor)trapDoorRef.get();
From the end of Step 3 item b..updating the TrapDoor class and adding
comments.
Changes to com.sun.sgs.darkmud.trapdoor.TrapDoor.java
inserted code for notifyCommand()
also had to add
import com.sun.sgs.darkmud.core.Direction;
Build for error check..everything seems to still work..now to edit
the MudMain.properties per Step 4.
but first..I don't think the MudMain.properties file is being used..getting
a "you're in a room that shouldn't exist." when I look.
This indicates an error in the properties file..(see note in Step 5)..try
copying MudMain.properties into tutorial/conf with the other files.
Nope..still get Dummy room load msg on server launch..try putting it
with jar file.
Nope..still get Dummy room load msg on server launch..try putting it
command directory.
hmm..still can't find it..hmm...found
com.sun.sgs.app.root=tutorial/data/7400_Darkstar
in 7400_Darkstar.properties file...maybe should put it in
tutorial/data/7400_Darkstar
directory..nope..still Dummy room msg.
try adding
log.info(properties.toString());
to MudMain.java:loadRoom() to find out file path maybe..nope..lots
of config stuff though
Says it's using ROOT to find file..no ROOT tag in 7400_Darkstar.properties
file...try adding
ROOT=tutorial/MudMain.properties
to it and putting MudMain.properties in with jar file...nope..try copying
room.origin.description=an inviting room with stone
floor and walls
into 7400_Darkstar.properties file..arrrrrggghhhh...
Still think
com.sun.sgs.app.root=tutorial/data/7400_Darkstar
is the one..add to .boot and move file to jar area
ROOT=${SGS_HOME}/tutorial
bah...looked around the Forums..got an idea..replace the 7400_Darkstar.properties
file with the MudMain.properties file and
in any items from 7400 prop file as needed...hmm...it seems to have
found the properties, but lots of errors...a small progress step..
Commented out all lines after
room.origin.description=an inviting room with
stone floor and walls
still error, but when I log in and "look", I get the room description..hmm..try
adding
room.origin=room.origin
to file above description tag..no effect..oh well..try adding doors,
items, and rooms from Step 4 to file...leave all other key=value commented
out...ah ha..noticed that the 'name' is not trimmed in loadRoom..so the
if (!properties.containsKey(name
+ ".description")) {
doesn't work as intended..try String name = nameNT.trim(); and change
input parameter to nameNT..nope..try putting
log.info(name + ".description");
// TEST ONLY
before if test..just to see if the string is mangled..nope..oh well..the
logic works, but can't figure out why test fails..
Sooooo....just changed test to one that's just as valid..
// if (!properties.containsKey(name
+ ".description")) {
if (properties.getProperty(name
+ ".description") == null) {
so there..leaving in trim change..on to getting the logic flow working...can
walk west and east so far..need to enable the other stuff in MudMain.properties
file.
Source and 7400_Darkstar.boot, mudMain.properties files zipped into
fixedUp7400srcL3.zip.
Ok, the basic format is desribed in Appendix A