How would I get more information about things when something goes wrong, I spent a lot of time the last two days trying to figure out why I got a disconnected message immediately after validation, now it may seem kind of dumb in retrospect, but it turns out there was an issue with the password file (either an extra line or something weird), the server reported that a user left but wasn’t connected and this was pretty frustrating. I’ve seen plenty of references to the ability to get more information but I have no idea how to actually do that. I think if I hadn’t hit this snag up I’d have put up a game that could compete with kevin glass’s tanks game in terms of simplicity (I’m pretty sure my graphics were going to be more like triangle, square, and perhaps… circle though). Now that I’m past the most basic step of actually having a working client/server I can get back on track but it’d definitely be handy to know how to get more information out of this thing.
You need to enable finer Java logging and then examine the darkstar.log
This has been discussed a couple of times already on the boards. Il lsee if I can dig up step by step instructions for you-- otherwise look at the JDK’s logging API docs.
Inthe client, you can put this code to see exceptions in your callbacks:
// turn on detailed logging
StreamHandler streamHandler = new ConsoleHandler();
streamHandler.setLevel(Level.ALL);
streamHandler.setFilter(new Filter() {
public boolean isLoggable(LogRecord record) {
if (record.getLoggerName().startsWith("com.sun.gi")) {
return true;
}
return false;
}
});
Logger log = Logger.getLogger(""); // get root logger
log.setLevel(Level.ALL);
log.addHandler(streamHandler);
I am still looking for the instructiosn for modifying the server file…
is this related to http://www.java-gaming.org/forums/index.php?topic=14309.0 ?
if so, could you also give us a list of possibilities for each of the properties? For example, how many log-levels are there, and how many loghandlers?
I already posted the file in a sticky.