• Advertisement
Sign in to follow this  
  • entries
    557
  • comments
    1237
  • views
    422699

Yay, productivity

Sign in to follow this  

257 views

Thanks to all those who tried my MUD. 11 new users since yesterday [smile]
I actually got a lot done today, mostly to do with my client - DruinkIM. Now both my MUD and client support unicode (Hooray!). The problem is though, that the client can't read UTF-8 text, which is the best to use. The reason is that the TA2 protocol uses 7 of the 8 highest bits in a byte, which are needed for UTF-8. So I'd run into all sorts of problems trying to work out of the data is a TA2 feature byte, or if it's a UTF-8 character.
So, I got around this with some simple trickery. The MUD server can read UTF-8 text. This means that everything, including telnet can use it perfectly well if they don't need any non-ASCII characters. When a UTF-8 character is read, the input layer converts the bytes into a ASCII-text tag. For example, the UK pound symbol (GBP, code 0xC2A3) gets converted into <-x163>. This tag then gets processed in the conversion layer, along with any other tags like bold, colour, etc.
When it's time to send the string, I convert the output depending on the protocol the client is using (which was done already to allow 24-bit colours to TA2 capable clients). If the client is advertised as Druink protocol, I don't need to do any conversion. I send the processed string to the client, and it processes it. If the client is a TA2 protocol client, I erase all unicode characters, since they can't understand them. If it's a telnet client (negotiating or non-negotiating), then I convert the character to UTF-8 and send it out, hoping that the client can understand UTF-8.

In my client, if you try to send non-ASCII, you have 3 ways of sending it, as advertised by the Protocol settings page:
Protocol settings page of DruinkIM
  • No Unicode support just ditches the unicode characters in the input and doesn't bother trying to send them. Useful if you want to use DruinkIM in a MUD that doesn't do unicode
  • UTF-8 will convert the unicode values to UTF-8 and send them
  • Druink tagged converts the unicode values to <-x???> style tags, and sends those. I can't see why you'd want to use this over UTF-8, but the option is there.

    I also released a new update (well, 2) of DruinkIM. So if any of you downloaded it, you get to see the auto-updater working :P Here's a list of what's changed (straight from version.txt):
  • Currsong now has position and duration parameters
  • Weather plugin can format as 'C, 'F and 'K, and parses feeds that are in Farenheight (Thanks, America...)
  • Removed /code plugin, was only used for spamming
  • Removed /diskspace command, was only used for spamming
  • Fixed bug in /blend
  • Disabled Nagle algorithm while pinging, to get a more accurate time
  • Fixed bug with events where $TITLE and $ARTIST sent track number
  • Added variables to events: $POSITION, $LENGTH, $STATUS, $PLAYER, $BITRATE, $SAMPLERATE, $CHANNELS
  • Fixed bug with events where no newline was sent after text
  • MSN conversation pastes are nicely formatted now
  • Added support from Druink protocol (allows unicode characters)
  • Changed default currsong string and post-login string
  • Modified "TA2 Protocol" settings page to "Protocol"
  • Added support for outgoing UTF-8
  • Added support for Druink tagged Unicode (<-x???> tags)

    I also fixed the following bugs/features in the server:
  • You can no longer send a line that contains just format tags. The server will just ignore the line
  • Fixed a minor bug in 24-bit to telnet colour conversion
  • Fixed a parsing error where "<-x123<-0>>" was displayed as "<-x123<-0>>" instead of "<-x123>" (I.e. the inner tag wasn't parsed)
  • You can no longer log in twice at the same time using the same username. The first connection will get disconnected
  • Changed the flood counters. You can now send 10 lines (instead of 5) before it's considered flooding and you get auto-kicked
  • The MySQL database shouldn't idle timeout any more (hopefully)
  • Telnet negotiation sequences are now logged (Not really a bug, but it's something to list...)
  • Telnet codes Are You There, Erase Character (AKA backspace) and Erase Line are now correctly handled

    Tomorrow I hope to add commands to the MUD, just some basic ones like /me, /quit, /sayto, etc, and anything else I can think of. I have a few more features I want to add to DruinkIM, since my todo list has a few things on it:
  • Add option for showing text instead of / as well as icons (in toolbar)
  • Add option to timestamp log lines
  • Add maximum history buffer option
  • Make settings dialog non-modal
  • Add "Apply" to settings dialog
  • Add /specs command for CPU, memory, resolution, video card, etc - Not sure about this. It'll probably be in a plugin anyway
  • Add more text decorations - 1337, pirate, etc
  • A manual!

    Well, that's it. It's 3:45am here now, so I'd better goto bed...

    EDIT: Thumbnailed image
  • Sign in to follow this  


    4 Comments


    Recommended Comments

    I am vaguely interested in adding Druink protocol support to WS client, which is scheduled to come out when I drop dead, or when DNF is released - whichever comes first.

    Just a pointless heads up.

    Share this comment


    Link to comment
    Well, Druink protocol is exactly the same as the TA2 protocol, except the least significant bit is used to mean "there follows 6 hex digs representing a unicode character", but only if TA2BIT_ENABLE is set. Otherwise, just ignore it.
    If there's a colour and a unicode value, the colour comes first.

    Share this comment


    Link to comment
    Ah, funky. I was hoping we'd eventually use that last bit for <blink> 'ing text :)

    Share this comment


    Link to comment
    Quote:
    Ah, funky. I was hoping we'd eventually use that last bit for <blink> 'ing text :)

    *scream*

    Share this comment


    Link to comment

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    • Advertisement