March 30th, 2001


NBGS status

It feels so good to get away from perl, databases, server loads, and general chaos every so often. I love Java... such a beautiful language. Everything is so easy and clean.

Status on Networked Board Game System (NBGS) ... can launch with "./nbgs -server" and have it go into server mode. The client (not written, testing using telnet) can connect and disconnect (either cleanly or forcefully) and the server will maintain its count of connected clients and who's connected. Each client is a separate thread that reads the response from the remote user, parses it, and calls handleClientResponse on the Server class, passing itself and a class representing the parsed response. The communication between client and server is line-based, with key/value pairs encoded URL-style. For big data structures (like, say, ScrabbleTurn) which would contain a ton of data and arrays and other stuff, we'll just serialize the class to a string, and send that encoded. The cool thing about doing turn-based games is that it doesn't really matter how much crap we put over the network, and there will never be more than thousand bytes anyway.

Have the start of the client, kinda ... it brings up a top-level window. Infrastructure stuff is more fun, and more important. I'm writing this as an application first, but keeping it mind that it must run as an applet later too (for convenience for users), so I'm keeping things flexible.

It took more time getting jdk1.2.x working under Debian than it did to write what I have so far. Pretty easy once I read the Debian Java documentation and realized that Sun sucks and what the licensing problems were, though. Just installed the blackdown stuff manually, since Debian can't legally package it. I need to learn the Debian alternatives system better... I understand it in abstract, but need to learn how to use it. I ended up just symlinking /usr/bin/{java,javac,jar} to /usr/local/sun/jdk1.1.2/bin/{...} Not the nice Debian way to do it, but all I could get working.

I should sleep. Tomorrow will be fun.

Update, 1:06 am: Chatting works between connected (telnet) clients now. There will be a public meeting area where people talk and create games, join games, start games, and then once you're in a game, the public room will go away and you'll be able to chat in your game. (ala Starcraft, which I always see Scott playing).

Now I really sleep.


I've been fighting over a bug in my NBGS for like... an hour? I kept going back and forth between thinking blackdown's JDK was buggy or I was incredibly stupid. I couldn't get a frickin' button to work. I added the ActionListener, it built, ran, but just didn't work. My TextListener and WindowListener worked fine.... why wasn't a button working? I got Scott to look at it for me.... we wasted more time. Finally we found it:

add(new Button("Connect"));

Yeah, I was adding an anonymous button instance, not the one I'd created at top and added the actionlistener to. I usually mock up the interface with anonymous crap to begin with, but I'd forgot to change this one.

Hehehe. Yeah, I lose.

At least this isn't homework or real work... and at least it's the weekend. It's easy to laugh at myself for being stupid when I have nothing better to be doing. :-)

nap, out.

Took a nap from about 4:30 until 8:30. So much for my 15 minute power nap.

Blythe and I are off to get Chinese food from Safeway, then head over to Chuck's to chill .... bunch of people are there.