Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

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.
Tags: perl, tech
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.