[CODE] Email

From: Brian Christopher Guilbault (guil9964@nova.gmi.edu)
Date: 09/24/96


Hiya All-

In my seemingly never-ending quest to get email addresses to save in the 
playerfile, I am on what appears to be the last leg. I can get everything 
to work up till the character exists the game. Once the character exists 
the game and reconnects, when I stat them I always get this:

E-mail Address: q!`¤O¤

I realize that this is some other peice of memory, but have no idea where 
it's coming from or how to get rid of it. Here's my code in interpreter.c:

      SEND_TO_Q(email_alert, d);
      STATE(d) = CON_EMAIL;
      break;
    }


/* Email for the player */

    case CON_EMAIL:           /* Enter e-mail address          */


/* No real email address should be longer than 80 characters. */

    if (strlen(arg) > EMAIL_LENGTH) {
      SEND_TO_Q("Address too long.\r\n", d);
      SEND_TO_Q("Enter e-mail address: ", d);
      return;
      }

/* Save the email address to the playerfile */

    d->character->player.email = NULL;
    if (*arg)
      d->character->player.email = strdup(arg);
    roll_real_abils(d->character);
    STATE(d) = CON_STATROLL;
    break;

I know that this works because everything gets written properly. I think 
that the problem may be in db.c. I have a line in store_to_char which 
puts the mail address there:

  ch->player.email = str_dup(st->email);

but don't have a line in char_to_store because it was causing seg faults. 
Could that be it?

Also here's the code from act,wizard.c which shows the address in do_stat 
character, this seems to work fine though:

  if (!IS_NPC(k) && GET_LEVEL(ch) >= LVL_GRGOD) {
    strcpy(buf, "E-mail Address: ");
    strcat(buf, GET_EMAIL(k) ? GET_EMAIL(k) : "Anonymous");
    send_to_char(buf, ch);
  }


Thanks in advance...I'd really appreciate the help,

   -Brian


-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Brian Guilbault - GMI Engineering Institute
E-mail: guil9964@gmi.edu, dante@i-55.com
WWW: http://apollo.gmi.edu/~guil9964
QuarantineMUD: Telnet to exit1.i-55.com 4000
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+



+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST