Title: login information for the masses Codebase: Rom 2.4b6 patched Author: Vorlin (kellert@ij.net) Ok, this is my first attempt at anything useful or productive. As I was looking through Kyndig's great pile of resources on snippets, I noticed there was nothing for post-imotd/motd login information for Rom so I decided "What the hell" and went to work. All I ask is an email saying you found something I wrote interesting enough to put in. Files to muck: act_comm.c comm.c merc.h save.c Legend: - old/current code non-modified + new stuff to put in In act_comm.c under the do_save function, put this: - save_char_obj(ch); - id = ch->id; - d = ch->desc; + d->host = str_dup(ch->pcdata->host); In comm.c, in 'case CON_READ_MOTD', do a search for this line (you should have it if you're using stock Rom 2.4b6): - do_function(ch, &do_unread, ""); + if (ch->pcdata->host == NULL + || sizeof(ch->pcdata->host) == 0 + || !str_cmp(ch->pcdata->host, "none")) { + sprintf(buf, "Updating site login info: %s\n\r", d->host); + send_to_char(buf, ch); + } else if (!str_cmp(ch->pcdata->host, d->host)) { + sprintf(buf, "Usual login: %s\n\r", ch->pcdata->host); + send_to_char(buf, ch); + } else { + sprintf(buf, "Last login: %s\n\r", ch->pcdata->host); + send_to_char(buf, ch); + sprintf(buf, "Current login: %s\n\r", d->host); + send_to_char(buf, ch); + } + + /* Update with str_dup, not = ! --Vorlin */ + ch->pcdata->host = str_dup(d->host); - break; In save.c, under fwrite_char(), put this: - if (ch->description[0] != '\0') - fprintf(fp, "Desc %s~\n", ch->description); + + /* Host information */ + if (ch->pcdata->host) { + fprintf(fp, "Host %s~\n", ch->pcdata->host); + } else { + fprintf(fp, "Host none~\n"); + } In save.c, under fread_char(), put this: - case 'H': - KEY("Hitroll", ch->hitroll, fread_number(fp)); - KEY("Hit", ch->hitroll, fread_number(fp)); + + /* Host information */ + KEYS("Host", ch->pcdata->host, fread_string(fp)); Finally, in merc.h, under PC_DATA, put this: + char * host; // Host information That should be it. If you have any questions on this, feel free to email me with the subject 'Host information' so I'll know what the email's about and I'll try to help out. --Vorlin, kellert@ij.net