Changing the alphabet, adding characters and tokens.

Posted by Addrodoc on Tue 13 Feb 2007 06:49 AM — 5 posts, 18,211 views.

#0
Greetings,

I'm building a mud in another language and ran into a serious problem; the need of certain characters/tokens that are not provided in smaug, or any merc/diku mud for that matter. Anyone running a mud that is based on Tolkien's Middle-earth, will most likely be dealing with the same problem.

For example: The mud will not accept certain race names like Dúnadan or Númenórean. The same goes for a lot of important thematic names such as; Ilúvatar, Manwë, Aulë etc. Or Khazad-dûm and Lothlórien; I find it very important that these names are spelled properly and so I wish to add in the needed characters and tokens.

Hopefully someone will be able to help me with this, for I lack the knowledge to make these sort of changes to the codebase. I'm working with the fear 2.13 codebase wich is a smaug derative, using cygwin under windows xp. I'm not a complete noob, have made a few changes and installed snippets before, so I think I just need someone to point out where to go and what to add/change.

Help would be greatly appreciated,

-Addrodoc.
USA #1
I haven't looked at this code in quite a while, so keep that in mind. If I remember correctly, the output routines strip all characters that are not in a fairly narrow range of printable ASCII characters, which excludes the accented characters. You should be able to just change that part of the code to also print out accented characters.

Keep in mind, however, that you might run into a problem of people having trouble talking to your MUD if it expects accented characters for some things e.g. race selection. It is possible for me to switch the keyboard into accented mode, but it's a bother. Perhaps you could write string comparison routines that treat e.g. Numenorean and Númenórean as "equal" for the purposes of player input testing.
Australia Forum Administrator #2
Standard SMAUG seems to do that too, it drops non-ASCII characters.

In my copy of SMAUG FUSS I fixed the problem by editing comm.c file, and in the read_from_buffer function, located a line with isprint in it, like this:


   else if( isascii( d->inbuf[i] ) && isprint( d->inbuf[i] ) )
           d->incomm[k++] = d->inbuf[i];


Change that to:


  else if(  (unsigned char) d->inbuf[i] >= ' ' )
           d->incomm[k++] = d->inbuf[i];


This drops things which are less than a space, but lets others through. The "(unsigned char)" cast is necessary, because characters >= 0x80 actually appear to be negative.

You may have problems with the IAC character (hex 0xFF, which looks like y with 2 dots on it (ÿ)) which is used for some telnet negotiations, and if allowed through may confuse some clients.

You may need to test for the IAC character in the output routine, and if present, and not put there intentionally (eg. by server telnet negotiation), double it. That is, 0xFF becomes 0xFF 0xFF.

You may also need to be cautious about which font people use in their clients. If the wrong font is used, the wrong accented characters may appear.
Australia Forum Administrator #3
Re the IAC characters, MUSHclient appears to already double them when sending, however there is another problem in that function in SMAUG, that it detects incoming IAC characters, but does not allow for IAC IAC. So, you would need to modify a bit further up, to allow two IACs in a row, to be put in the input buffer as a single IAC.
#4
Thank you very much, that solved the problem. The IAC character problem, though, is a bit of a blur to me.
If possible, could you point out where to go and what to change?


Thanks,

-Addrodoc.