Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Changing the alphabet, adding characters and tokens.

Changing the alphabet, adding characters and tokens.

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Addrodoc   (15 posts)  Bio
Date Tue 13 Feb 2007 06:49 AM (UTC)
Message
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.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 13 Feb 2007 07:10 AM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 13 Feb 2007 09:11 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 13 Feb 2007 09:18 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Addrodoc   (15 posts)  Bio
Date Reply #4 on Wed 14 Feb 2007 12:55 AM (UTC)
Message
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.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,243 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.