Happy Thursday, and welcome to your weekly updates for NodeMU. I’m really pleased with the progress so far. The socket handler has undergone a major refactoring, and I was able to get logging in, both of which were relatively major accomplishments. Logging was something I wanted to have, as I was tired of having so much stuff barf out to STDOUT, so with logs for system messages, connections, and suspect activity, things are nicely compartmentalized.
I am VERY pleased with where the code is right now. There is a lot of testing to be done, but I am happy to be able to release version 0.0.8 (Hey, we’re early!) into the wild for anyone who wants to take a look at the (mostly non-commented and very un-optimized) code. Hit the jump to get more info and a download link…
I am pleased to say that the codebase is shaping up nicely (IMNSHO). I am starting to silo similar functions together in files, though there may be some more segmentation that happens along the way. But, there’s config files, both internal and user-friendly ones, there’s libraries for core functions, db, command functions, and the parser is isolated in its own library. Continue Reading…
Well, a great deal of code has flown out from under my fingers. A number of the basic commands that need to be there (say, pose, page, whisper, look, WHO for example) are in, and nominally working. It’s been a flurry of work, dealing with some of the asynchronous fun and callback gymnastics that Node requires. Continue Reading…
Every idea has a seminal moment. That instant where something pops into your head you have the thought ‘Hey, this is a possibility’. This happened for me when I saw a link for something called NoobHub. This is a very elementary chat server, written in Node, by Igor Korsakov and Sergii Tsegelnyk. I looked over the code, and just sort of…nodded. It clicked. It made sense. It wasn’t outlandish. There was no magic. But at the same time, it was like unicorns had barfed up glitter inside my head.
So, I studied the structure of how the server was set up, looking at how streams and buffer sizes, and most importantly, how it handled the identification of who had sent which command at which time. And therein lay that seminal moment. This could be a MU*. All it was missing was a bunch of commands and a WHO screen.
So, basing a socket server off of similar methodologies to NoobHub, I set up a basic socket server, and connected to it with TinyFugue, in two sessions. And then I typed in something on one window, and saw that it was echoed to both windows. Eureka. This could work.
Initially, as I had a CouchDB instance running on the same server that I was dev’ing this code, I thought that I would connect this project to CouchDB. However, that quickly became undesirable for a number of reasons. For starters, I want NodeMU to be easy to set up and use. No more ./configure, make update, make. That wasn’t possible if users had to figure out how to set up and administer a CouchDB instance. Not an easy task on good days, for relatively competent tech people. It has a lot of dependencies and only performs best with a fair amount of configuration.
So, as if that load of unicorn glitter in my head had altered the cosmic gravity of the universe in some fundamental way, posts started showing up on sites like HackerNews and EchoJS for NeDB, a new JSON-based database for Node. It was ideal. It was more than ideal. It had a MongoDB interface, it was clean, elegant, fast, and in less than an hour of coding, I had rewritten the interface from CouchDB to NeDB.
Now I have a stable socket server, and a database that I can use. Things are shaping up nicely.
So, this will probably be a bit of an ongoing series, as the project evolves. “Organic” is the word that would be used to describe something like this. My first goal was, quite simply, to build a MU* codebase. So, from that point of view, having something that people can connect to, and do say, pose, and emit so that others can hear them, is a success.
I have a long history with MUSH/MUX/MUD/MUCK codebases, as they have been an on-again/off-again part of my life. I began on MUCKs and MUDs, and graduated to the RP-based world of MUSH/MUX. Several times over the past ten years I have endeavoured to build a new codebase. I was inspired by the likes of Ashen-Shugar and RhostMUSH, I was inspired by Javelin and PennMUSH, Brazil and TinyMUX, and Lydia and TinyMUSH.