CON_ replacement

From: Karl B Buchner (
Date: 01/10/02

Replacing CON_ states with functions:
On a recent project in which I built a very bare-bones
MUD (about 2500 lines), instead of using CON_ states
I gave descriptors a pointer to a parser function which
is passed their input once they issue a command.  I found
this to be much cleaner than the nanny() function.
Here is a sample (its in c++)
 if(findchar(input, 0, 1))
  desc->write("That name has already been used, try another: ");
  ((creation_data *) desc->storage)->name = strdup(input);
  desc->prompt("Enter a password for your character: ", getpw, NULL);

 ((creation_data *) desc->storage)->password = strdup(input);
 desc->prompt("Please confirm the password for your character: ", confpw,

 if(strchk(((creation_data *) desc->storage)->password, input))
  desc->prompt("Choose a gender for your character (male or female): ",
getgender, NULL);
  delete ((creation_data *) desc->storage)->password;
  desc->prompt("Passwords do not match. Enter a password for your
character: ", getpw, NULL);
Ugh code looks ugly in this email prog.
Sorry if it's over 75 chars, Juno email program is bad bad bad
So, the question is, would such a system be
good for circle (It can also be used to make
OLC much cleaner!)


Note: if replying to second part of message, you should
rename Subject probably :P

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT