13 May, 2011, jurdendurden wrote in the 1st comment:
Votes: 0
At some point my note system stopped saving the recipients for any notes at all. My note system is based on Erwin's board system, but I've updated it to a sort of OLC editor (NEDIT is what I called it). Going into the shell and manually adding the recipients, then rebooting, makes the notes show up on the board just fine, and I've checked over the code but all seems well…. here are the corresponding code chunks… If anyone else can see something I'm missing I'd love to hear it :)

NEDIT ( nedit_to )
{
if (!argument)
{
SEND("You must specify a recipient!\r\n",ch);
return FALSE;
}
if (!ch->pcdata->in_progress)
{
SEND("Start a new note first!\r\n",ch);
return FALSE;
}


smash_tilde (argument); /* change ~ to - as we save this field as a string later */
ch->pcdata->in_progress->to_list = str_dup (argument);
SEND ("Recipient set.\r\n",ch);
return TRUE;

}


NEDIT ( nedit_send )
{
DESCRIPTOR_DATA *d;
char buf[MSL];

if (!ch->pcdata->in_progress)
{
SEND("Start a new note first!\r\n",ch);
return FALSE;
}

if (!ch->pcdata->in_progress->subject)
{
SEND("You need a subject first!\r\n",ch);
return FALSE;
}

if (!ch->pcdata->in_progress->to_list)
{
SEND("You need a recipient first!\r\n",ch);
return FALSE;
}

if (!ch->pcdata->in_progress->text)
{
SEND("You need a body first!\r\n",ch);
return FALSE;
}

finish_note (ch->pcdata->board, ch->pcdata->in_progress);
SEND ("Note posted.\r\n",ch);
ch->desc->editor = ED_NONE;
ch->pcdata->in_progress = NULL;
act ("{G$n finishes $s note.{x", ch, NULL, NULL, TO_ROOM);

for ( d = descriptor_list; d; d = d->next )
{
if ( d->connected == CON_PLAYING && d && d->character != ch )
{

sprintf(buf, "A new note has been added to the board: {G%s{x.\n\r", ch->pcdata->board->short_name );
SEND( buf, d->character );
}
}
return TRUE;
}


void finish_note (BOARD_DATA *board, NOTE_DATA *note)
{
FILE *fp;
NOTE_DATA *p;
char filename[200];

/* The following is done in order to generate unique date_stamps */

if (last_note_stamp >= current_time)
note->date_stamp = ++last_note_stamp;
else
{
note->date_stamp = current_time;
last_note_stamp = current_time;
}

if (board->note_first) /* are there any notes in there now? */
{
for (p = board->note_first; p->next; p = p->next )
; /* empty */

p->next = note;
}
else /* nope. empty list. */
board->note_first = note;

/* append note to note file */

sprintf (filename, "%s/%s", NOTE_DIR, board->short_name);

fp = fopen (filename, "a");
if (!fp)
{
bug ("Could not open one of the note files in append mode",0);
board->changed = TRUE;
return;
}

append_note (fp, note);
fclose (fp);
}


static void append_note (FILE *fp, NOTE_DATA *note)
{
fprintf (fp, "Sender %s~\n", note->sender);
fprintf (fp, "Date %s~\n", note->date);
fprintf (fp, "Stamp %ld\n", note->date_stamp);
fprintf (fp, "Expire %ld\n", note->expire);
fprintf (fp, "To %s~\n", note->to_list);
fprintf (fp, "Subject %s~\n", note->subject);
fprintf (fp, "Text\n%s~\n\n", note->text);
}
13 May, 2011, jurdendurden wrote in the 2nd comment:
Votes: 0
Update:

Turns out it's just stripping the first part of the recipient. So… if I type… note to all all, it will send it to all, but the first all will be stripped. Any ideas on this?
13 May, 2011, Kayle wrote in the 3rd comment:
Votes: 0
I don't really see anything off hand that would cause this.. but it might be happening before the actual function that sets it to to_list.
14 May, 2011, Davion wrote in the 4th comment:
Votes: 0
If the problem is with the recipient, then it'll likely have something to do with to_list. You'll have to look there, or post the code that handles it.
16 May, 2011, jurdendurden wrote in the 5th comment:
Votes: 0
Figured it out thanks for the input guys. Just for future reference… In the nedit function the game tries to dispatch an nedit command based on input, and splits up your input into command, arg1, and arg2. Arg2 would be the correct one for the recipient (note, to, all Figured it out thanks for the input guys. Just for future reference… In the nedit function the game tries to dispatch an nedit command based on input, and splits up your input into command, arg1, and arg2. Arg2 would be the correct one for the recipient (note, to, all [command, arg1, arg2), but I was using arg1. All better now thanks guys!
16 May, 2011, Runter wrote in the 6th comment:
Votes: 0
Obviously MSDP is the solution to this problem.
0.0/6