/**************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvements copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Much time and thought has gone into this software and you are *
* benefiting. We hope that you share your changes too. What goes *
* around, comes around. *
***************************************************************************
* ROM 2.4 is copyright 1993-1998 Russ Taylor *
* ROM has been brought to you by the ROM consortium *
* Russ Taylor (rtaylor@hypercube.org) *
* Gabrielle Taylor (gtaylor@hypercube.org) *
* Brian Moore (zump@rom.org) *
* By using this code, you have agreed to follow the terms of the *
* ROM license, in the file Rom24/doc/rom.license *
***************************************************************************
* 1stMUD ROM Derivative (c) 2001-2003 by Ryan Jennings *
* http://1stmud.dlmud.com/ <r-jenn@shaw.ca> *
***************************************************************************/
#include "merc.h"
#include "interp.h"
#include "telnet.h"
#include "recycle.h"
#include "lookup.h"
#include "tables.h"
PROTOTYPE(bool check_playing, (DESCRIPTOR_DATA *, const char *));
PROTOTYPE(bool check_parse_name, (const char *));
PROTOTYPE(bool check_reconnect, (DESCRIPTOR_DATA *, const char *, bool));
void handle_con_get_term(DESCRIPTOR_DATA * d, const char *argument)
{
switch (argument[0])
{
case 'y':
case 'Y':
SET_BIT(d->d_flags, DESC_COLOUR);
d_println(d, "{cColour Enabled...{x", 0);
break;
case 'n':
case 'N':
REMOVE_BIT(d->d_flags, DESC_COLOUR);
d_println(d, "Colour Disabled...", 0);
break;
case 't':
case 'T':
d_println(d,
FORMATF("\n\rThis text should be " CL_FORMAT2
"GREEN" CL_DEFAULT
".\n\rThis text should be " CL_FORMAT2 "RED"
CL_DEFAULT ".\n\r", CL_BRIGHT, FG_GREEN,
CL_BRIGHT, FG_RED), 0);
d_print(d, "\n\rDid you see colour? (Y)es, (N)o, (T)est: ", 0);
return;
default:
d_print(d, "Please answer (Y)es, (N)o, (T)est: ", 0);
return;
}
show_greeting(d);
d->connected = CON_GET_NAME;
}
void handle_con_get_name(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch;
bool fOld;
if (IS_NULLSTR(argument))
{
close_socket(d);
return;
}
//argument[0] = UPPER (argument[0]);
if (!check_parse_name(argument))
{
d_print(d, "Illegal name, try another.\n\rName: ", 0);
return;
}
fOld = load_char_obj(d, argument);
ch = d->character;
if (IS_SET(ch->act, PLR_DENY))
{
sprintf(log_buf, "Denying access to %s@%s.", argument, d->host);
log_string(log_buf);
d_println(d, "You are denied access.", 0);
close_socket(d);
return;
}
if (check_ban(d->host, BAN_PERMIT) && !IS_SET(ch->act, PLR_PERMIT))
{
d_println(d, "Your site has been banned from this mud.", 0);
close_socket(d);
return;
}
if (check_reconnect(d, argument, FALSE))
{
fOld = TRUE;
}
else
{
if (IS_SET(mud_info.mud_flags, MUD_WIZLOCK) && !IS_IMMORTAL(ch))
{
d_println(d, "The game is wizlocked.", 0);
close_socket(d);
return;
}
}
if (fOld)
{
/* Old player */
d_print(d, "Password: ", 0);
d_write(d, echo_off_str, 0);
d->connected = CON_GET_OLD_PASSWORD;
return;
}
else
{
/* New player */
if (IS_SET(mud_info.mud_flags, MUD_NEWLOCK))
{
d_println(d, "The game is newlocked.", 0);
close_socket(d);
return;
}
if (check_ban(d->host, BAN_NEWBIES))
{
d_println(d, "New players are not allowed from your site.", 0);
close_socket(d);
return;
}
d_printf(d, "Did I get that right, %s (Y/N)? ", capitalize(argument));
d->connected = CON_CONFIRM_NEW_NAME;
return;
}
}
void handle_con_get_old_password(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
d_println(d, "", 0);
if (str_casecmp(crypt(argument, ch->pcdata->pwd), ch->pcdata->pwd))
{
d_println(d, "Wrong password.", 0);
close_socket(d);
return;
}
d_write(d, echo_on_str, 0);
if (check_playing(d, ch->name))
return;
if (check_reconnect(d, ch->name, TRUE))
return;
sprintf(log_buf, "%s@%s has connected.", ch->name, d->host);
log_string(log_buf);
wiznet(log_buf, NULL, NULL, WIZ_SITES, 0, get_trust(ch));
if (IS_IMMORTAL(ch))
{
do_function(ch, &do_oldhelp, "imotd");
d->connected = CON_READ_IMOTD;
}
else
{
do_function(ch, &do_oldhelp, "motd");
d->connected = CON_READ_MOTD;
}
set_desc_flags(d);
}
void handle_con_break_connect(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
DESCRIPTOR_DATA *d_old, *pd_next;
switch (*argument)
{
case 'y':
case 'Y':
for (d_old = descriptor_first; d_old != NULL; d_old = pd_next)
{
pd_next = d_old->next;
if (d_old == d || d_old->character == NULL)
continue;
if (str_cmp
(ch->name,
d_old->original ? d_old->original->name : d_old->character->
name))
continue;
close_socket(d_old);
}
if (check_reconnect(d, ch->name, TRUE))
return;
d_print(d, "Reconnect attempt failed.\n\rName: ", 0);
if (d->character != NULL)
{
free_char(d->character);
d->character = NULL;
}
d->connected = CON_GET_NAME;
break;
case 'n':
case 'N':
d_print(d, "Name: ", 0);
if (d->character != NULL)
{
free_char(d->character);
d->character = NULL;
}
d->connected = CON_GET_NAME;
break;
default:
d_print(d, "Please type Y or N? ", 0);
break;
}
}
void handle_con_confirm_new_name(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
switch (*argument)
{
case 'y':
case 'Y':
d_printf(d, "New character.\n\rGive me a password for %s: ", ch->name);
d_write(d, echo_off_str, 0);
d->connected = CON_GET_NEW_PASSWORD;
break;
case 'n':
case 'N':
d_print(d, "Ok, what IS it, then? ", 0);
free_char(d->character);
d->character = NULL;
d->connected = CON_GET_NAME;
break;
default:
d_print(d, "Please type Yes or No? ", 0);
break;
}
}
void handle_con_get_new_password(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
const char *pwdnew;
const char *p;
d_println(d, "", 0);
if (strlen(argument) < 5)
{
d_print(d,
"Password must be at least five characters long.\n\rPassword: ",
0);
return;
}
pwdnew = crypt(argument, ch->name);
for (p = pwdnew; *p != '\0'; p++)
{
if (*p == '~')
{
d_print(d,
"New password not acceptable, try again.\n\rPassword: ", 0);
return;
}
}
replace_string(ch->pcdata->pwd, pwdnew);
d_print(d, "Please retype password: ", 0);
d->connected = CON_CONFIRM_NEW_PASSWORD;
}
void handle_con_confirm_new_password(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
RACE_DATA *race;
d_println(d, "", 0);
if (str_casecmp(crypt(argument, ch->pcdata->pwd), ch->pcdata->pwd))
{
d_print(d, "Passwords don't match.\n\rRetype password: ", 0);
d->connected = CON_GET_NEW_PASSWORD;
return;
}
d_write(d, echo_on_str, 0);
d_println(d, "The following races are available:", 0);
d_print(d, " ", 1);
for (race = race_first; race; race = race->next)
{
if (!race->pc_race)
continue;
d_print(d, race->name, 0);
d_print(d, " ", 1);
}
d_println(d, "", 0);
d_print(d, "What is your race (help for more information)? ", 0);
d->connected = CON_GET_NEW_RACE;
}
void handle_con_get_new_race(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
char arg[MAX_INPUT_LENGTH];
RACE_DATA *race;
int i;
one_argument(argument, arg);
if (!str_cmp(arg, "help"))
{
argument = one_argument(argument, arg);
if (IS_NULLSTR(argument))
do_function(ch, &do_oldhelp, "race help");
else
do_function(ch, &do_oldhelp, argument);
d_print(d, "What is your race (help for more information)? ", 0);
return;
}
race = race_lookup(argument);
if (race == NULL || !race->pc_race)
{
d_println(d, "That is not a valid race.", 0);
d_println(d, "The following races are available:", 0);
d_print(d, " ", 1);
for (race = race_first; race; race = race->next)
{
if (!race->pc_race)
continue;
d_print(d, race->name, 0);
d_print(d, " ", 1);
}
d_println(d, "", 0);
d_print(d, "What is your race? (help for more information) ", 0);
return;
}
if (IS_SET(ch->act, PLR_REMORT) && ch->race != race)
{
d_printlnf(d, "You are now a %s forever.", ch->race->name);
ch->pcdata->stay_race = TRUE;
}
ch->race = race;
/* initialize stats */
for (i = 0; i < MAX_STATS; i++)
ch->perm_stat[i] = race->stats[i];
ch->affected_by = ch->affected_by | race->aff;
ch->imm_flags = ch->imm_flags | race->imm;
ch->res_flags = ch->res_flags | race->res;
ch->vuln_flags = ch->vuln_flags | race->vuln;
ch->form = race->form;
ch->parts = race->parts;
/* add skills */
for (i = 0; i < 5; i++)
{
if (race->skills[i] == NULL)
break;
group_add(ch, race->skills[i], FALSE);
}
/* add cost */
ch->pcdata->points = race->points;
ch->size = race->size;
d_print(d, "What is your sex (M/F)? ", 0);
d->connected = CON_GET_NEW_SEX;
}
void handle_con_get_new_sex(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
int iClass;
char buf[MSL];
switch (argument[0])
{
case 'm':
case 'M':
ch->sex = SEX_MALE;
ch->pcdata->true_sex = SEX_MALE;
break;
case 'f':
case 'F':
ch->sex = SEX_FEMALE;
ch->pcdata->true_sex = SEX_FEMALE;
break;
default:
d_print(d, "That's not a sex.\n\rWhat IS your sex? ", 0);
return;
}
strcpy(buf, "Select a class [");
for (iClass = 0; iClass < maxClass; iClass++)
{
if (is_class(ch, iClass))
continue;
if (iClass > 0)
strcat(buf, " ");
strcat(buf, class_table[iClass].name);
}
strcat(buf, "]: ");
d_print(d, buf, 0);
d->connected = CON_GET_NEW_CLASS;
}
void handle_con_get_new_class(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
int iClass = class_lookup(argument);
if (iClass == -1)
{
d_print(d, "That's not a class.\n\rWhat IS your class? ", 0);
return;
}
/* check to see if person is already a class */
if (is_class(ch, iClass))
{
d_printlnf(d, "You are already part %s. Try another!",
class_table[iClass].name);
return;
}
/* Set the class. */
ch->Class[number_classes(ch)] = iClass;
ch->Class[number_classes(ch) + 1] = -1;
/* Last class is ALWAYS -1 */
if (!IS_SET(ch->act, PLR_REMORT))
{
sprintf(log_buf, "%s@%s new player.", ch->name, d->host);
log_string(log_buf);
wiznet("Newbie alert! $N sighted.", ch, NULL, WIZ_NEWBIE, 0, 0);
wiznet(log_buf, NULL, NULL, WIZ_SITES, 0, get_trust(ch));
d_println(d, "", 0);
d_println(d, "You may be good, neutral, or evil.", 0);
d_print(d, "Which alignment (G/N/E)? ", 0);
d->connected = CON_GET_ALIGNMENT;
}
else
{
/* send remorts to customization */
d_println(d, "", 0);
ch->gen_data = new_gen_data();
ch->gen_data->points_chosen = ch->pcdata->points;
add_base_groups(ch);
ch->pcdata->learned[gsn_recall] =
UMAX(50, ch->pcdata->learned[gsn_recall]);
d_println(d, "Do you wish to customize this character?", 0);
d_println(d,
"Customization takes time, but allows a wider range of skills and abilities.",
0);
d_print(d, "Customize (Y/N)? ", 0);
d->connected = CON_DEFAULT_CHOICE;
}
}
void send_deity_info(DESCRIPTOR_DATA * d)
{
DEITY_DATA *i;
d_println(d, "\n\rDeities Available:", 0);
for (i = deity_first; i; i = i->next)
{
d_printlnf(d, "\t%-12s : %s", i->name, i->desc);
}
d_println(d, "", 0);
}
void handle_con_get_alignment(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
switch (argument[0])
{
case 'g':
case 'G':
ch->alignment = 750;
break;
case 'n':
case 'N':
ch->alignment = 0;
break;
case 'e':
case 'E':
ch->alignment = -750;
break;
default:
d_println(d, "That's not a valid alignment.", 0);
d_print(d, "Which alignment (G/N/E)? ", 0);
return;
}
send_deity_info(d);
d_print(d, "What deity would you like to worship?", 0);
d->connected = CON_GET_DEITY;
return;
}
void send_timezone_info(DESCRIPTOR_DATA * d)
{
int i;
CHAR_DATA *ch = CH(d);
chprintlnf(ch, "%-6s %-29s (%s)", "Name", "City/Zone Crosses", "Time");
chprintlnf(ch, "%s", draw_line(ch, NULL, 0));
for (i = 0; i < MAX_TZONE; i++)
{
chprintlnf(ch, "%-6s %-29s (%s)", tzone_table[i].name,
tzone_table[i].zone, str_time(current_time, i, NULL));
}
chprintlnf(ch, "%s", draw_line(ch, NULL, 0));
}
void handle_con_get_deity(DESCRIPTOR_DATA * d, const char *argument)
{
char arg[MIL];
DEITY_DATA *i;
CHAR_DATA *ch = CH(d);
one_argument(argument, arg);
if (!str_cmp(arg, "help"))
{
argument = one_argument(argument, arg);
if (IS_NULLSTR(argument))
{
send_deity_info(d);
d_println(d, "What deity would you like to worship?", 0);
}
else
do_function(ch, &do_help, argument);
d_println(d, "What deity would you like to worship?", 0);
return;
}
i = deity_lookup(argument);
if (i == NULL)
{
send_deity_info(d);
d_println(d, "What deity would you like to worship?", 0);
return;
}
ch->deity = i;
d_printlnf(d, "\n\rYou now worship %s.", ch->deity->name);
send_timezone_info(d);
d_println(d, "What time zone do you live in?", 0);
d->connected = CON_GET_TIMEZONE;
return;
}
void handle_con_get_timezone(DESCRIPTOR_DATA * d, const char *argument)
{
int i;
char arg[MIL];
CHAR_DATA *ch = CH(d);
one_argument(argument, arg);
if (IS_NULLSTR(arg))
{
send_timezone_info(d);
d_println(d, "What time zone do you live in?", 0);
return;
}
if (!str_cmp(arg, "help"))
{
d_println(d,
"Time zones around the world are split up into 24 areas,", 0);
d_println(d, "each relating to Greenwich Mean Time (GMT)", 0);
d_println(d, "What time zone do you live in?", 0);
return;
}
i = tzone_lookup(argument);
if (i == -1)
{
d_println(d,
"That is not a valid time zone, please enter the full time zone name. (ex. GMT-5)",
0);
d_println(d, "What time zone do you live in?", 0);
return;
}
ch->pcdata->timezone = i;
d_printlnf(d, "Your time zone is now %s %s (%s)",
tzone_table[i].name, tzone_table[i].zone, str_time(current_time,
i, NULL));
d_println(d, "", 0);
group_add(ch, "rom basics", FALSE);
add_base_groups(ch);
ch->pcdata->learned[gsn_recall] = 50;
d_println(d, "Do you wish to customize this character?", 0);
d_println(d,
"Customization takes time, but allows a wider range of skills and abilities.",
0);
d_print(d, "Customize (Y/N)? ", 0);
d->connected = CON_DEFAULT_CHOICE;
}
void handle_con_default_choice(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
int i;
char buf[MSL];
d_println(d, "", 0);
switch (argument[0])
{
case 'y':
case 'Y':
ch->gen_data = new_gen_data();
ch->gen_data->points_chosen = ch->pcdata->points;
do_function(ch, &do_oldhelp, "group header");
list_group_costs(ch);
if (!IS_SET(ch->act, PLR_REMORT)) /* too spammy at tier 6 or 7 */
{
d_println(d, "You already have the following skills:", 0);
do_function(ch, &do_skills, "");
}
do_function(ch, &do_oldhelp, "menu choice");
d->connected = CON_GEN_GROUPS;
break;
case 'n':
case 'N':
add_default_groups(ch);
d_println(d, "", 0);
d_println(d, "Please pick a weapon from the following choices:", 0);
buf[0] = '\0';
for (i = 0; weapon_table[i].name != NULL; i++)
if (ch->pcdata->learned[*weapon_table[i].gsn] > 0)
{
strcat(buf, weapon_table[i].name);
strcat(buf, " ");
}
strcat(buf, "\n\rYour choice? ");
d_print(d, buf, 0);
d->connected = CON_PICK_WEAPON;
break;
default:
d_print(d, "Please answer (Y/N)? ", 0);
return;
}
}
void handle_con_pick_weapon(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
int i, weapon;
char buf[MSL];
d_println(d, "", 0);
weapon = weapon_lookup(argument);
if (weapon == -1 || ch->pcdata->learned[*weapon_table[weapon].gsn] <= 0)
{
d_println(d, "That's not a valid selection. Choices are:", 0);
buf[0] = '\0';
for (i = 0; weapon_table[i].name != NULL; i++)
if (ch->pcdata->learned[*weapon_table[i].gsn] > 0)
{
strcat(buf, weapon_table[i].name);
strcat(buf, " ");
}
strcat(buf, "\n\rYour choice? ");
d_print(d, buf, 0);
return;
}
ch->pcdata->learned[*weapon_table[weapon].gsn] =
UMAX(40, ch->pcdata->learned[*weapon_table[weapon].gsn]);
d_println(d, "", 0);
if (IS_SET(ch->act, PLR_REMORT))
{
d_println(d, "Sucessful Remort!", 0);
wiznet("Sucessful Remort! $N sighted.", ch, NULL, 0, 0, 0);
REMOVE_BIT(ch->comm, COMM_QUIET);
char_from_room(ch);
char_to_room(ch, get_room_index(ROOM_VNUM_SCHOOL));
d->connected = CON_PLAYING;
act
("The Priest brings you back to reality, and you feel quite different now...",
ch, NULL, NULL, TO_CHAR);
do_function(ch, &do_outfit, "");
save_char_obj(ch);
return;
}
do_function(ch, &do_oldhelp, "motd");
d->connected = CON_READ_MOTD;
}
void handle_con_gen_groups(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
char buf[MSL];
int i;
chprintln(ch, "");
if (!str_cmp(argument, "done"))
{
if (ch->pcdata->points == ch->race->points)
{
chprintln(ch, "You didn't pick anything.");
return;
}
if (!IS_SET(ch->act, PLR_REMORT)
&& ch->pcdata->points < 40 + ch->race->points)
{
chprintlnf(ch,
"You must take at least %d points of skills and groups",
40 + ch->race->points);
return;
}
chprintlnf(ch, "Creation points: %d", ch->pcdata->points);
chprintlnf(ch, "Experience per level: %d",
exp_per_level(ch, ch->gen_data->points_chosen));
if (ch->pcdata->points < 40)
ch->train = (40 - ch->pcdata->points + 1) / 2;
free_gen_data(ch->gen_data);
ch->gen_data = NULL;
d_println(d, "", 0);
d_println(d, "Please pick a weapon from the following choices:", 0);
buf[0] = '\0';
for (i = 0; weapon_table[i].name != NULL; i++)
if (ch->pcdata->learned[*weapon_table[i].gsn] > 0)
{
strcat(buf, weapon_table[i].name);
strcat(buf, " ");
}
strcat(buf, "\n\rYour choice? ");
d_print(d, buf, 0);
d->connected = CON_PICK_WEAPON;
return;
}
if (!parse_gen_groups(ch, argument))
chprintln(ch,
"Choices are: list,learned,premise,add,drop,info,help, and done.");
do_function(ch, &do_oldhelp, "menu choice");
}
void handle_con_read_imotd(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
d_println(d, "", 0);
do_function(ch, &do_oldhelp, "motd");
d->connected = CON_READ_MOTD;
}
void handle_con_read_motd(DESCRIPTOR_DATA * d, const char *argument)
{
CHAR_DATA *ch = CH(d);
char buf[MSL];
if (ch->pcdata == NULL || IS_NULLSTR(ch->pcdata->pwd))
{
d_println(d, "Warning! Null password!", 0);
d_println(d, "Please report old password with bug.", 0);
d_println(d, "Type 'password null <new password>' to fix.", 0);
}
d_println(d, "\n\rWelcome to ROM 2.4. Please do not feed the mobiles.", 0);
LINK(ch, char_first, char_last, next, prev);
LINK(ch, player_first, player_last, next_player, prev_player);
d->connected = CON_PLAYING;
reset_char(ch);
if (ch->level == 0)
{
if (ch->Class[0] == -1)
ch->Class[0] = 0;
ch->perm_stat[class_table[ch->Class[0]].attr_prime] += 3;
ch->level = 1;
ch->exp = exp_per_level(ch, ch->pcdata->points);
ch->hit = ch->max_hit;
ch->mana = ch->max_mana;
ch->move = ch->max_move;
ch->train = 3;
ch->practice = 5;
sprintf(buf, "the %s", class_table[ch->Class[0]].name);
set_title(ch, buf);
do_function(ch, &do_outfit, "");
obj_to_char(create_object(get_obj_index(OBJ_VNUM_MAP), 0), ch);
char_to_room(ch, get_room_index(ROOM_VNUM_SCHOOL));
chprintln(ch, "");
do_function(ch, &do_oldhelp, "newbie info");
chprintln(ch, "");
}
else if (ch->in_room != NULL)
{
char_to_room(ch, ch->in_room);
}
else if (IS_IMMORTAL(ch))
{
char_to_room(ch, get_room_index(ROOM_VNUM_CHAT));
}
else
{
char_to_room(ch, get_room_index(ROOM_VNUM_TEMPLE));
}
announce(ch, INFO_LOGIN, "$n has entered the realms.");
act("$n has entered the game.", ch, NULL, NULL, TO_ROOM);
do_function(ch, &do_look, "auto");
wiznet("$N has left real life behind.", ch, NULL, WIZ_LOGINS,
WIZ_SITES, get_trust(ch));
if (ch->pet != NULL)
{
char_to_room(ch->pet, ch->in_room);
act("$n has entered the game.", ch->pet, NULL, NULL, TO_ROOM);
}
do_function(ch, &do_ncheck, "");
unfinished_quest(ch);
update_explored(ch);
checkcorpse(ch);
}
/*
* Deal with sockets that haven't logged in yet.
*/
void nanny(DESCRIPTOR_DATA * d, const char *argument)
{
/* Delete leading spaces UNLESS character is writing a note */
if (d->connected != CON_NOTE_TEXT)
{
while (isspace(*argument))
argument++;
}
switch (d->connected)
{
default:
bugf("Nanny: bad d->connected %d.", d->connected);
close_socket(d);
return;
case CON_GET_TERM:
handle_con_get_term(d, argument);
break;
case CON_GET_NAME:
handle_con_get_name(d, argument);
break;
case CON_GET_OLD_PASSWORD:
handle_con_get_old_password(d, argument);
break;
/* RT code for breaking link */
case CON_BREAK_CONNECT:
handle_con_break_connect(d, argument);
break;
case CON_CONFIRM_NEW_NAME:
handle_con_confirm_new_name(d, argument);
break;
case CON_GET_NEW_PASSWORD:
handle_con_get_new_password(d, argument);
break;
case CON_CONFIRM_NEW_PASSWORD:
handle_con_confirm_new_password(d, argument);
break;
case CON_GET_NEW_RACE:
handle_con_get_new_race(d, argument);
break;
case CON_GET_NEW_SEX:
handle_con_get_new_sex(d, argument);
break;
case CON_GET_NEW_CLASS:
handle_con_get_new_class(d, argument);
break;
case CON_GET_ALIGNMENT:
handle_con_get_alignment(d, argument);
break;
case CON_GET_DEITY:
handle_con_get_deity(d, argument);
break;
case CON_GET_TIMEZONE:
handle_con_get_timezone(d, argument);
break;
case CON_DEFAULT_CHOICE:
handle_con_default_choice(d, argument);
break;
case CON_PICK_WEAPON:
handle_con_pick_weapon(d, argument);
break;
case CON_GEN_GROUPS:
handle_con_gen_groups(d, argument);
break;
case CON_READ_IMOTD:
handle_con_read_imotd(d, argument);
break;
/* states for new note system, (c)1995-96 erwin@andreasen.org */
/* ch MUST be PC here; have nwrite check for PC status! */
case CON_NOTE_TO:
handle_con_note_to(d, argument);
break;
case CON_NOTE_SUBJECT:
handle_con_note_subject(d, argument);
break; /* subject */
case CON_NOTE_EXPIRE:
handle_con_note_expire(d, argument);
break;
case CON_NOTE_TEXT:
handle_con_note_text(d, argument);
break;
case CON_NOTE_FINISH:
handle_con_note_finish(d, argument);
break;
case CON_READ_MOTD:
handle_con_read_motd(d, argument);
break;
}
return;
}